Package org.yamcs.buckets
Class Bucket
java.lang.Object
org.yamcs.buckets.Bucket
- Direct Known Subclasses:
FileSystemBucket,RdbBucket,RemoteYamcsBucket
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract CompletableFuture<Void>deleteObjectAsync(String objectName) abstract CompletableFuture<ObjectProperties>findObjectAsync(String objectName) Retrieve the object properties or null if not such an object existabstract BucketLocationBucket locationabstract StringgetName()This bucket's nameabstract CompletableFuture<byte[]>getObjectAsync(String objectName) Retrieve object from the bucket.abstract CompletableFuture<BucketProperties>booleanlistObjectsAsync(String prefix) abstract CompletableFuture<List<ObjectProperties>>listObjectsAsync(String prefix, Predicate<ObjectProperties> p) retrieve objects whose name start with prefix and that match the condition Note that searching by prefix is cheap, the condition will be evaluated for all objects that match the prefixabstract CompletableFuture<Void>putObjectAsync(String objectName, String contentType, Map<String, String> metadata, byte[] objectData) voidsetAccessRules(Map<Bucket.AccessRuleType, Map<String, List<PathMatcher>>> accessRules) Sets bucket object access rulesabstract voidsetMaxObjects(int maxObjects) Update the object count limit for this bucket.abstract voidsetMaxSize(long maxSize) Update the size limit for this bucket.
-
Constructor Details
-
Bucket
public Bucket()
-
-
Method Details
-
getLocation
Bucket location -
getName
This bucket's name -
getPropertiesAsync
-
setMaxSize
Update the size limit for this bucket.If the specified size is smaller than the current size, the bucket will no longer accept new files.
- Throws:
IOException
-
setMaxObjects
Update the object count limit for this bucket.If the specified count is smaller than the current count, the bucket will no longer accept new files.
- Throws:
IOException
-
listObjectsAsync
-
listObjectsAsync
-
listObjectsAsync
-
listObjectsAsync
public abstract CompletableFuture<List<ObjectProperties>> listObjectsAsync(String prefix, Predicate<ObjectProperties> p) retrieve objects whose name start with prefix and that match the condition Note that searching by prefix is cheap, the condition will be evaluated for all objects that match the prefix- Parameters:
prefix-p- predicate to be matched by the returned objects- Returns:
- list of objects
-
putObjectAsync
-
getObjectAsync
Retrieve object from the bucket. Returns null if object does not exist. -
deleteObjectAsync
-
findObjectAsync
Retrieve the object properties or null if not such an object exist -
setAccessRules
Sets bucket object access rules- Parameters:
accessRules- map of roles to a list of allowed path globs
-
getAccessRules
-
hasAccessRules
-