public class DataSetServiceClient extends Object
| Constructor and Description |
|---|
DataSetServiceClient(String baseUrl)
Creates instance of DataSetServiceClient.
|
DataSetServiceClient(String baseUrl,
String username,
String password)
Creates instance of DataSetServiceClient.
|
| Modifier and Type | Method and Description |
|---|---|
void |
assignRepresentationToDataSet(String providerId,
String dataSetId,
String cloudId,
String representationName,
String versionId)
Assigns representation into data set.
|
URI |
createDataSet(String providerId,
String dataSetId,
String description)
Creates a new data set.
|
void |
deleteDataSet(String providerId,
String dataSetId)
Deletes data set.
|
DataSetIterator |
getDataSetIteratorForProvider(String providerId)
Returns iterator to the list of all data sets of specified provider.
|
List<eu.europeana.cloud.common.model.Representation> |
getDataSetRepresentations(String providerId,
String dataSetId)
Lists all representation versions from data set.
|
eu.europeana.cloud.common.response.ResultSlice<eu.europeana.cloud.common.model.Representation> |
getDataSetRepresentationsChunk(String providerId,
String dataSetId,
String startFrom)
Returns chunk of representation versions list from data set.
|
List<eu.europeana.cloud.common.model.DataSet> |
getDataSetsForProvider(String providerId)
Lists all data sets of specified provider.
|
eu.europeana.cloud.common.response.ResultSlice<eu.europeana.cloud.common.model.DataSet> |
getDataSetsForProviderChunk(String providerId,
String startFrom)
Returns chunk of data sets list of specified provider.
|
RepresentationIterator |
getRepresentationIterator(String providerId,
String dataSetId)
Returns iterator to list of representation versions of data set.
|
void |
unassignRepresentationFromDataSet(String providerId,
String dataSetId,
String cloudId,
String representationName)
Unassigns representation from data set.
|
void |
updateDescriptionOfDataSet(String providerId,
String dataSetId,
String description)
Updates description of data set.
|
DataSetServiceClient |
useAuthorizationHeader(String headerValue) |
public DataSetServiceClient(String baseUrl)
baseUrl - URL of the MCS Rest Servicepublic DataSetServiceClient(String baseUrl, String username, String password)
DataSetServiceClient(String)
but includes username and password to perform authenticated requests.baseUrl - URL of the MCS Rest Servicepublic eu.europeana.cloud.common.response.ResultSlice<eu.europeana.cloud.common.model.DataSet> getDataSetsForProviderChunk(String providerId, String startFrom) throws eu.europeana.cloud.service.mcs.exception.MCSException
startFrom
parameter. If parameter is null, the first chunk is
returned. You can use ResultSlice.getNextSlice() of returned
result to obtain startFrom value to get the next chunk, etc;
if
ResultSlice.getNextSlice()==null
in returned result it means it is the last slice.
If you just need all representations, you can use
getDataSetRepresentations(java.lang.String, java.lang.String) method, which encapsulates this
method.providerId - provider identifier (required)startFrom - code pointing to the requested result slice (if equal to
null, first slice is returned)eu.europeana.cloud.service.mcs.exception.MCSException - on unexpected situationspublic List<eu.europeana.cloud.common.model.DataSet> getDataSetsForProvider(String providerId) throws eu.europeana.cloud.service.mcs.exception.MCSException
providerId - provider identifier (required)eu.europeana.cloud.service.mcs.exception.MCSException - on unexpected situationspublic DataSetIterator getDataSetIteratorForProvider(String providerId)
providerId - provider identifier (required)public URI createDataSet(String providerId, String dataSetId, String description) throws eu.europeana.cloud.service.mcs.exception.ProviderNotExistsException, eu.europeana.cloud.service.mcs.exception.DataSetAlreadyExistsException, eu.europeana.cloud.service.mcs.exception.MCSException
providerId - provider identifier (required)dataSetId - data set identifier (required)description - data set description (not required)eu.europeana.cloud.service.mcs.exception.DataSetAlreadyExistsException - when data set with given id (for
given provider) already existseu.europeana.cloud.service.mcs.exception.ProviderNotExistsException - when provider with given id does not
existeu.europeana.cloud.service.mcs.exception.MCSException - on unexpected situationspublic eu.europeana.cloud.common.response.ResultSlice<eu.europeana.cloud.common.model.Representation> getDataSetRepresentationsChunk(String providerId, String dataSetId, String startFrom) throws eu.europeana.cloud.service.mcs.exception.DataSetNotExistsException, eu.europeana.cloud.service.mcs.exception.MCSException
startFrom
parameter. If parameter is empty, the first chunk is returned. You can
use ResultSlice.getNextSlice() of returned result to obtain
startFrom value to get the next chunk, etc. If you just need
all representations, you can use getDataSetRepresentations(java.lang.String, java.lang.String)
method, which encapsulates this method.providerId - provider identifier (required)dataSetId - data set identifier (required)startFrom - code pointing to the requested result slice (if equal to
null, first slice is returned)eu.europeana.cloud.service.mcs.exception.DataSetNotExistsException - if data set does not existeu.europeana.cloud.service.mcs.exception.MCSException - on unexpected situationspublic List<eu.europeana.cloud.common.model.Representation> getDataSetRepresentations(String providerId, String dataSetId) throws eu.europeana.cloud.service.mcs.exception.DataSetNotExistsException, eu.europeana.cloud.service.mcs.exception.MCSException
providerId - provider identifier (required)dataSetId - data set identifier (required)eu.europeana.cloud.service.mcs.exception.DataSetNotExistsException - if data set does not existeu.europeana.cloud.service.mcs.exception.MCSException - on unexpected situationspublic RepresentationIterator getRepresentationIterator(String providerId, String dataSetId)
providerId - provider identifier (required)dataSetId - data set identifier (required)public void updateDescriptionOfDataSet(String providerId, String dataSetId, String description) throws eu.europeana.cloud.service.mcs.exception.DataSetNotExistsException, eu.europeana.cloud.service.mcs.exception.MCSException
providerId - provider identifier (required)dataSetId - data set identifier (required)description - new description of data set (if "" will
be set to "", if null will be set to
null)eu.europeana.cloud.service.mcs.exception.DataSetNotExistsException - if data set does not existeu.europeana.cloud.service.mcs.exception.MCSException - on unexpected situationspublic void deleteDataSet(String providerId, String dataSetId) throws eu.europeana.cloud.service.mcs.exception.DataSetNotExistsException, eu.europeana.cloud.service.mcs.exception.MCSException
providerId - provider identifier (required)dataSetId - data set identifier (required)eu.europeana.cloud.service.mcs.exception.DataSetNotExistsException - if data set does not existeu.europeana.cloud.service.mcs.exception.MCSException - on unexpected situationspublic void assignRepresentationToDataSet(String providerId, String dataSetId, String cloudId, String representationName, String versionId) throws eu.europeana.cloud.service.mcs.exception.DataSetNotExistsException, eu.europeana.cloud.service.mcs.exception.RepresentationNotExistsException, eu.europeana.cloud.service.mcs.exception.MCSException
getDataSetRepresentations(java.lang.String, java.lang.String)
method will return the last persistent version with
Representation.version filled.providerId - provider identifier (required)dataSetId - data set identifier (required)cloudId - cloudId of the record (required)representationName - name of the representation (required)versionId - version of representation; if not provided, latest
persistent version will be assigned to data seteu.europeana.cloud.service.mcs.exception.DataSetNotExistsException - if data set does not existeu.europeana.cloud.service.mcs.exception.RepresentationNotExistsException - if no such representation existseu.europeana.cloud.service.mcs.exception.MCSException - on unexpected situationspublic void unassignRepresentationFromDataSet(String providerId, String dataSetId, String cloudId, String representationName) throws eu.europeana.cloud.service.mcs.exception.DataSetNotExistsException, eu.europeana.cloud.service.mcs.exception.MCSException
providerId - provider identifier (required)dataSetId - data set identifier (required)cloudId - cloudId of the record (required)representationName - name of the representation (required)eu.europeana.cloud.service.mcs.exception.DataSetNotExistsException - if data set does not existeu.europeana.cloud.service.mcs.exception.MCSException - on unexpected situationspublic DataSetServiceClient useAuthorizationHeader(String headerValue)
Copyright © 2013–2017 Europeana Cloud Development Team. All rights reserved.