Package org.fcrepo.server.journal.entry

Examples of org.fcrepo.server.journal.entry.CreatorJournalEntry


     * Create a journal entry, add the arguments, and invoke the method.
     */
    public String putTempStream(Context context, InputStream in)
            throws ServerException {
        try {
            CreatorJournalEntry cje =
                    new CreatorJournalEntry(METHOD_PUT_TEMP_STREAM, context);
            cje.addArgument(ARGUMENT_NAME_IN, in);
            return (String) cje.invokeAndClose(delegate, writer);
        } catch (JournalException e) {
            throw new GeneralException("Problem creating the Journal", e);
        }
    }
View Full Code Here


     * Create a journal entry, add the arguments, and invoke the method.
     */
    public String[] getNextPID(Context context, int numPIDs, String namespace)
            throws ServerException {
        try {
            CreatorJournalEntry cje =
                    new CreatorJournalEntry(METHOD_GET_NEXT_PID, context);
            cje.addArgument(ARGUMENT_NAME_NUM_PIDS, numPIDs);
            cje.addArgument(ARGUMENT_NAME_NAMESPACE, namespace);
            return (String[]) cje.invokeAndClose(delegate, writer);
        } catch (JournalException e) {
            throw new GeneralException("Problem creating the Journal", e);
        }
    }
View Full Code Here

                                   String relationship,
                                   String objURI,
                                   boolean isLiteral,
                                   String datatype) throws ServerException {
        try {
            CreatorJournalEntry cje =
                    new CreatorJournalEntry(METHOD_ADD_RELATIONSHIP, context);
            cje.addArgument(ARGUMENT_NAME_PID, pid);
            cje.addArgument(ARGUMENT_NAME_RELATIONSHIP, relationship);
            cje.addArgument(ARGUMENT_NAME_OBJECT, objURI);
            cje.addArgument(ARGUMENT_NAME_IS_LITERAL, isLiteral);
            cje.addArgument(ARGUMENT_NAME_DATATYPE, datatype);
            return (Boolean) cje.invokeAndClose(delegate, writer);
        } catch (JournalException e) {
            throw new GeneralException("Problem creating the Journal", e);
        }
    }
View Full Code Here

                                     String relationship,
                                     String object,
                                     boolean isLiteral,
                                     String datatype) throws ServerException {
        try {
            CreatorJournalEntry cje =
                    new CreatorJournalEntry(METHOD_PURGE_RELATIONSHIP, context);
            cje.addArgument(ARGUMENT_NAME_PID, pid);
            cje.addArgument(ARGUMENT_NAME_RELATIONSHIP, relationship);
            cje.addArgument(ARGUMENT_NAME_OBJECT, object);
            cje.addArgument(ARGUMENT_NAME_IS_LITERAL, isLiteral);
            cje.addArgument(ARGUMENT_NAME_DATATYPE, datatype);
            return (Boolean) cje.invokeAndClose(delegate, writer);
        } catch (JournalException e) {
            throw new GeneralException("Problem creating the Journal", e);
        }
    }
View Full Code Here

                                 SUBJECT_1,
                                 EMPTY,
                                 RESOURCE_1,
                                 EMPTY);

            CreatorJournalEntry entry =
                    new CreatorJournalEntry("modifyDatastreamByValue", context);

            entry.addArgument("pid", "hdl:2200%2F20061003155524381T");
            entry.addArgument("dsId", "format_nsdl_dc");
            entry.addArgument("altIds", new String[0]);
            entry.addArgument("dsLabel", "format_nsdl_dc data stream");
            entry.addArgument("versionable", true);
            entry.addArgument("mimeType", "application/xml");
            entry.addArgument("formatUri", "unknown");
            entry.addArgument("dsContent", buildInputStream(CONTENT_1));
            entry.addArgument("dsState", "A");
            entry.addArgument("message", "Modified by NSDL API");
            entry.addArgument("force", true);
            return entry;
        } catch (JournalException e) {
            return null;
        }
    }
View Full Code Here

                                 SUBJECT_1,
                                 EMPTY,
                                 RESOURCE_1,
                                 EMPTY);

            CreatorJournalEntry entry =
                    new CreatorJournalEntry("modifyDatastreamByValue", context);

            entry.addArgument("pid", "hdl:2200%2F20061003155524381T");
            entry.addArgument("dsId", "format_nsdl_dc");
            entry.addArgument("altIds", new String[0]);
            entry.addArgument("dsLabel", "format_nsdl_dc data stream");
            entry.addArgument("versionable", true);
            entry.addArgument("mimeType", "application/xml");
            entry.addArgument("formatUri", "unknown");
            entry.addArgument("dsContent", null);
            entry.addArgument("dsState", "A");
            entry.addArgument("message", "Modified by NSDL API");
            entry.addArgument("force", true);
            return entry;
        } catch (JournalException e) {
            return null;
        }
    }
View Full Code Here

                                 SUBJECT_2,
                                 EMPTY,
                                 RESOURCE_2,
                                 RECOVERY_2);

            CreatorJournalEntry entry =
                    new CreatorJournalEntry("ingest", context);
            entry.addArgument("serialization", buildInputStream(CONTENT_2));
            entry.addArgument("message", "Metadata provider added by NSDL API");
            entry.addArgument("format", "foxml1.0");
            entry.addArgument("encoding", "UTF-8");
            entry.addArgument("pid", null);

            return entry;
        } catch (JournalException e) {
            return null;
        }
View Full Code Here

                             SUBJECT_3,
                             EMPTY,
                             RESOURCE_3,
                             EMPTY);

        CreatorJournalEntry entry =
                new CreatorJournalEntry("modifyDatastreamByReference", context);
        entry.addArgument("pid", "demo:19");
        entry.addArgument("dsId", "DS1");
        entry.addArgument("altIds", new String[] {"this", "that", "another"});
        entry.addArgument("dsLabel", "A different source and some AltIDs");
        entry.addArgument("versionable", true);
        entry.addArgument("mimeType", "text/html");
        entry.addArgument("formatUri", "\n");
        entry.addArgument("dsLocation",
                          "http://myserver.edu/mydir/aDifferentFile.html");
        entry.addArgument("dsState", "A");
        entry.addArgument("message", "Modify by Reference with AltIDs");
        entry.addArgument("force", false);

        return entry;
    }
View Full Code Here

TOP

Related Classes of org.fcrepo.server.journal.entry.CreatorJournalEntry

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.