Package org.fcrepo.server

Examples of org.fcrepo.server.Server


        // SQL databases given the class provided in the root element
        // in the config file and return it

            String className = "org.fcrepo.server.utilities.rebuild.RebuildServer";
            try {
                Server inst = new RebuildServer(homeDir);
                s_instances.put(homeDir, inst);
                inst.init();
                return inst;
            } catch (IllegalArgumentException iae) {
                // improbable
                throw new ServerInitializationException(MessageFormat
                        .format(INIT_SERVER_SEVERE_BADARGS,
View Full Code Here


     *         some other reason.
     */
    @Override
    public void initModule() throws ModuleInitializationException {
        try {
            Server s_server = getServer();
            defaultPoolName = this.getParameter("defaultPoolName");
            if (defaultPoolName == null || defaultPoolName.equalsIgnoreCase("")) {
                throw new ModuleInitializationException("Default Connection Pool "
                                                                + "Name Not Specified",
                                                        getRole());
            }
            logger.debug("DefaultPoolName: " + defaultPoolName);
            String poolList = this.getParameter("poolNames");

            // Pool names should be comma delimited
            String[] poolNames = poolList.split(",");

            // Initialize each connection pool
            for (int i = 0; i < poolNames.length; i++) {
                DatastoreConfig config =
                        s_server.getDatastoreConfig(poolNames[i]);
                jdbcDriverClass = config.getParameter("jdbcDriverClass");
                dbUsername = config.getParameter("dbUsername");
                dbPassword = config.getParameter("dbPassword");
                jdbcURL = config.getParameter("jdbcURL");
                maxActive =
View Full Code Here

        System.err.println();
        return val;
    }

    private static Rebuilder getRebuilder() throws Exception {
        Server server = getServer();
        String[] rebuilders = server.getBeanNamesForType(Rebuilder.class);
        String[] labels = new String[rebuilders.length + 1];
        int i = 0;
        for (i = 0; i < rebuilders.length; i++) {
            Rebuilder r = server.getBean(rebuilders[i], Rebuilder.class);

            labels[i] = r.getAction();
        }
        labels[i] = "Exit";
        int choiceNum = i;
        if (System.getProperty("rebuilder") == null) {
            choiceNum = getChoice("What do you want to do?", labels);
        } else {
            System.out.println("Getting rebuilder... " +
                    System.getProperty("rebuilder"));
            for (int j = 0; j < rebuilders.length; j++) {
                if (rebuilders[j].equals(System.getProperty("rebuilder"))) {
                    choiceNum = j;
                }
            }
        }
        if (choiceNum == i) {
            return null;
        } else {
            return server.getBean(rebuilders[choiceNum], Rebuilder.class);
        }
    }
View Full Code Here

        }
    }

    private static void init() {
        if (!initialized) {
            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) {
View Full Code Here

     * @throws Exception is thrown in case the server is not able to find the module.
     */
    private ExternalContentManager getExternalContentManager()
            throws Exception {
        if (s_ecm == null) {
            Server server;
            try {
                server = Server.getInstance(new File(Constants.FEDORA_HOME),
                        false);
                s_ecm = (ExternalContentManager) server
                        .getModule("org.fcrepo.server.storage.ExternalContentManager");
            } catch (InitializationException e) {
                throw new Exception(
                        "Unable to get ExternalContentManager Module: "
                                + e.getMessage(), e);
View Full Code Here

            purgeObjects(count);
        }
    }

    private void rebuild() throws Exception {
        Server server = RebuildServer.getInstance(new File(Constants.FEDORA_HOME));
        Rebuilder rebuilder = server.getBean(ResourceIndexRebuilder.class);

        Map<String, String> options = rebuilder.getOptions();

        try {
            new Rebuild(rebuilder, options, server);
View Full Code Here

     */
    @Override
    public void postInitModule() throws ModuleInitializationException {

        try {
            Server s_server = getServer();
            logger.debug("DefaultBackendSecurity initialized");
            String fedoraHome = Constants.FEDORA_HOME;
            if (fedoraHome == null) {
                throw new ModuleInitializationException("[DefaultBackendSecurity] Module failed to initialize: "
                                                                + "FEDORA_HOME is undefined",
View Full Code Here

    private Management getApiM() {
        if (apim != null) {
            return apim;
        }
        Server server;
        try {
            server = Server.getInstance(new File(Constants.FEDORA_HOME), false);
        } catch (Exception e) {
            logger.error(e.getMessage());
            throw new RuntimeException("Failed getting instance of Fedora", e);
        }
        apim =
                (Management) server
                        .getModule("org.fcrepo.server.management.Management");
        return apim;
    }
View Full Code Here

    public String getObjectProfile(String reposBaseURL,
                                   ObjectProfile objProfile,
                                   Date versDateTime) throws ServerException {

        // use REST serializer
        Server fedoraServer = Server.getInstance(new File(Constants.FEDORA_HOME), false);
        String fedoraServerHost = fedoraServer.getParameter("fedoraServerHost");
        DefaultSerializer ser = new DefaultSerializer(fedoraServerHost, m_context);
        return ser.objectProfileToXML(objProfile, versDateTime);
    }
View Full Code Here

                                 String PID,
                                 ObjectMethodsDef[] methods,
                                 Date versDateTime) throws ServerException {

        // use REST serializer
        Server fedoraServer = Server.getInstance(new File(Constants.FEDORA_HOME), false);
        String fedoraServerHost = fedoraServer.getParameter("fedoraServerHost");
        DefaultSerializer ser = new DefaultSerializer(fedoraServerHost, m_context);
        return ser.objectMethodsToXml(methods, PID, null, versDateTime);

    }
View Full Code Here

TOP

Related Classes of org.fcrepo.server.Server

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.