@Override public void wipe(String temporalDocumentURI, Transaction transaction, String temporalCollection) { if (temporalDocumentURI == null || temporalCollection == null) throw new IllegalArgumentException("Temporal Document URI and Temporal collection cannot be null"); if (logger.isInfoEnabled()) logger.info("Wiping {} of {} temporal collection", temporalDocumentURI, temporalCollection); RequestParameters extraParams = addTemporalParams(new RequestParameters(), temporalCollection, null, null); services.wipeDocument(requestLogger, temporalDocumentURI, transaction, extraParams); }
protected void protect(String temporalDocumentURI, String temporalCollection, Transaction transaction, ProtectionLevel level, String duration, Calendar expiryTime, String archivePath) { if (level == null) { level = ProtectionLevel.NODELETE; } if(duration == null && expiryTime == null) { throw new IllegalArgumentException( "Need either duration or expiry time for protecting a document"); } if (temporalDocumentURI == null || temporalCollection == null) throw new IllegalArgumentException( "Temporal Document URI and Temporal collection cannot be null"); RequestParameters extraParams = addTemporalParams(new RequestParameters(), temporalCollection, null, null); services.protectDocument(requestLogger, temporalDocumentURI, transaction, extraParams, level, duration, expiryTime, archivePath); }
@Override public TemporalDescriptor delete(DocumentDescriptor desc, Transaction transaction, String temporalCollection, java.util.Calendar systemTime) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException { if (desc == null) throw new IllegalArgumentException( "Deleting document with null identifier"); if (logger.isInfoEnabled()) logger.info("Deleting {}", desc.getUri()); RequestParameters extraParams = addTemporalParams(new RequestParameters(), temporalCollection, null, systemTime); return services.deleteDocument(requestLogger, desc, transaction, null, extraParams); }
@Override public void patch(String uri, String temporalDocumentURI, String temporalCollection, String sourceDocumentURI, DocumentPatchHandle patch, Transaction transaction) { if (uri == null) { throw new IllegalArgumentException("Document URI cannot be null"); } if (temporalCollection == null) { throw new IllegalArgumentException("Need temporal collection to patch a temporal document"); } if (logger.isInfoEnabled()) logger.info("Patching document"); RequestParameters extraParams = null; extraParams = addTemporalParams(extraParams, temporalCollection, temporalDocumentURI, null); DocumentPatchHandleImpl builtPatch = (patch instanceof DocumentPatchHandleImpl) ? (DocumentPatchHandleImpl) patch : null; services.patchDocument(requestLogger, new DocumentDescriptorImpl(uri, true), transaction, (builtPatch != null) ? builtPatch.getMetadata() : processedMetadata, (builtPatch != null) ? builtPatch.isOnContent() : true, extraParams, sourceDocumentURI, patch); }
public DocumentPage read(long serverTimestamp, ServerTransform transform, Transaction transaction, boolean withContent, String temporalCollection, String[] uris) { if (uris == null || uris.length == 0) throw new IllegalArgumentException("Attempt to call read with no uris"); if (logger.isInfoEnabled()) logger.info( "Reading metadata and content for multiple uris beginning with {}", uris[0]); RequestParameters extraParams = addTemporalParams(new RequestParameters(), temporalCollection, null, null); return services.getBulkDocuments( requestLogger, serverTimestamp, transaction, // the default for bulk is no metadata, which differs from the normal // default of ALL isProcessedMetadataModified ? processedMetadata : null, nonDocumentFormat, mergeTransformParameters((transform != null) ? transform : getReadTransform(), extraParams), withContent, uris); }
extraParams = addTemporalParams(extraParams, temporalCollection, null, null);
@SuppressWarnings("rawtypes") protected DocumentDescriptorImpl create(DocumentUriTemplate template, DocumentMetadataWriteHandle metadataHandle, W contentHandle, ServerTransform transform, Transaction transaction, String temporalCollection, Calendar systemTime, RequestParameters extraParams) { if ( logger.isInfoEnabled() ) logger.info("Creating content"); if ( extraParams == null ) extraParams = getWriteParams(); if (metadataHandle != null) { HandleImplementation metadataBase = HandleAccessor.checkHandle( metadataHandle, "metadata"); Format metadataFormat = metadataBase.getFormat(); if (metadataFormat == null || (metadataFormat != Format.JSON && metadataFormat != Format.XML)) { if (logger.isWarnEnabled()) logger.warn("Unsupported metadata format {}, using XML", metadataFormat.name()); metadataBase.setFormat(Format.XML); } } extraParams = addTemporalParams(extraParams, temporalCollection, null, systemTime); checkContentFormat(contentHandle); return services.postDocument( requestLogger, template, transaction, (metadataHandle != null) ? processedMetadata : null, mergeTransformParameters((transform != null) ? transform : getWriteTransform(), extraParams), metadataHandle, contentHandle); }
extraParams = addTemporalParams(extraParams, temporalCollection, temporalDocumentURI, systemTime);