Class AccessorBucketService
java.lang.Object
io.clonecloudstore.accessor.server.application.AccessorBucketService
- All Implemented Interfaces:
AccessorBucketServiceInterface
@ApplicationScoped
public class AccessorBucketService
extends Object
implements AccessorBucketServiceInterface
Accessor Bucket Service
-
Constructor Summary
ConstructorsConstructorDescriptionAccessorBucketService
(LocalReplicatorService localReplicatorService, jakarta.enterprise.inject.Instance<DaoAccessorBucketRepository> bucketRepositoryInstance, jakarta.enterprise.inject.Instance<DaoAccessorObjectRepository> objectRepositoryInstance, OwnershipApiClientFactory ownershipApiClientFactory) -
Method Summary
Modifier and TypeMethodDescriptionboolean
checkBucket
(String bucketName, boolean fullCheck, String clientId, String opId, boolean isPublic) Check if Bucket existscreateBucket
(String bucketName, String clientId, boolean isPublic) Create bucket from client Id and bucketNamedeleteBucket
(String bucketName, String clientId, boolean isPublic) Delete bucket from bucket name if ownerGet Bucket information from bucket namegetBuckets
(String clientId) Get All buckets for this clientId as owner
-
Constructor Details
-
AccessorBucketService
public AccessorBucketService(LocalReplicatorService localReplicatorService, jakarta.enterprise.inject.Instance<DaoAccessorBucketRepository> bucketRepositoryInstance, jakarta.enterprise.inject.Instance<DaoAccessorObjectRepository> objectRepositoryInstance, OwnershipApiClientFactory ownershipApiClientFactory)
-
-
Method Details
-
createBucket
public AccessorBucket createBucket(String bucketName, String clientId, boolean isPublic) throws CcsAlreadyExistException, CcsOperationException Create bucket from client Id and bucketName- Specified by:
createBucket
in interfaceAccessorBucketServiceInterface
- Parameters:
bucketName
- Bucket NameclientId
- Format client ID use to identify clientisPublic
- True means replicate with replicator module- Returns:
- AccessorBucket add on Database and in object storage
- Throws:
CcsAlreadyExistException
CcsOperationException
-
getBucket
public AccessorBucket getBucket(String bucketName, String clientId, String opId, boolean isPublic) throws CcsNotExistException, CcsDeletedException, CcsOperationException Get Bucket information from bucket name- Specified by:
getBucket
in interfaceAccessorBucketServiceInterface
- Parameters:
bucketName
- Bucket name- Returns:
- AccessorBucket found
- Throws:
CcsNotExistException
CcsDeletedException
CcsOperationException
-
getBuckets
Get All buckets for this clientId as owner- Specified by:
getBuckets
in interfaceAccessorBucketServiceInterface
- Returns:
- the list of Buckets
- Throws:
CcsOperationException
-
checkBucket
public boolean checkBucket(String bucketName, boolean fullCheck, String clientId, String opId, boolean isPublic) throws CcsOperationException Check if Bucket exists- Specified by:
checkBucket
in interfaceAccessorBucketServiceInterface
- Parameters:
bucketName
- Bucket namefullCheck
- True to check Object StorageclientId
- the clientIdopId
- the OperationIdisPublic
- True to check remotely if not found locally- Returns:
- True if it exists
- Throws:
CcsOperationException
-
deleteBucket
public AccessorBucket deleteBucket(String bucketName, String clientId, boolean isPublic) throws CcsNotExistException, CcsDeletedException, CcsOperationException, CcsNotAcceptableException Delete bucket from bucket name if owner- Specified by:
deleteBucket
in interfaceAccessorBucketServiceInterface
- Parameters:
bucketName
- Bucket nameclientId
- Client ID used to identify clientisPublic
- true to send replication message on replicator- Returns:
- the associated DTO- deleted
- Throws:
CcsNotExistException
CcsDeletedException
CcsOperationException
CcsNotAcceptableException
-