public class StorageDistributionImpl extends Object implements StorageDistribution
Modifier and Type | Field and Description |
---|---|
static String |
CATEGORY_IS_MANDATORY |
Constructor and Description |
---|
StorageDistributionImpl(StorageConfiguration configuration,
StorageLogService storageLogService)
Constructs the service with a given configuration
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkObjectExisting(String strategyId,
String objectId,
List<String> offerIds)
Verify if object exists
|
void |
close() |
com.fasterxml.jackson.databind.JsonNode |
createContainer(String strategyId)
Create a container Architects are aware of this.
|
void |
deleteContainer(String strategyId)
Delete a container
|
void |
deleteLogbook(String strategyId,
String logbookId)
Delete a logbook
|
void |
deleteObject(String strategyId,
String objectId,
String digest,
DigestType digestAlgorithm)
Delete an object
|
void |
deleteObjectGroup(String strategyId,
String objectGroupId)
Delete an ObjectGroup
|
void |
deleteUnit(String strategyId,
String unitId)
Delete an unit
|
javax.ws.rs.core.Response |
getContainerByCategory(String strategyId,
String objectId,
DataCategory category)
Get a specific Object binary data as an input stream
|
com.fasterxml.jackson.databind.JsonNode |
getContainerInformations(String strategyId)
Get Storage Information (availability and capacity) for the requested
tenant + strategy
|
com.fasterxml.jackson.databind.JsonNode |
getContainerInformations(String strategyId,
DataCategory type,
String objectId,
List<String> offerIds)
Get a specific Object information
|
com.fasterxml.jackson.databind.JsonNode |
getContainerLogbook(String strategyId,
String logbookId)
Get a specific Logbook as a JsonNode
|
com.fasterxml.jackson.databind.JsonNode |
getContainerLogbooks(String strategyId)
Retrieve a list of logbook ids associated to a given tenant
|
com.fasterxml.jackson.databind.JsonNode |
getContainerObjectGroup(String strategyId,
String objectGroupId)
Get a specific ObjectGroup as a JsonNode
|
com.fasterxml.jackson.databind.JsonNode |
getContainerObjectGroups(String strategyId)
Get Container ObjectGroups Information
|
com.fasterxml.jackson.databind.JsonNode |
getContainerUnit(String strategyId,
String unitId)
Get a specific Unit as a JsonNode
|
com.fasterxml.jackson.databind.JsonNode |
getContainerUnits(String strategyId)
Get Container Units Information
|
RequestResponse<OfferLog> |
getOfferLogs(String strategyId,
DataCategory category,
Long offset,
int limit,
Order order)
Get offer log from referent
|
InputStream |
getStorageContainer(String strategyId)
Get Storage Container full content as an InputStream
|
RequestResponse<com.fasterxml.jackson.databind.JsonNode> |
listContainerObjects(String strategyId,
DataCategory category,
String cursorId)
List container objects
|
com.fasterxml.jackson.databind.JsonNode |
status()
Get the status from the service
|
StoredInfoResult |
storeData(String strategyId,
String objectId,
ObjectDescription createObjectDescription,
DataCategory category,
String requester)
Store data of any type for given tenant on storage offers associated to
given strategy
|
public static final String CATEGORY_IS_MANDATORY
public StorageDistributionImpl(StorageConfiguration configuration, StorageLogService storageLogService)
configuration
- the configuration of the storagestorageLogService
- public StoredInfoResult storeData(String strategyId, String objectId, ObjectDescription createObjectDescription, DataCategory category, String requester) throws StorageException
StorageDistribution
storeData
in interface StorageDistribution
strategyId
- id of the strategyobjectId
- the workspace URI of the data to be retrieve (and stored in
offer)createObjectDescription
- object additional informationscategory
- the category of the data to store (unit, object...)requester
- the requester informationStorageNotFoundException
- Thrown if the Container does not existStorageTechnicalException
- Thrown in case of any technical problemStorageException
public com.fasterxml.jackson.databind.JsonNode getContainerInformations(String strategyId) throws StorageException
StorageDistribution
getContainerInformations
in interface StorageDistribution
strategyId
- id of the strategyStorageNotFoundException
- Thrown if the Container does not existStorageTechnicalException
- Thrown in case of any technical problemStorageException
public InputStream getStorageContainer(String strategyId) throws StorageNotFoundException, StorageTechnicalException
StorageDistribution
getStorageContainer
in interface StorageDistribution
strategyId
- id of the strategyStorageNotFoundException
- Thrown if the Storage Container does not existStorageTechnicalException
- Thrown if a technical exception is encounteredpublic com.fasterxml.jackson.databind.JsonNode createContainer(String strategyId) throws UnsupportedOperationException
StorageDistribution
createContainer
in interface StorageDistribution
strategyId
- id of the strategyUnsupportedOperationException
public void deleteContainer(String strategyId) throws UnsupportedOperationException
StorageDistribution
aware of this.
deleteContainer
in interface StorageDistribution
strategyId
- id of the strategyUnsupportedOperationException
public RequestResponse<com.fasterxml.jackson.databind.JsonNode> listContainerObjects(String strategyId, DataCategory category, String cursorId) throws StorageException
StorageDistribution
listContainerObjects
in interface StorageDistribution
strategyId
- the strategy id to get offerscategory
- the object type to listcursorId
- the cursorId if existsStorageException
- thrown in case of any technical problempublic RequestResponse<OfferLog> getOfferLogs(String strategyId, DataCategory category, Long offset, int limit, Order order) throws StorageException
StorageDistribution
getOfferLogs
in interface StorageDistribution
strategyId
- the strategy id to get offerscategory
- the object type to listoffset
- offset of the excluded objectlimit
- the number of result wantedorder
- orderStorageException
- thrown in case of any technical problempublic javax.ws.rs.core.Response getContainerByCategory(String strategyId, String objectId, DataCategory category) throws StorageException
StorageDistribution
getContainerByCategory
in interface StorageDistribution
strategyId
- id of the strategyobjectId
- id of the objectStorageNotFoundException
- Thrown if the Container or the object does not existStorageTechnicalException
- thrown if a technical error happenedStorageException
public com.fasterxml.jackson.databind.JsonNode getContainerInformations(String strategyId, DataCategory type, String objectId, List<String> offerIds) throws StorageException
StorageDistribution
getContainerInformations
in interface StorageDistribution
strategyId
- id of the strategytype
- data categoryobjectId
- id of the objectofferIds
- list id of offersStorageException
public boolean checkObjectExisting(String strategyId, String objectId, List<String> offerIds) throws StorageException
StorageDistribution
checkObjectExisting
in interface StorageDistribution
strategyId
- id of the strategyobjectId
- id of the objectofferIds
- list id of offersStorageException
public void deleteObject(String strategyId, String objectId, String digest, DigestType digestAlgorithm) throws StorageException
StorageDistribution
deleteObject
in interface StorageDistribution
strategyId
- id of the strategyobjectId
- id of the object to be deleteddigest
- the digest to be compared withdigestAlgorithm
- the digest AlgorithmStorageNotFoundException
- Thrown if the Container or the object does not existStorageTechnicalException
- thrown if a technical error happenedStorageException
public com.fasterxml.jackson.databind.JsonNode getContainerLogbooks(String strategyId) throws UnsupportedOperationException
StorageDistribution
getContainerLogbooks
in interface StorageDistribution
strategyId
- id of the strategyUnsupportedOperationException
public com.fasterxml.jackson.databind.JsonNode getContainerLogbook(String strategyId, String logbookId) throws UnsupportedOperationException
StorageDistribution
getContainerLogbook
in interface StorageDistribution
strategyId
- id of the strategylogbookId
- id of the logbookUnsupportedOperationException
public void deleteLogbook(String strategyId, String logbookId) throws UnsupportedOperationException
StorageDistribution
deleteLogbook
in interface StorageDistribution
strategyId
- id of the strategylogbookId
- id of the logbook to be deletedUnsupportedOperationException
- method not implemented yetpublic com.fasterxml.jackson.databind.JsonNode getContainerUnits(String strategyId) throws UnsupportedOperationException
StorageDistribution
getContainerUnits
in interface StorageDistribution
strategyId
- id of the strategyUnsupportedOperationException
- method not implemented yetpublic com.fasterxml.jackson.databind.JsonNode getContainerUnit(String strategyId, String unitId) throws UnsupportedOperationException
StorageDistribution
getContainerUnit
in interface StorageDistribution
strategyId
- id of the strategyunitId
- id of the unitUnsupportedOperationException
- method not implemented yetpublic void deleteUnit(String strategyId, String unitId) throws UnsupportedOperationException
StorageDistribution
deleteUnit
in interface StorageDistribution
strategyId
- id of the strategyunitId
- id of the Unit to be deletedUnsupportedOperationException
- method not implemented yetpublic com.fasterxml.jackson.databind.JsonNode getContainerObjectGroups(String strategyId) throws UnsupportedOperationException
StorageDistribution
getContainerObjectGroups
in interface StorageDistribution
strategyId
- id of the strategyUnsupportedOperationException
- method not implemented yetpublic com.fasterxml.jackson.databind.JsonNode getContainerObjectGroup(String strategyId, String objectGroupId) throws UnsupportedOperationException
StorageDistribution
getContainerObjectGroup
in interface StorageDistribution
strategyId
- id of the strategyobjectGroupId
- id of the ObjectGroupUnsupportedOperationException
- method not implemented yetpublic void deleteObjectGroup(String strategyId, String objectGroupId) throws UnsupportedOperationException
StorageDistribution
deleteObjectGroup
in interface StorageDistribution
strategyId
- id of the strategyobjectGroupId
- id of the ObjectGroup to be deletedUnsupportedOperationException
- method not implemented yetpublic com.fasterxml.jackson.databind.JsonNode status()
StorageDistribution
status
in interface StorageDistribution
public void close()
close
in interface VitamAutoCloseable
close
in interface AutoCloseable
Copyright © 2018 Vitam. All rights reserved.