public interface RecordService
| Modifier and Type | Method and Description |
|---|---|
void |
addRevision(String globalId,
String schema,
String version,
eu.europeana.cloud.common.model.Revision revision)
Creates or overrides revision with specific name.
|
eu.europeana.cloud.common.model.Representation |
copyRepresentation(String globalId,
String schema,
String version)
Creates a new temporary representation version from already existing version.
|
eu.europeana.cloud.common.model.Representation |
createRepresentation(String globalId,
String schema,
String providerId)
Creates a new representation version of a record.
|
void |
deleteContent(String globalId,
String schema,
String version,
String fileName)
Deletes specified file from temporary representation version.
|
void |
deleteRecord(String globalId)
Deletes record with all its representations (even those not returned by
getRecord), both persistent and temporary. |
void |
deleteRepresentation(String globalId,
String schema)
Deletes representation of a record in specific schema with all versions (temporary and persistent).
|
void |
deleteRepresentation(String globalId,
String schema,
String version)
Deletes a specified representation version of a record.
|
void |
getContent(String globalId,
String schema,
String version,
String fileName,
long rangeStart,
long rangeEnd,
OutputStream outputStream)
Copy a range of the file content to the output stream.
|
String |
getContent(String globalId,
String schema,
String version,
String fileName,
OutputStream os)
Fetches content of specified file in specified representation version and writes it into output stream.
|
eu.europeana.cloud.common.model.File |
getFile(String globalId,
String schema,
String version,
String fileName)
Gets file metadata from a specified representation version.
|
eu.europeana.cloud.common.model.Record |
getRecord(String globalId)
Returns latest persistent versions of all representations of the record.
|
eu.europeana.cloud.common.model.Representation |
getRepresentation(String globalId,
String schema)
Returns latest persistent version of particular representation of a record.
|
eu.europeana.cloud.common.model.Representation |
getRepresentation(String globalId,
String schema,
String version)
Returns a representation of a record in specified schema and version (might be persistent or not).
|
eu.europeana.cloud.common.response.RepresentationRevisionResponse |
getRepresentationRevision(String globalId,
String schema,
String revisionProviderId,
String revisionName,
Date revisionTimestamp)
Get RepresentationRevisionResponse object basing on cloud identifier, schema identifier and revision identifier.
|
eu.europeana.cloud.common.model.Revision |
getRevision(String globalId,
String schema,
String version,
String revisionKey)
Gets Revision from a specified representation version.
|
void |
insertRepresentationRevision(String globalId,
String schema,
String revisionProviderId,
String revisionName,
String versionId,
Date revisionTimestamp)
Insert information about representation revision association.
|
List<eu.europeana.cloud.common.model.Representation> |
listRepresentationVersions(String globalId,
String schema)
Lists all (persistent or not) versions of a record representation.
|
eu.europeana.cloud.common.model.Representation |
persistRepresentation(String globalId,
String schema,
String version)
Makes a certain temporary representation version a persistent one.
|
boolean |
putContent(String globalId,
String schema,
String version,
eu.europeana.cloud.common.model.File file,
InputStream content)
Creates or overrides file with specific name in specified representation version.
|
eu.europeana.cloud.common.model.Record getRecord(String globalId) throws RecordNotExistsException
globalId - id for the record.RecordNotExistsException - thrown if provided id is not registered id in the eCloud system.void deleteRecord(String globalId) throws RecordNotExistsException, RepresentationNotExistsException
getRecord), both persistent and temporary.globalId - id for the recordRecordNotExistsException - thrown if provided id is not registered id in the eCloud system.RepresentationNotExistsException - thrown if no representation can be found for requested record. Service cannot delete such record.eu.europeana.cloud.common.model.Representation getRepresentation(String globalId, String schema) throws RepresentationNotExistsException
globalId - id for the recordschema - schema of representationRepresentationNotExistsException - thrown if there is no representation for provided record and schema or such representation exists but
is not persistent.eu.europeana.cloud.common.model.Representation getRepresentation(String globalId, String schema, String version) throws RepresentationNotExistsException
globalId - id of the recordschema - schema of the representationversion - version of the representation.RepresentationNotExistsException - such representation does not exist in specified version.List<eu.europeana.cloud.common.model.Representation> listRepresentationVersions(String globalId, String schema) throws RepresentationNotExistsException
globalId - id of the recordschema - schema of the representationRepresentationNotExistsException - there is no representation in provided schema for specified record.void deleteRepresentation(String globalId, String schema) throws RepresentationNotExistsException
globalId - id of the recordschema - schema of the representationRepresentationNotExistsException - there is no representation in provided schema for specified record.void deleteRepresentation(String globalId, String schema, String version) throws RepresentationNotExistsException, CannotModifyPersistentRepresentationException
globalId - id of the recordschema - schema of the representationversion - version of the representationRepresentationNotExistsException - such representation does not exist in specified version.CannotModifyPersistentRepresentationException - specified representation version is persistent and cannot deleted.eu.europeana.cloud.common.model.Representation createRepresentation(String globalId, String schema, String providerId) throws RecordNotExistsException, ProviderNotExistsException
globalId - id of the recordschema - schema of the representationproviderId - provider who created this representation version.RecordNotExistsException - provided id of a record is not registered in eCloud system.ProviderNotExistsException - there is no such providereu.europeana.cloud.common.model.Representation persistRepresentation(String globalId, String schema, String version) throws RepresentationNotExistsException, CannotModifyPersistentRepresentationException, CannotPersistEmptyRepresentationException
globalId - id of the recordschema - schema of the representationversion - version of the representationRepresentationNotExistsException - such representation does not exist in specified version.CannotModifyPersistentRepresentationException - the representation version is already persistent.CannotPersistEmptyRepresentationException - the representation version does not contain files.eu.europeana.cloud.common.model.Representation copyRepresentation(String globalId, String schema, String version) throws RepresentationNotExistsException
globalId - id of the recordschema - schema of the representationversion - version of the representation which will be the base of the new version.RepresentationNotExistsException - representation does not exist in specified version.boolean putContent(String globalId, String schema, String version, eu.europeana.cloud.common.model.File file, InputStream content) throws CannotModifyPersistentRepresentationException, RepresentationNotExistsException
globalId - id of the recordschema - schema of the representationversion - version of the representationfile - eCloud file representing content metadata. This object MUST contain fileName and SHOULD contain mime
type.content - stream of file content.RepresentationNotExistsException - representation does not exist in specified version.CannotModifyPersistentRepresentationException - specified representation version is persistent so its files cannot be modified.void getContent(String globalId, String schema, String version, String fileName, long rangeStart, long rangeEnd, OutputStream outputStream) throws RepresentationNotExistsException, FileNotExistsException, WrongContentRangeException
globalId - record identifierschema - record schemaversion - version numberfileName - file namerangeStart - initial index of the range, inclusiverangeEnd - final index of the range, inclusive.outputStream - output streamRepresentationNotExistsException - representation does not exist in specified version.FileNotExistsException - if file with given name does not existWrongContentRangeException - if range is invalideu.europeana.cloud.common.model.File getFile(String globalId, String schema, String version, String fileName) throws RepresentationNotExistsException, FileNotExistsException
globalId - id of the recordschema - schema of the representationversion - version of the representationfileName - name of requested file.RepresentationNotExistsException - representation does not exist in specified version.FileNotExistsException - if file with given name does not exist in representation versionString getContent(String globalId, String schema, String version, String fileName, OutputStream os) throws RepresentationNotExistsException, FileNotExistsException
globalId - id of the recordschema - schema of the representationversion - version of the representationfileName - name of requested file.os - stream which the content will be written into.RepresentationNotExistsException - representation does not exist in specified version.FileNotExistsException - if file with given name does not exist in representation versionvoid deleteContent(String globalId, String schema, String version, String fileName) throws RepresentationNotExistsException, FileNotExistsException, CannotModifyPersistentRepresentationException
globalId - id of the recordschema - schema of the representationversion - version of the representationfileName - name of file to be removedRepresentationNotExistsException - representation does not exist in specified version.FileNotExistsException - if file with given name does not exist in representation versionCannotModifyPersistentRepresentationException - specified representation version is persistent.eu.europeana.cloud.common.model.Revision getRevision(String globalId, String schema, String version, String revisionKey) throws RepresentationNotExistsException, RevisionNotExistsException
globalId - id of the recordschema - schema of the representationversion - version of the representationrevisionKey - name of revision key providerId_revisionName.RepresentationNotExistsException - representation does not exist in specified version.RevisionNotExistsException - if revision with given key does not exist in representation versionvoid addRevision(String globalId, String schema, String version, eu.europeana.cloud.common.model.Revision revision) throws RevisionIsNotValidException
globalId - id of the recordschema - schema of the representationversion - version of the representationrevision - eCloud revision. This object MUST contain providerId and revisionName
type.RevisionIsNotValidExceptioneu.europeana.cloud.common.response.RepresentationRevisionResponse getRepresentationRevision(String globalId, String schema, String revisionProviderId, String revisionName, Date revisionTimestamp)
globalId - cloud identifier associated with the resulting representation revisionschema - representation name of the resulting representation revisionrevisionProviderId - revision provider identifier of the resulting representation revisionrevisionName - revision namerevisionTimestamp - revision timestampvoid insertRepresentationRevision(String globalId, String schema, String revisionProviderId, String revisionName, String versionId, Date revisionTimestamp)
globalId - cloud identifierschema - representation namerevisionProviderId - revision provider identifier of the resulting representation revisionrevisionName - revision namerevisionTimestamp - revision timestampversionId - version identifierCopyright © 2013–2017 Europeana Cloud Development Team. All rights reserved.