Package org.fcrepo.server

Examples of org.fcrepo.server.Module


        m_rebuilder = rebuilder;
        if (options != null) {
            try {
                // ensure rebuilds are possible before trying anything,
                // as rebuilder.start() may be destructive!
                Module mod = server.getBean(llstoreInterface, Module.class);
                Class<?> clazz = mod.getClass();
                boolean isListable = false;
                for (Class<?> iface : clazz.getInterfaces()) {
                    if (iface.getName().equals(listableInterface)) {
                        isListable = true;
                    }
View Full Code Here


            Server server;
            // get default types of datastream (M or X) to be used for reserved datastreams
            try {
                server = Server.getInstance(new File(Constants.FEDORA_HOME),
                                            false);
                Module module = server.getModule("org.fcrepo.server.storage.DOManager");
                DC_DEFAULT_CONTROLGROUP = module.getParameter("defaultDCControlGroup");
                RELS_DEFAULT_CONTROLGROUP = module.getParameter("defaultRELSControlGroup");
            } catch (ServerInitializationException e) {
                logger.error("Unable to get server", e);
            } catch (ModuleInitializationException e) {
                logger.error("Unable to get DOManager module", e);
            }
View Full Code Here

        // do startup tasks

        String levelValue;
        if (m_riConfig == null){ //must have been configured outside fcfg
            Module riModule = m_context.getBean(moduleName,Module.class);
            if (riModule != null){
                logger.warn("ModuleConfiguration bean unavailable; getting Module bean");
                levelValue = riModule.getParameter("level");
            }
            else {
                logger.error("Cannot load ResourceIndex module definition from Spring config or Fedora config");
                throw new ResourceIndexException("Cannot locate ResourceIndex module definition in Spring config or Fedora config");
            }
View Full Code Here

        String port = getServer().getParameter("fedoraServerPort");
        if (port == null) {
            throw new ModuleInitializationException("fedoraServerPort must be specified as primary server config element.",
                                                    getRole());
        }
        Module mgr = getServer().getModule("org.fcrepo.server.storage.DOManager");
        if (mgr == null) {
            throw new ModuleInitializationException("DOManager is required (for pidNamespace param), but isn't loaded.",
                                                    getRole());
        }
        String pidNamespace = mgr.getParameter("pidNamespace");
        if (pidNamespace == null) {
            throw new ModuleInitializationException("DOManager did not specify a pidNamespace, but this module requires that it does.",
                                                    getRole());
        }
        String aes = getParameter("adminEmails");
        if (aes == null) {
            throw new ModuleInitializationException("adminEmails must be specified.",
                                                    getRole());
        }
        HashSet<String> adminEmails = new HashSet<String>();
        if (aes.indexOf(" ") == -1) {
            adminEmails.add(aes);
        } else {
            String[] emails = aes.split(" ");
            for (String element : emails) {
                adminEmails.add(element);
            }
        }
        HashSet<String> friends = new HashSet<String>();
        if (getParameter("friends") != null) {
            String f = getParameter("friends");
            if (f.indexOf(" ") == -1) {
                friends.add(f);
            } else {
                String[] fs = f.split(" ");
                for (String element : fs) {
                    friends.add(element);
                }
            }
        }
        FieldSearch fieldSearch =
                (FieldSearch) getServer()
                        .getModule("org.fcrepo.server.search.FieldSearch");
        if (fieldSearch == null) {
            throw new ModuleInitializationException("FieldSearch module was not loaded, but is required.",
                                                    getRole());
        }
        Module fsModule =
                getServer().getModule("org.fcrepo.server.search.FieldSearch");

        if (fsModule.getParameter("maxResults") == null) {
            throw new ModuleInitializationException("maxResults parameter must be specified in FieldSearch module's configuration.",
                                                    getRole());
        }
        int maxResults = 0;
        try {
            maxResults = Integer.parseInt(fsModule.getParameter("maxResults"));
            if (maxResults < 1) {
                throw new NumberFormatException("");
            }
        } catch (NumberFormatException nfe) {
            throw new ModuleInitializationException("maxResults specified in FieldSearch module's configuration must be a positive integer.",
View Full Code Here

        m_externalContentManager =
                (ExternalContentManager) getServer()
                        .getModule("org.fcrepo.server.storage.ExternalContentManager");

        // get ref to OAIProvider, for repositoryDomainName param for oai info
        Module oaiProvider = getServer().getModule("org.fcrepo.oai.OAIProvider");
        if (oaiProvider == null) {
            throw new ModuleInitializationException("DefaultAccess module requires that the server "
                                                    + "has an OAIProvider module configured so that it can get the repositoryDomainName parameter.",
                                                    getRole());
        }
        m_repositoryDomainName =
                oaiProvider.getParameter("repositoryDomainName");
        if (m_repositoryDomainName == null) {
            throw new ModuleInitializationException("DefaultAccess module requires that the OAIProvider "
                                                    + "module has the repositoryDomainName parameter specified.",
                                                    getRole());
        }
View Full Code Here

                                        .getEnvironmentValue(Constants.HTTP_REQUEST.SERVER_PORT.uri));
        repositoryInfo.repositoryBaseURL =
                reposBaseURL + "/" + context.getEnvironmentValue(Constants.FEDORA_APP_CONTEXT_NAME);

        repositoryInfo.repositoryVersion = Server.VERSION;
        Module domgr = getServer().getModule("org.fcrepo.server.storage.DOManager");
        repositoryInfo.repositoryPIDNamespace =
                domgr.getParameter("pidNamespace");
        repositoryInfo.defaultExportFormat =
                domgr.getParameter("defaultExportFormat");
        repositoryInfo.OAINamespace = m_repositoryDomainName;
        repositoryInfo.adminEmailList = getAdminEmails();
        repositoryInfo.samplePID =
                repositoryInfo.repositoryPIDNamespace + ":100";
        repositoryInfo.sampleOAIIdentifer =
View Full Code Here

TOP

Related Classes of org.fcrepo.server.Module

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.