001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.kernel.atom;
016    
017    import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
018    
019    import java.util.List;
020    
021    /**
022     * @author Igor Spasic
023     */
024    public class AtomCollectionAdapterRegistryUtil {
025    
026            public static AtomCollectionAdapter<?> getAtomCollectionAdapter(
027                    String collectionName) {
028    
029                    return getAtomCollectionAdapterRegistry().getAtomCollectionAdapter(
030                            collectionName);
031            }
032    
033            public static AtomCollectionAdapterRegistry
034                    getAtomCollectionAdapterRegistry() {
035    
036                    PortalRuntimePermission.checkGetBeanProperty(
037                            AtomCollectionAdapterRegistryUtil.class);
038    
039                    return _atomCollectionAdapterRegistry;
040            }
041    
042            public static List<AtomCollectionAdapter<?>> getAtomCollectionAdapters() {
043                    return getAtomCollectionAdapterRegistry().getAtomCollectionAdapters();
044            }
045    
046            public static void register(
047                    AtomCollectionAdapter<?> atomCollectionAdapter) {
048    
049                    getAtomCollectionAdapterRegistry().register(atomCollectionAdapter);
050            }
051    
052            public static void register(
053                    List<AtomCollectionAdapter<?>> atomCollectionAdapters) {
054    
055                    for (AtomCollectionAdapter<?> atomCollectionAdapter :
056                                    atomCollectionAdapters) {
057    
058                            register(atomCollectionAdapter);
059                    }
060            }
061    
062            public static void unregister(
063                    AtomCollectionAdapter<?> atomCollectionAdapter) {
064    
065                    getAtomCollectionAdapterRegistry().unregister(atomCollectionAdapter);
066            }
067    
068            public static void unregister(
069                    List<AtomCollectionAdapter<?>> atomCollectionAdapters) {
070    
071                    for (AtomCollectionAdapter<?> atomCollectionAdapter :
072                                    atomCollectionAdapters) {
073    
074                            unregister(atomCollectionAdapter);
075                    }
076            }
077    
078            public void setAtomCollectionAdapterRegistry(
079                    AtomCollectionAdapterRegistry atomCollectionAdapterRegistry) {
080    
081                    PortalRuntimePermission.checkSetBeanProperty(getClass());
082    
083                    _atomCollectionAdapterRegistry = atomCollectionAdapterRegistry;
084            }
085    
086            private static AtomCollectionAdapterRegistry _atomCollectionAdapterRegistry;
087    
088    }