Interface DefaultOfferService
-
- All Known Implementing Classes:
DefaultOfferServiceImpl,SanityCheckOfferServiceDecorator
public interface DefaultOfferServiceDefault offer service interface define offer methods
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringSTORAGE_CONF_FILE_NAME
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StorageBulkPutResultbulkPutObjects(java.lang.String containerName, java.util.List<java.lang.String> objectIds, MultiplexedStreamReader multiplexedStreamReader, DataCategory type, DigestType digestType)java.util.Map<java.lang.String,AccessRequestStatus>checkAccessRequestStatuses(java.util.List<java.lang.String> accessRequestId, boolean adminCrossTenantAccessRequestAllowed)booleancheckObjectAvailability(java.lang.String containerName, java.util.List<java.lang.String> objectsIds)voidcompactOfferLogs()java.lang.StringcreateAccessRequest(java.lang.String containerName, java.util.List<java.lang.String> objectIds)Create access request (asynchronous read from tape to local FS) for the given @containerName and objects list.java.lang.StringcreateObject(java.lang.String containerName, java.lang.String objectId, java.io.InputStream objectPart, DataCategory type, long size, DigestType digestType)Create object on container with objectId Receive object part of object.voiddeleteObject(java.lang.String containerName, java.lang.String objectId, DataCategory type)Deletes a object representing the data at location containerName/objectNameStorageBulkMetadataResultgetBulkMetadata(java.lang.String containerName, java.util.List<java.lang.String> objectIds, java.lang.Boolean noCache)ContainerInformationgetCapacity(java.lang.String containerName)Get container capacityStorageMetadataResultgetMetadata(java.lang.String containerName, java.lang.String objectId, boolean noCache)Get MetadataObjectContentgetObject(java.lang.String containerName, java.lang.String objectId)Get object on offer as an inputStreamjava.lang.StringgetObjectDigest(java.lang.String containerName, java.lang.String objectId, DigestType digestAlgorithm)Get offer storage digest of objectjava.util.List<OfferLog>getOfferLogs(java.lang.String containerName, java.lang.Long offset, int limit, Order order)Get the offer log of objects created in offer containerbooleanisObjectExist(java.lang.String containerName, java.lang.String objectId)Check if object existsvoidlistObjects(java.lang.String containerName, ObjectListingListener objectListingListener)List container objectsvoidremoveAccessRequest(java.lang.String accessRequestId, boolean adminCrossTenantAccessRequestAllowed)
-
-
-
Field Detail
-
STORAGE_CONF_FILE_NAME
static final java.lang.String STORAGE_CONF_FILE_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getObjectDigest
java.lang.String getObjectDigest(java.lang.String containerName, java.lang.String objectId, DigestType digestAlgorithm) throws ContentAddressableStorageExceptionGet offer storage digest of object- Parameters:
containerName- the container with the objectobjectId- the object name / iddigestAlgorithm- the digest algorithm- Returns:
- the offer computed digest
- Throws:
ContentAddressableStorageException- thrown on storage error
-
getObject
ObjectContent getObject(java.lang.String containerName, java.lang.String objectId) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageException
Get object on offer as an inputStream- Parameters:
containerName- the container containing the objectobjectId- the object id- Returns:
- the object included in a response
- Throws:
ContentAddressableStorageNotFoundException- thrown when object does not existsContentAddressableStorageException- thrown when a server error occurs
-
createAccessRequest
java.lang.String createAccessRequest(java.lang.String containerName, java.util.List<java.lang.String> objectIds) throws ContentAddressableStorageExceptionCreate access request (asynchronous read from tape to local FS) for the given @containerName and objects list. Return access request id- Parameters:
containerName- the container containing the objectobjectIds- the objects ids- Returns:
- acess request id
- Throws:
ContentAddressableStorageNotFoundException- thrown when object does not existsContentAddressableStorageException- thrown when a server error occurs
-
checkAccessRequestStatuses
java.util.Map<java.lang.String,AccessRequestStatus> checkAccessRequestStatuses(java.util.List<java.lang.String> accessRequestId, boolean adminCrossTenantAccessRequestAllowed) throws ContentAddressableStorageException
-
removeAccessRequest
void removeAccessRequest(java.lang.String accessRequestId, boolean adminCrossTenantAccessRequestAllowed) throws ContentAddressableStorageException
-
checkObjectAvailability
boolean checkObjectAvailability(java.lang.String containerName, java.util.List<java.lang.String> objectsIds) throws ContentAddressableStorageException
-
createObject
java.lang.String createObject(java.lang.String containerName, java.lang.String objectId, java.io.InputStream objectPart, DataCategory type, long size, DigestType digestType) throws ContentAddressableStorageExceptionCreate object on container with objectId Receive object part of object. Actually these parts HAVE TO be send in the great order.- Parameters:
containerName- the container nameobjectId- the offer objectId to createobjectPart- the part of the object to create (chunk style)type- the object type to createsize- inputstream sizedigestType- digest of object- Returns:
- the digest of the complete file or the digest of the chunk
- Throws:
ContentAddressableStorageException- if the container does not exist
-
bulkPutObjects
StorageBulkPutResult bulkPutObjects(java.lang.String containerName, java.util.List<java.lang.String> objectIds, MultiplexedStreamReader multiplexedStreamReader, DataCategory type, DigestType digestType) throws ContentAddressableStorageException, java.io.IOException
- Throws:
ContentAddressableStorageExceptionjava.io.IOException
-
isObjectExist
boolean isObjectExist(java.lang.String containerName, java.lang.String objectId) throws ContentAddressableStorageExceptionCheck if object exists- Parameters:
containerName- the container suppose to contain the objectobjectId- the objectId to check- Returns:
- true if object exists, false otherwise
- Throws:
ContentAddressableStorageServerExceptionContentAddressableStorageException
-
getCapacity
ContainerInformation getCapacity(java.lang.String containerName) throws ContentAddressableStorageException
Get container capacity- Parameters:
containerName- the container name- Returns:
- Json with usableSpace information
- Throws:
ContentAddressableStorageNotFoundException- thrown if the container does not existContentAddressableStorageServerExceptionContentAddressableStorageException
-
deleteObject
void deleteObject(java.lang.String containerName, java.lang.String objectId, DataCategory type) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageExceptionDeletes a object representing the data at location containerName/objectName- Parameters:
containerName- container where this exists.objectId- the objectId to deletetype- the object type to delete- Throws:
ContentAddressableStorageNotFoundException- Thrown when the container cannot be located or the blob cannot be located in the container.ContentAddressableStorageException- Thrown when delete action failed due some other failure
-
getMetadata
StorageMetadataResult getMetadata(java.lang.String containerName, java.lang.String objectId, boolean noCache) throws ContentAddressableStorageException
Get Metadata- Parameters:
containerName-objectId-noCache-- Returns:
- StorageMetadataResult
- Throws:
ContentAddressableStorageExceptionjava.io.IOException
-
getOfferLogs
java.util.List<OfferLog> getOfferLogs(java.lang.String containerName, java.lang.Long offset, int limit, Order order) throws ContentAddressableStorageException
Get the offer log of objects created in offer container- Parameters:
containerName- container the container nameoffset- the offset of the object before the wanted listlimit- number of objects wantedorder- order of search- Returns:
- list of object informations
- Throws:
ContentAddressableStorageDatabaseException- Database errorContentAddressableStorageServerException- Parsing errorContentAddressableStorageException
-
listObjects
void listObjects(java.lang.String containerName, ObjectListingListener objectListingListener) throws java.io.IOException, ContentAddressableStorageExceptionList container objects- Parameters:
containerName- the container nameobjectListingListener- a listener to which are reported found object entries- Throws:
java.io.IOExceptionContentAddressableStorageException
-
compactOfferLogs
void compactOfferLogs() throws java.lang.Exception- Throws:
java.lang.Exception
-
getBulkMetadata
StorageBulkMetadataResult getBulkMetadata(java.lang.String containerName, java.util.List<java.lang.String> objectIds, java.lang.Boolean noCache) throws ContentAddressableStorageException
-
-