@Path(value="/data-providers/{DATAPROVIDER}")
@Component
@Scope(value="request")
public class DataProviderResource
extends Object
| Modifier and Type | Field and Description |
|---|---|
protected String |
LOCAL_ID_CLASS_NAME |
| Constructor and Description |
|---|
DataProviderResource() |
| Modifier and Type | Method and Description |
|---|---|
javax.ws.rs.core.Response |
createIdMapping(String providerId,
String cloudId,
String localId)
Create a mapping between a cloud identifier and a record identifier for a
provider
Required permissions:
Authenticated user
|
protected void |
deleteLocalIdAcl(String localId,
String providerId) |
javax.ws.rs.core.Response |
deleteProvider(String dataProviderId)
Deletes data provider from database
Required permissions:
Admin role
|
javax.ws.rs.core.Response |
getCloudIdsByProvider(String providerId,
String from,
int to)
Get the cloud identifiers for a specific provider identifier with
pagination
|
javax.ws.rs.core.Response |
getLocalIdsByProvider(String providerId,
String from,
int to)
Get the local identifiers for a specific provider identifier with
pagination
|
eu.europeana.cloud.common.model.DataProvider |
getProvider(String providerId)
Retrieves details about selected data provider
|
protected void |
grantPermissionsToLocalId(eu.europeana.cloud.common.model.CloudId result,
String providerId) |
javax.ws.rs.core.Response |
removeIdMapping(String providerId,
String localId)
Remove the mapping between a record identifier and a cloud identifier
Required permissions:
Authenticated user
Write permissions for selected data provider and local identifier
(granted at the mapping creation)
|
void |
updateProvider(eu.europeana.cloud.common.model.DataProviderProperties dataProviderProperties,
String providerId,
javax.ws.rs.core.UriInfo uriInfo)
Updates data provider information.
|
protected final String LOCAL_ID_CLASS_NAME
@GET
@Produces(value={"application/xml","application/json"})
public eu.europeana.cloud.common.model.DataProvider getProvider(@PathParam(value="DATAPROVIDER")
String providerId)
throws eu.europeana.cloud.common.exceptions.ProviderDoesNotExistException
providerId - REQUIRED identifier of the provider that will
be retrievedeu.europeana.cloud.common.exceptions.ProviderDoesNotExistException - The supplied provider does not exist@PUT
@Consumes(value={"application/xml","application/json"})
@PreAuthorize(value="hasPermission(#providerId, \'eu.europeana.cloud.common.model.DataProvider\', write)")
public void updateProvider(eu.europeana.cloud.common.model.DataProviderProperties dataProviderProperties,
@PathParam(value="DATAPROVIDER")
String providerId,
@Context
javax.ws.rs.core.UriInfo uriInfo)
throws eu.europeana.cloud.common.exceptions.ProviderDoesNotExistException
dataProviderProperties - REQUIRED data provider properties.providerId - REQUIRED identifier of data provider which
will be updated.eu.europeana.cloud.common.exceptions.ProviderDoesNotExistException - The supplied provider does not exist@DELETE
@PreAuthorize(value="hasRole(\'ROLE_ADMIN\')")
public javax.ws.rs.core.Response deleteProvider(@PathParam(value="DATAPROVIDER")
String dataProviderId)
throws eu.europeana.cloud.common.exceptions.ProviderDoesNotExistException
dataProviderId - REQUIRED data provider ideu.europeana.cloud.common.exceptions.ProviderDoesNotExistException - The supplied provider does not exist@GET
@Path(value="localIds")
@Produces(value={"application/json","application/xml"})
public javax.ws.rs.core.Response getLocalIdsByProvider(@PathParam(value="DATAPROVIDER")
String providerId,
@QueryParam(value="from")
String from,
@QueryParam(value="to")@DefaultValue(value="10000")
int to)
throws eu.europeana.cloud.service.uis.exception.DatabaseConnectionException,
eu.europeana.cloud.common.exceptions.ProviderDoesNotExistException,
eu.europeana.cloud.service.uis.exception.RecordDatasetEmptyException
providerId - REQUIRED identifier of provider for which all
local identifiers will be retrievedfrom - from which one local identifier should we start.to - how many local identifiers should be contained in results
list. Default is 10000eu.europeana.cloud.service.uis.exception.DatabaseConnectionException - database erroreu.europeana.cloud.common.exceptions.ProviderDoesNotExistException - provider does not existeu.europeana.cloud.service.uis.exception.RecordDatasetEmptyException - dataset is empty@GET
@Path(value="cloudIds")
@Produces(value={"application/json","application/xml"})
public javax.ws.rs.core.Response getCloudIdsByProvider(@PathParam(value="DATAPROVIDER")
String providerId,
@QueryParam(value="from")
String from,
@QueryParam(value="to")@DefaultValue(value="10000")
int to)
throws eu.europeana.cloud.service.uis.exception.DatabaseConnectionException,
eu.europeana.cloud.common.exceptions.ProviderDoesNotExistException,
eu.europeana.cloud.service.uis.exception.RecordDatasetEmptyException
providerId - REQUIRED identifier of provider for which all
cloud identifiers will be retrievedfrom - from which one cloud identifier should we start.to - how many cloud identifiers should be contained in results
list. Default is 10000eu.europeana.cloud.service.uis.exception.DatabaseConnectionException - database connection erroteu.europeana.cloud.common.exceptions.ProviderDoesNotExistException - provider does not existeu.europeana.cloud.service.uis.exception.RecordDatasetEmptyException - record dataset is empty@POST
@Path(value="cloudIds/{CLOUDID}")
@Produces(value={"application/json","application/xml"})
@PreAuthorize(value="isAuthenticated()")
public javax.ws.rs.core.Response createIdMapping(@PathParam(value="DATAPROVIDER")
String providerId,
@PathParam(value="CLOUDID")
String cloudId,
@QueryParam(value="recordId")
String localId)
throws eu.europeana.cloud.service.uis.exception.DatabaseConnectionException,
eu.europeana.cloud.service.uis.exception.CloudIdDoesNotExistException,
eu.europeana.cloud.service.uis.exception.IdHasBeenMappedException,
eu.europeana.cloud.common.exceptions.ProviderDoesNotExistException,
eu.europeana.cloud.service.uis.exception.RecordDatasetEmptyException,
eu.europeana.cloud.service.uis.exception.CloudIdAlreadyExistException
providerId - REQUIRED identifier of data provider, owner
of the recordcloudId - REQUIRED cloud identifier for which new
record identifier will be addedlocalId - record identifier which will be bound to selected cloud
identifier. If not specified, random one will be generatedeu.europeana.cloud.service.uis.exception.DatabaseConnectionException - datbase connection erroreu.europeana.cloud.service.uis.exception.CloudIdDoesNotExistException - cloud identifier does not existeu.europeana.cloud.service.uis.exception.IdHasBeenMappedException - identifier already mappedeu.europeana.cloud.common.exceptions.ProviderDoesNotExistException - provider does not existeu.europeana.cloud.service.uis.exception.RecordDatasetEmptyException - empty dataseteu.europeana.cloud.service.uis.exception.CloudIdAlreadyExistException - cloud identifier alrrasy existprotected void grantPermissionsToLocalId(eu.europeana.cloud.common.model.CloudId result,
String providerId)
throws org.springframework.security.acls.model.NotFoundException,
org.springframework.security.acls.model.AlreadyExistsException
org.springframework.security.acls.model.NotFoundExceptionorg.springframework.security.acls.model.AlreadyExistsException@DELETE
@Path(value="localIds/{LOCALID}")
@Produces(value={"application/json","application/xml"})
@PreAuthorize(value="hasPermission(#localId.concat(\'/\').concat(#providerId),\'LocalId\', write)")
public javax.ws.rs.core.Response removeIdMapping(@PathParam(value="DATAPROVIDER")
String providerId,
@PathParam(value="LOCALID")
String localId)
throws eu.europeana.cloud.service.uis.exception.DatabaseConnectionException,
eu.europeana.cloud.common.exceptions.ProviderDoesNotExistException,
eu.europeana.cloud.service.uis.exception.RecordIdDoesNotExistException
providerId - REQUIRED identifier of the provider, owner of
the recordlocalId - REQUIRED record identifier which will be
detached from selected provider identifier.eu.europeana.cloud.service.uis.exception.DatabaseConnectionException - database erroreu.europeana.cloud.common.exceptions.ProviderDoesNotExistException - provider does not existeu.europeana.cloud.service.uis.exception.RecordIdDoesNotExistException - record does not existCopyright © 2013–2016 Europeana Cloud Development Team. All rights reserved.