@Override public DocumentDescriptor newDescriptor(String uri) { return new DocumentDescriptorImpl(uri, false); }
private boolean isExternalDescriptor(ContentDescriptor desc) { return desc != null && desc instanceof DocumentDescriptorImpl && !((DocumentDescriptorImpl) desc).isInternal(); }
@Override public DocumentDescriptor withFormat(Format format) { setFormat(format); return this; }
DocumentMetadataWriteHandle metadataHandle, AbstractWriteHandle contentHandle) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException { DocumentDescriptorImpl desc = new DocumentDescriptorImpl(false); if (templateFormat != null && templateFormat != contentFormat) { contentMimetype = templateFormat.getDefaultMimetype(); desc.setFormat(templateFormat); } else if (contentFormat != null && contentFormat != Format.UNKNOWN) { contentMimetype = contentBase.getMimetype(); desc.setFormat(contentFormat); desc.setMimetype(contentMimetype);
private TemporalDescriptor updateTemporalSystemTime(DocumentDescriptor desc, Headers headers) { if (headers == null) return null; DocumentDescriptorImpl temporalDescriptor; if ( desc instanceof DocumentDescriptorImpl ) { temporalDescriptor = (DocumentDescriptorImpl) desc; } else { temporalDescriptor = new DocumentDescriptorImpl(desc.getUri(), false); } temporalDescriptor.setTemporalSystemTime(headers.get(HEADER_X_MARKLOGIC_SYSTEM_TIME)); return temporalDescriptor; }
public DocumentDescriptorImpl(boolean isInternal) { super(); setInternal(isInternal); } public DocumentDescriptorImpl(String uri, boolean isInternal) {
public DocumentDescriptorImpl(String uri, boolean isInternal) { this(isInternal); setUri(uri); }
throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException DocumentDescriptorImpl desc = new DocumentDescriptorImpl(false); if (templateFormat != null && templateFormat != contentFormat) { contentMimetype = templateFormat.getDefaultMimetype(); desc.setFormat(templateFormat); } else if (contentFormat != null && contentFormat != Format.UNKNOWN) { contentMimetype = contentBase.getMimetype(); desc.setFormat(contentFormat); desc.setMimetype(contentMimetype);
public DocumentDescriptorImpl(boolean isInternal) { super(); setInternal(isInternal); } public DocumentDescriptorImpl(String uri, boolean isInternal) {
public DocumentDescriptorImpl(String uri, boolean isInternal) { this(isInternal); setUri(uri); }
@Override public DocumentDescriptor newDescriptor(String uri) { return new DocumentDescriptorImpl(uri, false); }
private boolean isExternalDescriptor(ContentDescriptor desc) { return desc != null && desc instanceof DocumentDescriptorImpl && !((DocumentDescriptorImpl) desc).isInternal(); }
@Override public DocumentDescriptor withFormat(Format format) { setFormat(format); return this; }
@Override public void patch(String uri, DocumentPatchHandle patch, Transaction transaction) throws ForbiddenUserException, FailedRequestException { patch(new DocumentDescriptorImpl(uri, true), patch, transaction); } @Override
private Request.Builder addVersionHeader(DocumentDescriptor desc, Request.Builder requestBldr, String name) { if ( desc != null && desc instanceof DocumentDescriptorImpl && !((DocumentDescriptorImpl) desc).isInternal()) { long version = desc.getVersion(); if (version != DocumentDescriptor.UNKNOWN_VERSION) { return requestBldr.header(name, "\"" + String.valueOf(version) + "\""); } } return requestBldr; }
@Override public void delete(String uri, Transaction transaction) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException { delete(new DocumentDescriptorImpl(uri, true), transaction, null, null); }
private WebResource.Builder addVersionHeader(DocumentDescriptor desc, WebResource.Builder builder, String name) { if (desc != null && desc instanceof DocumentDescriptorImpl && !((DocumentDescriptorImpl) desc).isInternal()) { long version = desc.getVersion(); if (version != DocumentDescriptor.UNKNOWN_VERSION) { return builder.header(name, "\"" + String.valueOf(version) + "\""); } } return builder; }
@Override public TemporalDescriptor delete(String uri, Transaction transaction, String temporalCollection) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException { return delete(new DocumentDescriptorImpl(uri, true), transaction, temporalCollection, null); }
@Override public <T extends BinaryReadHandle> T read(String uri, DocumentMetadataReadHandle metadataHandle, T contentHandle, ServerTransform transform, long start, long length, Transaction transaction) { return read(new DocumentDescriptorImpl(uri, true), metadataHandle, contentHandle, transform, start, length, transaction); }
@Override public void delete(String uri, Transaction transaction) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException { delete(new DocumentDescriptorImpl(uri, true), transaction); } @Override