Package org.fcrepo.client

Examples of org.fcrepo.client.FedoraClient$SOAPEndpoint


    }

    private void reloadPolicies() {
        System.out.println("Reloading Policies...");
        try {
            FedoraClient client =
                    new FedoraClient(ServerUtility.getBaseURL(getProtocol()),
                                     getUsername(),
                                     getPassword());
            client.reloadPolicies();
            System.out.println("  Done Reloading Policies");
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here


        backupFedoraUsersFile();
        createNewFedoraUsersFileWithTestUsers();
        installJunitPolicies();
        reloadPolicies();
        System.out.println("creating alternate users");
        testuser1 = new FedoraClient(getBaseURL(), "testuser1", "testuser1");
        testuserroleA =
                new FedoraClient(getBaseURL(), "testuserroleA", "testuserroleA");
        testuser2 = new FedoraClient(getBaseURL(), "testuser2", "testuser2");
        testuser3 = new FedoraClient(getBaseURL(), "testuser3", "testuser3");
        testuserroleB =
                new FedoraClient(getBaseURL(), "testuserroleB", "testuserroleB");
        testuserroleC =
                new FedoraClient(getBaseURL(), "testuserroleC", "testuserroleC");
        testuserroleC2 =
                new FedoraClient(getBaseURL(),
                                 "testuserroleC2",
                                 "testuserroleC2");
        testuser4 = new FedoraClient(getBaseURL(), "testuser4", "testuser4");
        System.out.println("done setting up");
    }
View Full Code Here

                    + "test-objects/foxml/cli-utils"
                    : "src/test/resources/test-objects/foxml/cli-utils";

    @Before
    public void setUp() throws Exception {
        FedoraClient client = getFedoraClient();
        apia = client.getAPIAMTOM();
        apim = client.getAPIMMTOM();
        client.shutdown();
    }
View Full Code Here

    @BeforeClass
    public static void bootStrap() throws Exception {
        String baseURL =
                getProtocol() + "://" + getHost() + ":" + getPort() + "/"
                        + getFedoraAppServerContext();
        s_client = new FedoraClient(baseURL, getUsername(), getPassword());
        // do we actually use the demo objects in this suite of tests?
        //ingestDemoObjects(s_client);
    }
View Full Code Here

                            // ******************************************************
                            // NEW: use the new client utility class FedoraClient
                            String baseURL =
                                    m_protocol + "://" + m_host + ":" + m_port
                                            + "/" + m_contextField.getText();
                            FedoraClient fc =
                                    new FedoraClient(baseURL,
                                                     m_usernameField.getText(),
                                                     new String(m_passwordField
                                                             .getPassword()));
                            m_apia = fc.getAPIAMTOM();
                            m_apim = fc.getAPIMMTOM();
                            fc.shutdown();
                            //*******************************************************

                            // Get SOAP stubs for the source repository.
                            // NOTE! For backward compatibility with Fedora 2.0
                            // we will immediately try a describe repository
View Full Code Here

                // ******************************************
                // NEW: use new client utility class
                String baseURL =
                        protocol + "://" + hp[0] + ":"
                                + Integer.parseInt(hp[1]) + "/" + context;
                FedoraClient fc = new FedoraClient(baseURL, args[4], args[5]);
                FedoraAPIAMTOM targetRepoAPIA = fc.getAPIAMTOM();
                FedoraAPIMMTOM targetRepoAPIM = fc.getAPIMMTOM();
                fc.shutdown();
                //*******************************************

                String pid =
                        Ingest.oneFromFile(f,
                                           ingestFormat,
                                           targetRepoAPIA,
                                           targetRepoAPIM,
                                           logMessage);
                if (pid == null) {
                    System.out.print("ERROR: ingest failed for file: "
                            + args[1]);
                } else {
                    System.out.println("Ingested pid: " + pid);
                }
            } else if (kind == 'd') {
                // USAGE: fedora-ingest d[ir] path format targetHost:targetPort targetUser targetPassword targetProtocol [log] [context]
                if (args.length < 7 || args.length > 9) {
                    Ingest.badArgs("Wrong number of arguments (" + args.length
                            + ") for directory ingest.");
                    System.out
                            .println("USAGE: fedora-ingest d[ir] path format targetHost:targetPort targetUser targetPassword targetProtocol [log] [context]");
                }
                File d = new File(args[1]);
                String ingestFormat = args[2];
                String logMessage = null;

                if (args.length == 8) {
                    logMessage = args[7];
                }

                if (args.length == 9 && !args[8].equals("")) {
                    context = args[8];
                }

                String protocol = args[6];
                String[] hp = args[3].split(":");

                // ******************************************
                // NEW: use new client utility class
                String baseURL =
                        protocol + "://" + hp[0] + ":"
                                + Integer.parseInt(hp[1]) + "/" + context;
                FedoraClient fc = new FedoraClient(baseURL, args[4], args[5]);
                FedoraAPIAMTOM targetRepoAPIA = fc.getAPIAMTOM();
                FedoraAPIMMTOM targetRepoAPIM = fc.getAPIMMTOM();
                //*******************************************

                logRootName = "ingest-from-dir";
                logFile = IngestLogger.newLogFile(logRootName);
                log =
                        new PrintStream(new FileOutputStream(logFile),
                                        true,
                                        "UTF-8");
                IngestLogger.openLog(log, logRootName);
                Ingest.multiFromDirectory(d,
                                          ingestFormat,
                                          targetRepoAPIA,
                                          targetRepoAPIM,
                                          logMessage,
                                          log,
                                          counter);
                IngestLogger.closeLog(log, logRootName);
                summarize(counter, logFile);
            } else if (kind == 'r') {
                // USAGE: fedora-ingest r[epos] sourceHost:sourcePort sourceUser sourcePassword pid|* targetHost:targetPort targetUser targetPassword sourceProtocol targetProtocol [log] [context]
                if (args.length < 10 || args.length > 12) {
                    Ingest.badArgs("Wrong number of arguments for repository ingest.");
                }
                String logMessage = null;
                if (args.length == 11) {
                    logMessage = args[10];
                }

                if (args.length == 12 && !args[11].equals("")) {
                    context = args[11];
                }
                //Source repository
                String[] shp = args[1].split(":");
                String source_host = shp[0];
                String source_port = shp[1];
                String source_user = args[2];
                String source_password = args[3];
                String source_protocol = args[8];

                // ******************************************
                // NEW: use new client utility class
                String sourceBaseURL =
                        source_protocol + "://" + source_host + ":"
                                + Integer.parseInt(source_port) + "/" + context;
                FedoraClient sfc =
                        new FedoraClient(sourceBaseURL,
                                         source_user,
                                         source_password);
                FedoraAPIAMTOM sourceRepoAPIA = sfc.getAPIAMTOM();
                FedoraAPIMMTOM sourceRepoAPIM = sfc.getAPIMMTOM();
                //*******************************************

                //Target repository
                String[] thp = args[5].split(":");
                String target_host = thp[0];
                String target_port = thp[1];
                String target_user = args[6];
                String target_password = args[7];
                String target_protocol = args[9];

                // ******************************************
                // NEW: use new client utility class
                String targetBaseURL =
                        target_protocol + "://" + target_host + ":"
                                + Integer.parseInt(target_port) + "/" + context;
                FedoraClient tfc =
                        new FedoraClient(targetBaseURL,
                                         target_user,
                                         target_password);
                FedoraAPIAMTOM targetRepoAPIA = tfc.getAPIAMTOM();
                FedoraAPIMMTOM targetRepoAPIM = tfc.getAPIMMTOM();
                //*******************************************

                // Determine export format
                RepositoryInfo repoinfo = sourceRepoAPIA.describeRepository();
                System.out
View Full Code Here

                // ******************************************
                // NEW: use new client utility class
                String baseURL =
                        protocol + "://" + hostName + ":" + portNum + "/"
                        + context;
                FedoraClient fc = new FedoraClient(baseURL, args[1], args[2]);
                AutoPurger a = new AutoPurger(fc.getAPIMMTOM());
                fc.shutdown();
                //*******************************************

                /* Single PID:  just purge it */
                if (pid != null) {
                    a.purge(pid, logMessage);
View Full Code Here

    private final FedoraAPIMMTOM apim;

    public RemoteObjectSource(ServiceInfo serviceInfo)
            throws ServiceException, IOException {
        FedoraClient fc =
                new FedoraClient(serviceInfo.getBaseUrlString(),
                                 serviceInfo.getUsername(),
                                 serviceInfo.getPassword());
        apia = fc.getAPIAMTOM();
        apim = fc.getAPIMMTOM();
        fc.shutdown();
    }
View Full Code Here

        }

        try {
            // FIXME:  Get around hardcoding the path in the baseURL
            String baseURL = protocol + "://" + host + ":" + port + "/" + context;
            FedoraClient fc = new FedoraClient(baseURL, user, pass);
            AutoFinder finder = new AutoFinder(fc.getAPIAMTOM());
            fc.shutdown();

            FieldSearchQuery query = new FieldSearchQuery();
            org.fcrepo.server.types.gen.ObjectFactory factory =
                new org.fcrepo.server.types.gen.ObjectFactory();
            query.setTerms(factory.createFieldSearchQueryTerms(phrase));
View Full Code Here

            // ******************************************
            // NEW: use new client utility class
            String baseURL =
                    protocol + "://" + hp[0] + ":" + Integer.parseInt(hp[1])
                            + "/" + context;
            FedoraClient fc = new FedoraClient(baseURL, args[1], args[2]);
            FedoraAPIAMTOM sourceRepoAPIA = fc.getAPIAMTOM();
            FedoraAPIMMTOM sourceRepoAPIM = fc.getAPIMMTOM();
            fc.shutdown();
            //*******************************************

            String exportFormat = args[4];
            String exportContext = args[5];
            if (!exportFormat.equals(FOXML1_1.uri)
View Full Code Here

TOP

Related Classes of org.fcrepo.client.FedoraClient$SOAPEndpoint

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.