001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.repository.registry;
016    
017    import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
018    import com.liferay.portal.repository.util.ExternalRepositoryFactory;
019    
020    import java.util.Collection;
021    
022    /**
023     * @author Adolfo P??rez
024     */
025    public class RepositoryClassDefinitionCatalogUtil {
026    
027            public static Iterable<RepositoryClassDefinition>
028                    getExternalRepositoryClassDefinitions() {
029    
030                    return getRepositoryClassDefinitionCatalog().
031                            getExternalRepositoryClassDefinitions();
032            }
033    
034            public static Collection<String> getExternalRepositoryClassNames() {
035                    return getRepositoryClassDefinitionCatalog().
036                            getExternalRepositoryClassNames();
037            }
038    
039            public static RepositoryClassDefinition getRepositoryClassDefinition(
040                    String repositoryTypeKey) {
041    
042                    return getRepositoryClassDefinitionCatalog().
043                            getRepositoryClassDefinition(repositoryTypeKey);
044            }
045    
046            public static RepositoryClassDefinitionCatalog
047                    getRepositoryClassDefinitionCatalog() {
048    
049                    PortalRuntimePermission.checkGetBeanProperty(
050                            RepositoryClassDefinitionCatalogUtil.class);
051    
052                    return _repositoryClassDefinitionCatalog;
053            }
054    
055            public static void registerLegacyExternalRepositoryFactory(
056                    String className, ExternalRepositoryFactory externalRepositoryFactory) {
057    
058                    getRepositoryClassDefinitionCatalog().
059                            registerLegacyExternalRepositoryFactory(
060                                    className, externalRepositoryFactory);
061            }
062    
063            public static void unregisterLegacyExternalRepositoryFactory(
064                    String className) {
065    
066                    getRepositoryClassDefinitionCatalog().
067                            unregisterLegacyExternalRepositoryFactory(className);
068            }
069    
070            public void setRepositoryClassDefinitionCatalog(
071                    RepositoryClassDefinitionCatalog repositoryClassDefinitionCatalog) {
072    
073                    PortalRuntimePermission.checkSetBeanProperty(getClass());
074    
075                    _repositoryClassDefinitionCatalog = repositoryClassDefinitionCatalog;
076            }
077    
078            private static RepositoryClassDefinitionCatalog
079                    _repositoryClassDefinitionCatalog;
080    
081    }