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 neededvoiddeleteObject(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:
objectOrDirectoryExistsin 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:AccessorObjectServiceInterfaceCheck if object or directory exists- Specified by:
objectOrDirectoryExistsin interfaceAccessorObjectServiceInterface- Throws:
CcsOperationException
-
getObjectInfo
public AccessorObject getObjectInfo(String bucketName, String objectName, String clientId) throws CcsNotExistException, CcsOperationException Get DB Object DTO- Specified by:
getObjectInfoin interfaceAccessorObjectServiceInterface- Throws:
CcsNotExistExceptionCcsOperationException
-
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:
createObjectin interfaceAccessorObjectServiceInterface- Throws:
CcsNotAcceptableException- if already in creation stepCcsOperationExceptionCcsAlreadyExistExceptionCcsNotExistException
-
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:
createObjectFinalizein 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:
deleteObjectin interfaceAccessorObjectServiceInterface- Throws:
CcsDeletedExceptionCcsNotExistExceptionCcsOperationException
-
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:
filterObjectsin 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
-