Package org.fcrepo.server.storage

Examples of org.fcrepo.server.storage.DOWriter


            logger.info("Purging old system object: " + pid.toString());
            Context context = ReadOnlyContext.getContext(null,
                                                         null,
                                                         null,
                                                         false);
            DOWriter w = doManager.getWriter(USE_DEFINITIVE_STORE,
                                             context,
                                             pid.toString());
            w.remove();
            try {
                w.commit("Purged by Fedora at startup (to be re-ingested)");
                exists = false;
            } finally {
                doManager.releaseWriter(w);
            }
        }
        if (!exists) {
            logger.info("Ingesting new system object: " + pid.toString());
            InputStream xml = getStream("org/fcrepo/server/resources/"
                                        + pid.toFilename() + ".xml");
            Context context = ReadOnlyContext.getContext(null,
                                                         null,
                                                         null,
                                                         false);
            DOWriter w = doManager.getIngestWriter(USE_DEFINITIVE_STORE,
                                                   context,
                                                   xml,
                                                   Constants.FOXML1_1.uri,
                                                   "UTF-8",
                                                   null);
            try {
                w.commit("Pre-ingested by Fedora at startup");
            } finally {
                doManager.releaseWriter(w);
            }
        }
    }
View Full Code Here


                         InputStream serialization,
                         String logMessage,
                         String format,
                         String encoding,
                         String pid) throws ServerException {
        DOWriter w = null;
        String objPid = null;
        try {
            logger.debug("Entered ingest");
            w = m_manager.getIngestWriter(Server.USE_DEFINITIVE_STORE,
                                          context,
                                          serialization,
                                          format,
                                          encoding,
                                          pid);
            objPid = w.GetObjectPID();

            m_authz.enforceIngest(context, objPid, format, encoding);

            // Only create an audit record if there is a log message to capture
            if (logMessage != null && !logMessage.equals("")) {
                Date nowUTC = Server.getCurrentDate(context);
                addAuditRecord(context, w, "ingest", "", logMessage, nowUTC);
            }

            w.commit(logMessage);
            return objPid;
        } finally {
            // Logger completion
            if (logger.isInfoEnabled()) {
                StringBuilder logMsg = new StringBuilder("Completed ingest(");
View Full Code Here

                             String state,
                             String label,
                             String ownerId,
                             String logMessage,
                             Date lastModifiedDate) throws ServerException {
        DOWriter w = null;
        try {
            logger.debug("Entered modifyObject");

            m_authz.enforceModifyObject(context,
                                        pid,
                                        state,
                                        ownerId);

            checkObjectLabel(label);

            w = m_manager.getWriter(Server.USE_DEFINITIVE_STORE, context, pid);

            // if provided, check request lastModifiedDate against the object,
            // rejecting the request if the object's mod date is more recent.
            if (lastModifiedDate != null) {
                if (lastModifiedDate.before(w.getLastModDate())) {
                    String objDate = DateUtility.convertDateToXSDString(w.getLastModDate());
                    String reqDate = DateUtility.convertDateToXSDString(lastModifiedDate);
                    String msg = String.format("%s lastModifiedDate (%s) " +
                                               "is more recent than the " +
                                               "request (%s)", pid, objDate, reqDate);
                    throw new ObjectLockedException(msg);
                }
            }

            if (state != null && !state.equals("")) {
                if (!state.equals("A") && !state.equals("D")
                    && !state.equals("I")) {
                    throw new InvalidStateException("The object state of \""
                                                    + state
                                                    + "\" is invalid. The allowed values for state are: "
                                                    + " A (active), D (deleted), and I (inactive).");
                }
                w.setState(state);
            }

            if (label != null) {
                w.setLabel(label);
            }
            if (ownerId != null) {
                w.setOwnerId(ownerId);
            }

            // Update audit trail
            Date nowUTC = Server.getCurrentDate(context);
            addAuditRecord(context, w, "modifyObject", "", logMessage, nowUTC);

            w.commit(logMessage);
            return w.getLastModDate();
        } finally {
            // Logger completion
            if (logger.isInfoEnabled()) {
                StringBuilder logMsg =
                        new StringBuilder("Completed modifyObject(");
View Full Code Here

        if (force) {
            throw new GeneralException("Forced object removal is not "
                    + "yet supported.");
        }
*/
        DOWriter w = null;
        try {
            logger.debug("Entered purgeObject");

            m_authz.enforcePurgeObject(context, pid);

            w = m_manager.getWriter(Server.USE_DEFINITIVE_STORE, context, pid);
            w.remove();
            w.commit(logMessage);
            Date serverDate = Server.getCurrentDate(context);
            return serverDate;
        } finally {
            // Logger completion
            if (logger.isInfoEnabled()) {
View Full Code Here

        if (dsID != null
            && (dsID.equals("AUDIT") || dsID.equals("FEDORA-AUDITTRAIL"))) {
            throw new GeneralException("Creation of a datastream with an"
                                       + " identifier of 'AUDIT' or 'FEDORA-AUDITTRAIL' is not permitted.");
        }
        DOWriter w = null;
        try {
            m_authz.enforceAddDatastream(context,
                                         pid,
                                         dsID,
                                         altIDs,
                                         MIMEType,
                                         formatURI,
                                         dsLocation,
                                         controlGroup,
                                         dsState,
                                         checksumType,
                                         checksum);

            checkDatastreamID(dsID);
            checkDatastreamLabel(dsLabel);

            w = m_manager.getWriter(Server.USE_DEFINITIVE_STORE, context, pid);
            Datastream ds;
            if (controlGroup.equals("X")) {
                ds = new DatastreamXMLMetadata();
                ds.DSInfoType = ""; // field is now deprecated
                try {
                    InputStream in;
                    MIMETypedStream mimeTypedStream = null;
                    if (dsLocation.startsWith(DatastreamManagedContent.UPLOADED_SCHEME)) {
                        in = getTempStream(dsLocation);
                    } else {
                        ContentManagerParams params = new ContentManagerParams(dsLocation);
                        params.setContext(context);
                        mimeTypedStream = m_contentManager.getExternalContent(params);
                        in = mimeTypedStream.getStream();
                    }
                    // set and validate the content
                    DatastreamXMLMetadata dsm = (DatastreamXMLMetadata) ds;
                    dsm.xmlContent = getEmbeddableXML(in);
                    dsm.DSSize = dsm.xmlContent.length;
                    ValidationUtility.validateReservedDatastream(PID.getInstance(pid),
                                                                 dsID,
                                                                 dsm);
                    if (mimeTypedStream != null) {
                        mimeTypedStream.close();
                    }
                } catch (Exception e) {
                    String extraInfo;
                    if (e.getMessage() == null) {
                        extraInfo = "";
                    } else {
                        extraInfo = " : " + e.getMessage();
                    }
                    throw new GeneralException("Error with " + dsLocation
                                               + extraInfo);
                }
            } else if (controlGroup.equals("M")) {
                ds = new DatastreamManagedContent();
                ds.DSInfoType = "DATA";
                ds.DSLocationType = Datastream.DS_LOCATION_TYPE_URL;
            } else if (controlGroup.equals("R") || controlGroup.equals("E")) {
                ds = new DatastreamReferencedContent();
                ds.DSInfoType = "DATA";
                ds.DSLocationType = Datastream.DS_LOCATION_TYPE_URL;
            } else {
                throw new GeneralException("Invalid control group: "
                                           + controlGroup);
            }
            ds.isNew = true;
            ds.DSControlGrp = controlGroup;
            ds.DSVersionable = versionable;
            if (!dsState.equals("A") && !dsState.equals("D")
                && !dsState.equals("I")) {
                throw new InvalidStateException("The datastream state of \""
                                                + dsState
                                                + "\" is invalid. The allowed values for state are: "
                                                + " A (active), D (deleted), and I (inactive).");
            }
            ds.DSState = dsState;
            // set new datastream id if not provided...
            if (dsID == null || dsID.length() == 0) {
                ds.DatastreamID = w.newDatastreamID();
            } else {
                if (dsID.indexOf(" ") != -1) {
                    throw new GeneralException("Datastream ids cannot contain spaces.");
                }
                if (dsID.indexOf("+") != -1) {
                    throw new GeneralException("Datastream ids cannot contain plusses.");
                }
                if (dsID.indexOf(":") != -1) {
                    throw new GeneralException("Datastream ids cannot contain colons.");
                }
                if (w.GetDatastream(dsID, null) != null) {
                    throw new GeneralException("A datastream already exists with ID: "
                                               + dsID);
                } else {
                    ds.DatastreamID = dsID;
                }
            }
            // add version level attributes and
            // create new ds version id ...
            ds.DSVersionID = ds.DatastreamID + ".0";
            ds.DSLabel = dsLabel;
            ds.DSLocation = dsLocation;
            if (dsLocation != null) {
                ValidationUtility.validateURL(dsLocation, ds.DSControlGrp);
            }
            ds.DSFormatURI = formatURI;
            ds.DatastreamAltIDs = altIDs;
            ds.DSMIME = MIMEType;
            ds.DSChecksumType = Datastream.validateChecksumType(checksumType);

            // M reserved datastream validation (X done above)
            if (controlGroup.equals("M")) {
                ValidationUtility.validateReservedDatastream(PID.getInstance(pid),
                                                             dsID,
                                                             ds);
            }

            if (checksum != null && checksumType != null) {
                String check = ds.getChecksum();
                if (!checksum.equals(check)) {
                    throw new ValidationException("Checksum Mismatch: " + check);
                }
            }

            // Update audit trail
            Date nowUTC = Server.getCurrentDate(context);
            addAuditRecord(context,
                           w,
                           "addDatastream",
                           ds.DatastreamID,
                           logMessage,
                           nowUTC);

            // Commit the updates
            ds.DSCreateDT = nowUTC;
            w.addDatastream(ds, true);
            w.commit("Added a new datastream");

            return ds.DatastreamID;
        } finally {
            // Logger completion
            if (logger.isInfoEnabled()) {
View Full Code Here

            || datastreamId.equals("FEDORA-AUDITTRAIL")) {
            throw new GeneralException("Modification of the system-controlled AUDIT"
                                       + " datastream is not permitted.");
        }

        DOWriter w = null;
        try {
            logger.debug("Entered modifyDatastreamByReference");
            m_authz
                    .enforceModifyDatastreamByReference(context,
                                                        pid,
                                                        datastreamId,
                                                        altIDs,
                                                        mimeType,
                                                        formatURI,
                                                        dsLocation,
                                                        checksumType,
                                                        checksum);

            checkDatastreamLabel(dsLabel);
            w = m_manager.getWriter(Server.USE_DEFINITIVE_STORE, context, pid);
            org.fcrepo.server.storage.types.Datastream orig =
                    w.GetDatastream(datastreamId, null);
            if (orig == null) {
                throw new DatastreamNotFoundException("Object " + pid + " has no datastream "
                                                      + datastreamId + " to modify");
            }
            // if provided, check request lastModifiedDate against the datastream,
            // rejecting the request if the datastream's mod date is more recent.
            if (lastModifiedDate != null) {
                if (lastModifiedDate.before(orig.DSCreateDT)) {
                    String dsDate = DateUtility.convertDateToXSDString(w.getLastModDate());
                    String reqDate = DateUtility.convertDateToXSDString(lastModifiedDate);
                    String msg = String.format("%s/%s lastModifiedDate (%s) " +
                                               "is more recent than the " +
                                               "request (%s)", pid,
                                               datastreamId, dsDate, reqDate);
                    throw new DatastreamLockedException(msg);
                }
            }

            Date nowUTC; // variable for ds modified date

            // some forbidden scenarios...
            if (orig.DSControlGrp.equals("X")) {
                throw new GeneralException("Inline XML datastreams must be modified by value, not by reference.");
            }
            if (orig.DSState.equals("D")) {
                throw new GeneralException("Changing attributes on deleted datastreams is forbidden.");
            }

            // A NULL INPUT PARM MEANS NO CHANGE TO DS ATTRIBUTE...
            // if input parms are null, the ds attribute should not be changed,
            // so set the parm values to the existing values in the datastream.
            if (dsLabel == null) {
                dsLabel = orig.DSLabel;
            }
            if (mimeType == null) {
                mimeType = orig.DSMIME;
            }
            if (formatURI == null) {
                formatURI = orig.DSFormatURI;
            }
            if (altIDs == null) {
                altIDs = orig.DatastreamAltIDs;
            }
            if (checksumType == null) {
                checksumType = orig.DSChecksumType;
            } else {
                checksumType = Datastream.validateChecksumType(checksumType);
            }

            // In cases where an empty attribute value is not allowed, then
            // NULL or EMPTY PARM means no change to ds attribute...
            if (dsLocation == null || dsLocation.equals("")) {
                if (orig.DSControlGrp.equals("M")) {
                    // if managed content location is unspecified,
                    // cause a copy of the prior content to be made at
                    // commit-time
                    dsLocation = DatastreamManagedContent.COPY_SCHEME + orig.DSLocation;
                } else {
                    dsLocation = orig.DSLocation;
                }
            } else {
                ValidationUtility.validateURL(dsLocation, orig.DSControlGrp);
            }

            // if "force" is false and the mime type changed, validate the
            // original datastream with respect to any disseminators it is
            // involved in, and keep a record of that information for later
            // (so we can determine whether the mime type change would cause
            // data contract invalidation)
            // Map oldValidationReports = null;
            // if ( !mimeType.equals(orig.DSMIME) && !force) {
            // oldValidationReports = getAllBindingMapValidationReports(
            // context, w, datastreamId);
            // }

            // instantiate the right class of datastream
            // (inline xml "X" datastreams have already been rejected)
            Datastream newds;
            if (orig.DSControlGrp.equals("M")) {
                newds = new DatastreamManagedContent();
            } else {
                newds = new DatastreamReferencedContent();
            }
            // update ds attributes that are common to all versions...
            // first, those that cannot be changed by client...
            newds.DatastreamID = orig.DatastreamID;
            newds.DSControlGrp = orig.DSControlGrp;
            newds.DSInfoType = orig.DSInfoType;
            // next, those that can be changed by client...
            newds.DSState = orig.DSState;
            newds.DSVersionable = orig.DSVersionable;

            // update ds version-level attributes, and
            // make sure ds gets a new version id
            newds.DSVersionID = w.newDatastreamID(datastreamId);
            newds.DSLabel = dsLabel;
            newds.DSMIME = mimeType;
            newds.DSFormatURI = formatURI;
            newds.DatastreamAltIDs = altIDs;
            nowUTC = Server.getCurrentDate(context);
            newds.DSCreateDT = nowUTC;
            // newds.DSSize will be computed later
            newds.DSLocation = dsLocation;
            newds.DSLocationType = Datastream.DS_LOCATION_TYPE_URL;
            newds.DSChecksumType = checksumType;

            // validate reserved datastreams (type M and X) unless unchanged:
            if (!newds.DSLocation.startsWith(DatastreamManagedContent.COPY_SCHEME) &&
                !newds.DSLocation.equals(orig.DSLocation)) {
              ValidationUtility.validateReservedDatastream(PID.getInstance(pid),
                                                         datastreamId,
                                                         newds);
            }

            // next, add the datastream via the object writer
            w.addDatastream(newds, orig.DSVersionable);

            // if a checksum is passed in verify that the checksum computed for
            // the datastream
            // matches the one that is passed in.
            if (checksum != null) {
                if (checksumType == null) {
                    newds.DSChecksumType = orig.DSChecksumType;
                }
                String check = newds.getChecksum();
                if (!checksum.equals(check)) {
                    throw new ValidationException("Checksum Mismatch: " + check);
                }
            }

            // Update audit trail
            addAuditRecord(context,
                           w,
                           "modifyDatastreamByReference",
                           newds.DatastreamID,
                           logMessage,
                           nowUTC);

            // if all went ok, check if we need to validate, then commit.
            // if (oldValidationReports != null) { // mime changed and
            // force=false
            // rejectMimeChangeIfCausedInvalidation(
            // oldValidationReports,
            // getAllBindingMapValidationReports(context,
            // w,
            // datastreamId));
            // }
            w.commit(logMessage);

            return nowUTC;
        } finally {
            // Logger completion
            if (logger.isInfoEnabled()) {
View Full Code Here

        if (datastreamId.equals("AUDIT")
            || datastreamId.equals("FEDORA-AUDITTRAIL")) {
            throw new GeneralException("Modification of the system-controlled AUDIT"
                                       + " datastream is not permitted.");
        }
        DOWriter w = null;
        try {
            logger.debug("Entered modifyDatastreamByValue");
            m_authz.enforceModifyDatastreamByValue(context,
                                                   pid,
                                                   datastreamId,
                                                   altIDs,
                                                   mimeType,
                                                   formatURI,
                                                   checksumType,
                                                   checksum);

            checkDatastreamLabel(dsLabel);
            w = m_manager.getWriter(Server.USE_DEFINITIVE_STORE, context, pid);
            Datastream orig =
                    w.GetDatastream(datastreamId, null);
            if (orig == null) {
                throw new DatastreamNotFoundException("Object " + pid + " has no datastream "
                                                      + datastreamId + " to modify");
            }

            XMLDatastreamProcessor origxml = new XMLDatastreamProcessor(orig);

            // if provided, check request lastModifiedDate against the datastream,
            // rejecting the request if the datastream's mod date is more recent.
            if (lastModifiedDate != null) {
                if (lastModifiedDate.before(orig.DSCreateDT)) {
                    String dsDate = DateUtility.convertDateToXSDString(w.getLastModDate());
                    String reqDate = DateUtility.convertDateToXSDString(lastModifiedDate);
                    String msg = String.format("%s/%s lastModifiedDate (%s) " +
                                               "is more recent than the " +
                                               "request (%s)", pid,
                                               datastreamId, dsDate, reqDate);
                    throw new DatastreamLockedException(msg);
                }
            }

            // some forbidden scenarios...
            if (orig.DSState.equals("D")) {
                throw new GeneralException("Changing attributes on deleted datastreams is forbidden.");
            }
            if (!orig.DSControlGrp.equals("X") && !orig.DSControlGrp.equals("M")) {
                throw new GeneralException("Only content of inline XML and managed content"
                                           + " datastreams may be modified by value.\n"
                                           + "Use modifyDatastreamByReference instead.");
            }

            // A NULL INPUT PARM MEANS NO CHANGE TO DS ATTRIBUTE...
            // if input parms are null, the ds attribute should not be changed,
            // so set the parm values to the existing values in the datastream.
            if (dsLabel == null) {
                dsLabel = orig.DSLabel;
            }
            if (mimeType == null) {
                mimeType = orig.DSMIME;
            }
            if (formatURI == null) {
                formatURI = orig.DSFormatURI;
            }
            if (altIDs == null) {
                altIDs = orig.DatastreamAltIDs;
            }
            if (checksumType == null) {
                checksumType = orig.DSChecksumType;
            } else {
                checksumType = Datastream.validateChecksumType(checksumType);
            }
            if (dsContent != null && "DC".equals(datastreamId)){
                DCFields audited = new DCFields(dsContent);
                try {
                    dsContent = new ByteArrayInputStream(audited.getAsXML(pid).getBytes("UTF-8"));
                } catch (UnsupportedEncodingException uee) {
                    // safely ignore... we know UTF-8 works
                }
            }

            // create new datastream (version) based on existing one
            XMLDatastreamProcessor newdsxml = origxml.newVersion();
            Datastream newds = newdsxml.getDatastream();
            newdsxml.setDSMDClass(origxml.getDSMDClass());
            if (dsContent == null) {
                // If the dsContent input stream parm is null,
                // that means "do not change the content".
                // Accordingly, here we just make a copy of the old content.
                newdsxml.setXMLContent(origxml.getXMLContent());
            } else {
                // set and validate the content
                newdsxml.setXMLContent(getEmbeddableXML(dsContent));
                ValidationUtility.validateReservedDatastream(PID.getInstance(pid),
                                                             orig.DatastreamID,
                                                             newds);
            }

            // update ds attributes that are common to all versions...
            // first, those that cannot be changed by client...
            newds.DatastreamID = orig.DatastreamID;
            newds.DSControlGrp = orig.DSControlGrp;
            newds.DSInfoType = orig.DSInfoType;
            // next, those that can be changed by client...
            newds.DSState = orig.DSState;
            newds.DSVersionable = orig.DSVersionable;

            // update ds version level attributes, and
            // make sure ds gets a new version id
            newds.DSVersionID = w.newDatastreamID(datastreamId);
            newds.DSLabel = dsLabel;
            newds.DatastreamAltIDs = altIDs;
            newds.DSMIME = mimeType;
            newds.DSFormatURI = formatURI;
            Date nowUTC = Server.getCurrentDate(context);
            newds.DSCreateDT = nowUTC;

            newds.DSChecksumType = checksumType;

            // next, add the datastream via the object writer
            w.addDatastream(newds, orig.DSVersionable);

            // if a checksum is passed in verify that the checksum computed for
            // the datastream
            // matches the one that is passed in.
            if (checksum != null) {
                String check = newds.getChecksum();
                if (!checksum.equals(check)) {
                    throw new ValidationException("Checksum Mismatch: " + check);
                }
            }

            // Update audit trail
            addAuditRecord(context,
                           w,
                           "modifyDatastreamByValue",
                           newds.DatastreamID,
                           logMessage,
                           nowUTC);

            w.commit(logMessage);

            return nowUTC;
        } finally {
            // Logger completion
            if (logger.isInfoEnabled()) {
View Full Code Here

        if (force) {
            throw new GeneralException("Forced datastream removal is not "
                    + "yet supported.");
        }
*/
        DOWriter w = null;
        try {
            logger.debug("Entered purgeDatastream");

            m_authz.enforcePurgeDatastream(context,
                                           pid,
                                           datastreamID,
                                           endDT);

            w = m_manager.getWriter(Server.USE_DEFINITIVE_STORE, context, pid);
            Date[] deletedDates =
                    w.removeDatastream(datastreamID, startDT, endDT);
            // check if there's at least one version with this id...
            if (w.GetDatastream(datastreamID, null) == null) {
                // if deleting would result in no versions remaining,
                // only continue if there are no disseminators that use
                // this datastream.
                // to do this, we must look through all versions of every
                // disseminator, regardless of state
                ArrayList<String> usedList = new ArrayList<String>();
                if (datastreamID.equals("DC")) {
                    usedList.add("The default disseminator");
                }
                if (usedList.size() > 0) {
                    StringBuffer msg = new StringBuffer();
                    msg.append("Cannot purge entire datastream because it\n");
                    msg.append("is used by the following disseminators:");
                    for (int i = 0; i < usedList.size(); i++) {
                        msg.append("\n - " + usedList.get(i));
                    }
                    throw new GeneralException(msg.toString());
                }
            }
            // add an explanation of what happened to the user-supplied message.
            if (logMessage == null) {
                logMessage = "";
            } else {
                logMessage += " . . . ";
            }
            logMessage +=
                    getPurgeLogMessage("datastream",
                                       datastreamID,
                                       startDT,
                                       endDT,
                                       deletedDates);

            // Update audit trail
            Date nowUTC = Server.getCurrentDate(context);
            addAuditRecord(context,
                           w,
                           "purgeDatastream",
                           datastreamID,
                           logMessage,
                           nowUTC);

            // It looks like all went ok, so commit
            w.commit(logMessage);
            // ... then give the response
            return deletedDates;
        } finally {
            // Logger completion
            if (logger.isInfoEnabled()) {
View Full Code Here

    public Date setDatastreamState(Context context,
                                   String pid,
                                   String datastreamID,
                                   String dsState,
                                   String logMessage) throws ServerException {
        DOWriter w = null;
        try {
            logger.debug("Entered setDatastreamState");

            m_authz.enforceSetDatastreamState(context,
                                              pid,
                                              datastreamID,
                                              dsState);

            w = m_manager.getWriter(Server.USE_DEFINITIVE_STORE, context, pid);
            if (!dsState.equals("A") && !dsState.equals("D")
                && !dsState.equals("I")) {
                throw new InvalidStateException("The datastream state of \""
                                                + dsState
                                                + "\" is invalid. The allowed values for state are: "
                                                + " A (active), D (deleted), and I (inactive).");
            }
            w.setDatastreamState(datastreamID, dsState);

            // Update audit trail
            Date nowUTC = Server.getCurrentDate(context);
            addAuditRecord(context,
                           w,
                           "setDatastreamState",
                           datastreamID,
                           logMessage,
                           nowUTC);

            // if all went ok, commit
            w.commit(logMessage);
            return nowUTC;
        } finally {
            // Logger completion
            if (logger.isInfoEnabled()) {
                StringBuilder logMsg =
View Full Code Here

                                         String pid,
                                         String datastreamID,
                                         boolean versionable,
                                         String logMessage)
            throws ServerException {
        DOWriter w = null;
        try {
            logger.debug("Entered setDatastreamVersionable");

            m_authz.enforceSetDatastreamVersionable(context,
                                                    pid,
                                                    datastreamID,
                                                    versionable);

            w = m_manager.getWriter(Server.USE_DEFINITIVE_STORE, context, pid);
            w.setDatastreamVersionable(datastreamID, versionable);

            // Update audit trail
            Date nowUTC = Server.getCurrentDate(context);
            addAuditRecord(context,
                           w,
                           "setDatastreamVersionable",
                           datastreamID,
                           logMessage,
                           nowUTC);

            // if all went ok, commit
            w.commit(logMessage);
            return nowUTC;
        } finally {
            // Logger completion
            if (logger.isInfoEnabled()) {
                StringBuilder logMsg =
View Full Code Here

TOP

Related Classes of org.fcrepo.server.storage.DOWriter

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.