Class AccessorObjectService
java.lang.Object
io.clonecloudstore.accessor.server.simple.application.AccessorObjectService
- All Implemented Interfaces:
AccessorObjectServiceInterface
@ApplicationScoped
public class AccessorObjectService
extends Object
implements AccessorObjectServiceInterface
Accessor Bucket Service
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateObject
(AccessorObject accessorObject, String hash, long len, String clientId) Before really creating Object, creates it in DB if possiblecreateObjectFinalize
(AccessorObject accessorObject, String hash, long len, String clientId, boolean external) Once Object really created in Driver Storage, finalize the Object in DB and Replicator if neededvoid
deleteObject
(String bucketName, String objectName, String clientId, boolean external) Delete object in DB and through Replicator if neededfilterObjects
(String bucketName, AccessorFilter filter, DriverApi driver) filterObjects
(String bucketName, AccessorFilter filter, String clientId, boolean external) getObjectInfo
(String bucketName, String objectName, String clientId) Get DB Object DTOobjectOrDirectoryExists
(String bucketName, String objectOrDirectoryName, boolean fullCheck, String clientId) Check if object or directory existsobjectOrDirectoryExists
(String bucketName, String objectOrDirectoryName, boolean fullCheck, String clientId, String opId, boolean external) Check if object or directory exists
-
Field Details
-
filesystemHandler
-
-
Constructor Details
-
AccessorObjectService
public AccessorObjectService()
-
-
Method Details
-
objectOrDirectoryExists
public StorageType objectOrDirectoryExists(String bucketName, String objectOrDirectoryName, boolean fullCheck, String clientId) throws CcsOperationException Check if object or directory exists- Specified by:
objectOrDirectoryExists
in interfaceAccessorObjectServiceInterface
- Parameters:
bucketName
- bucket nameobjectOrDirectoryName
- prefix or full namefullCheck
- if True, and if Object, will check on Driver Storage- Returns:
- the associated StorageType
- Throws:
CcsOperationException
-
objectOrDirectoryExists
public StorageType objectOrDirectoryExists(String bucketName, String objectOrDirectoryName, boolean fullCheck, String clientId, String opId, boolean external) throws CcsOperationException Description copied from interface:AccessorObjectServiceInterface
Check if object or directory exists- Specified by:
objectOrDirectoryExists
in interfaceAccessorObjectServiceInterface
- Throws:
CcsOperationException
-
getObjectInfo
public AccessorObject getObjectInfo(String bucketName, String objectName, String clientId) throws CcsNotExistException, CcsOperationException Get DB Object DTO- Specified by:
getObjectInfo
in interfaceAccessorObjectServiceInterface
- Throws:
CcsNotExistException
CcsOperationException
-
createObject
public AccessorObject createObject(AccessorObject accessorObject, String hash, long len, String clientId) throws CcsOperationException, CcsAlreadyExistException, CcsNotExistException, CcsNotAcceptableException Before really creating Object, creates it in DB if possible- Specified by:
createObject
in interfaceAccessorObjectServiceInterface
- Throws:
CcsNotAcceptableException
- if already in creation stepCcsOperationException
CcsAlreadyExistException
CcsNotExistException
-
createObjectFinalize
public AccessorObject createObjectFinalize(AccessorObject accessorObject, String hash, long len, String clientId, boolean external) throws CcsOperationException Once Object really created in Driver Storage, finalize the Object in DB and Replicator if needed- Specified by:
createObjectFinalize
in interfaceAccessorObjectServiceInterface
- Throws:
CcsOperationException
-
deleteObject
public void deleteObject(String bucketName, String objectName, String clientId, boolean external) throws CcsDeletedException, CcsNotExistException, CcsOperationException Delete object in DB and through Replicator if needed- Specified by:
deleteObject
in interfaceAccessorObjectServiceInterface
- Throws:
CcsDeletedException
CcsNotExistException
CcsOperationException
-
filterObjects
- Parameters:
bucketName
- bucket namefilter
- the filter to apply on Objects- Returns:
- a stream (InputStream) of AccessorObject line by line (newline separated)
-
filterObjects
public InputStream filterObjects(String bucketName, AccessorFilter filter, String clientId, boolean external) throws CcsOperationException - Specified by:
filterObjects
in interfaceAccessorObjectServiceInterface
- Parameters:
bucketName
- bucket namefilter
- the filter to apply on Objectsexternal
- True if bucket will be for external usage- Returns:
- a stream (InputStream) of AccessorObject line by line (newline separated)
- Throws:
CcsOperationException
-