public class RecordServiceClient extends Object
| Constructor and Description |
|---|
RecordServiceClient(String baseUrl)
Creates instance of RecordServiceClient.
|
RecordServiceClient(String baseUrl,
String username,
String password)
Creates instance of RecordServiceClient.
|
| Modifier and Type | Method and Description |
|---|---|
URI |
copyRepresentation(String cloudId,
String representationName,
String version)
Copies all information from one representation version to another.
|
URI |
createRepresentation(String cloudId,
String representationName,
String providerId)
Creates new representation version.
|
void |
deleteRecord(String cloudId)
Deletes record with all its representations in all versions.
|
void |
deleteRepresentation(String cloudId,
String representationName)
Deletes representation with all versions.
|
void |
deleteRepresentation(String cloudId,
String representationName,
String version)
Deletes representation in specified version.
|
eu.europeana.cloud.common.model.Record |
getRecord(String cloudId)
Returns record with all its latest persistent representations.
|
eu.europeana.cloud.common.model.Representation |
getRepresentation(String cloudId,
String representationName)
Returns latest persistent version of representation.
|
eu.europeana.cloud.common.model.Representation |
getRepresentation(String cloudId,
String representationName,
String version)
Returns representation in specified version.
|
List<eu.europeana.cloud.common.model.Representation> |
getRepresentations(String cloudId)
Lists all latest persistent versions of record representation.
|
List<eu.europeana.cloud.common.model.Representation> |
getRepresentations(String cloudId,
String representationName)
Lists all versions of record representation.
|
void |
grantPermissionsToVersion(String cloudId,
String representationName,
String version,
String userName,
eu.europeana.cloud.common.model.Permission permission)
Adds selected permission(s) to selected representation version.
|
void |
permitVersion(String cloudId,
String representationName,
String version)
Adds selected permission(s) to selected representation version.
|
URI |
persistRepresentation(String cloudId,
String representationName,
String version)
Makes specified temporary representation version persistent.
|
void |
revokePermissionsToVersion(String cloudId,
String representationName,
String version,
String userName,
eu.europeana.cloud.common.model.Permission permission)
Revokes permission(s) to selected representation version.
|
RecordServiceClient |
useAuthorizationHeader(String headerValue)
Client will use provided authorization header for all requests;
|
public RecordServiceClient(String baseUrl)
baseUrl - URL of the MCS Rest Servicepublic RecordServiceClient(String baseUrl, String username, String password)
RecordServiceClient(String)
but includes username and password to perform authenticated requests.baseUrl - URL of the MCS Rest Servicepublic RecordServiceClient useAuthorizationHeader(String headerValue)
headerValue - authorization header valuepublic eu.europeana.cloud.common.model.Record getRecord(String cloudId) throws eu.europeana.cloud.service.mcs.exception.RecordNotExistsException, eu.europeana.cloud.service.mcs.exception.MCSException
cloudId - id of the record (required)eu.europeana.cloud.service.mcs.exception.RecordNotExistsException - when id is not known UIS Serviceeu.europeana.cloud.service.mcs.exception.MCSException - on unexpected situationspublic void deleteRecord(String cloudId) throws eu.europeana.cloud.service.mcs.exception.RecordNotExistsException, eu.europeana.cloud.service.mcs.exception.MCSException
cloudId - id of deleted record (required)eu.europeana.cloud.service.mcs.exception.RecordNotExistsException - if cloudId is not known UIS Serviceeu.europeana.cloud.service.mcs.exception.MCSException - on unexpected situationspublic List<eu.europeana.cloud.common.model.Representation> getRepresentations(String cloudId) throws eu.europeana.cloud.service.mcs.exception.RecordNotExistsException, eu.europeana.cloud.service.mcs.exception.MCSException
cloudId - id of record from which to get representations (required)eu.europeana.cloud.service.mcs.exception.RecordNotExistsException - if cloudId is not known UIS Serviceeu.europeana.cloud.service.mcs.exception.MCSException - on unexpected situationspublic eu.europeana.cloud.common.model.Representation getRepresentation(String cloudId, String representationName) throws eu.europeana.cloud.service.mcs.exception.RepresentationNotExistsException, eu.europeana.cloud.service.mcs.exception.MCSException
cloudId - id of record from which to get representations (required)representationName - name of the representation (required)eu.europeana.cloud.service.mcs.exception.RepresentationNotExistsException - representation does not exist or
no persistent version of this representation existseu.europeana.cloud.service.mcs.exception.MCSException - on unexpected situationspublic URI createRepresentation(String cloudId, String representationName, String providerId) throws eu.europeana.cloud.service.mcs.exception.ProviderNotExistsException, eu.europeana.cloud.service.mcs.exception.RecordNotExistsException, eu.europeana.cloud.service.mcs.exception.MCSException
cloudId - id of the record in which to create the representation
(required)representationName - name of the representation to be created
(required)providerId - provider of this representation version (required)eu.europeana.cloud.service.mcs.exception.ProviderNotExistsException - when no provider with given id existseu.europeana.cloud.service.mcs.exception.RecordNotExistsException - when cloud id is not known to UIS
Serviceeu.europeana.cloud.service.mcs.exception.MCSException - on unexpected situationspublic void deleteRepresentation(String cloudId, String representationName) throws eu.europeana.cloud.service.mcs.exception.RepresentationNotExistsException, eu.europeana.cloud.service.mcs.exception.MCSException
cloudId - id of the record to delete representation from (required)representationName - representation name of deleted representation
(required)eu.europeana.cloud.service.mcs.exception.RepresentationNotExistsException - if specified Representation does
not existeu.europeana.cloud.service.mcs.exception.MCSException - on unexpected situationspublic List<eu.europeana.cloud.common.model.Representation> getRepresentations(String cloudId, String representationName) throws eu.europeana.cloud.service.mcs.exception.RepresentationNotExistsException, eu.europeana.cloud.service.mcs.exception.MCSException
cloudId - id of the record to get representation from (required)representationName - name of the representation (required)eu.europeana.cloud.service.mcs.exception.RepresentationNotExistsException - if specified Representation does
not existeu.europeana.cloud.service.mcs.exception.MCSException - on unexpected situationspublic eu.europeana.cloud.common.model.Representation getRepresentation(String cloudId, String representationName, String version) throws eu.europeana.cloud.service.mcs.exception.RepresentationNotExistsException, eu.europeana.cloud.service.mcs.exception.MCSException
cloudId - id of the record to get representation from (required)representationName - name of the representation (required)version - version of the representation to be obtained; if
version==LATEST function will return latest persistent version (required)eu.europeana.cloud.service.mcs.exception.RepresentationNotExistsException - if specified representation does
not existeu.europeana.cloud.service.mcs.exception.MCSException - on unexpected situationspublic void deleteRepresentation(String cloudId, String representationName, String version) throws eu.europeana.cloud.service.mcs.exception.RepresentationNotExistsException, eu.europeana.cloud.service.mcs.exception.CannotModifyPersistentRepresentationException, eu.europeana.cloud.service.mcs.exception.MCSException
cloudId - id of the record to delete representation version from
(required)representationName - name of the representation (required)version - the deleted version of the representation (required)eu.europeana.cloud.service.mcs.exception.RepresentationNotExistsException - if specified representation does
not existeu.europeana.cloud.service.mcs.exception.CannotModifyPersistentRepresentationException - if specified
representation is persistent and thus cannot be removedeu.europeana.cloud.service.mcs.exception.MCSException - on unexpected situationspublic URI copyRepresentation(String cloudId, String representationName, String version) throws eu.europeana.cloud.service.mcs.exception.RepresentationNotExistsException, eu.europeana.cloud.service.mcs.exception.MCSException
cloudId - id of the record that holds representation (required)representationName - name of the copied representation (required)version - version of the copied representation (required)eu.europeana.cloud.service.mcs.exception.RepresentationNotExistsException - if specified representation
version does not existeu.europeana.cloud.service.mcs.exception.MCSException - on unexpected situationspublic URI persistRepresentation(String cloudId, String representationName, String version) throws eu.europeana.cloud.service.mcs.exception.RepresentationNotExistsException, eu.europeana.cloud.service.mcs.exception.CannotModifyPersistentRepresentationException, eu.europeana.cloud.service.mcs.exception.CannotPersistEmptyRepresentationException, eu.europeana.cloud.service.mcs.exception.MCSException
cloudId - id of the record that holds representation (required)representationName - name of the representation to be persisted
(required)version - version that should be made persistent (required)eu.europeana.cloud.service.mcs.exception.RepresentationNotExistsException - when representation does not
exist in specified versioneu.europeana.cloud.service.mcs.exception.CannotModifyPersistentRepresentationException - when representation
version is already persistenteu.europeana.cloud.service.mcs.exception.CannotPersistEmptyRepresentationException - when representation
version has no file attached and thus cannot be made persistenteu.europeana.cloud.service.mcs.exception.MCSException - on unexpected situationspublic void grantPermissionsToVersion(String cloudId, String representationName, String version, String userName, eu.europeana.cloud.common.model.Permission permission) throws eu.europeana.cloud.service.mcs.exception.MCSException
cloudId - record identifierrepresentationName - representation nameversion - representation versionuserName - user who will get access to representation versionpermission - permission that will be grantedeu.europeana.cloud.service.mcs.exception.MCSExceptionpublic void revokePermissionsToVersion(String cloudId, String representationName, String version, String userName, eu.europeana.cloud.common.model.Permission permission) throws eu.europeana.cloud.service.mcs.exception.MCSException
cloudId - record identifierrepresentationName - representation nameversion - representation versionuserName - user who will get access to representation versionpermission - permission that will be grantedeu.europeana.cloud.service.mcs.exception.MCSExceptionpublic void permitVersion(String cloudId, String representationName, String version) throws eu.europeana.cloud.service.mcs.exception.MCSException
cloudId - record identifierrepresentationName - representation nameversion - representation versioneu.europeana.cloud.service.mcs.exception.MCSExceptionCopyright © 2013–2017 Europeana Cloud Development Team. All rights reserved.