Package org.yamcs.buckets
Interface BucketProvider
- All Known Implementing Classes:
RemoteYamcsBucketProvider
public interface BucketProvider
Provides buckets stored outside of Yamcs.
A new instance is created for each bucketProviders entry in yamcs.yaml, so implementations need a
public no-argument constructor, and may keep state related to their entry (for example a client) in fields.
-
Method Summary
Modifier and TypeMethodDescriptiondefault BucketcreateBucket(String bucketName) Called when a new bucket is to be created, if this provider entry hascreateBuckets: true.default voiddeleteBucket(Bucket bucket) Called when a bucket of this provider is to be deleted, for example through the HTTP API.Description of provider locationgetSpec()Returns the valid configuration options for this plugin.loadBuckets(YConfiguration config) Called on Yamcs startup, once for this provider entry.
-
Method Details
-
getLocation
BucketLocation getLocation()Description of provider location -
getSpec
Spec getSpec()Returns the valid configuration options for this plugin. -
loadBuckets
Called on Yamcs startup, once for this provider entry. Provider should create and return all buckets that match the provided configuration.Implementations do not need to verify bucket uniqueness.
- Throws:
IOException
-
createBucket
Called when a new bucket is to be created, if this provider entry hascreateBuckets: true. This happens for example on bucket creation through the HTTP API, or when a component needs a bucket that does not yet exist.If the bucket should survive a server restart, the provider must return it from
loadBuckets(YConfiguration)on the next start.Implementations do not need to verify bucket uniqueness.
- Parameters:
bucketName- the name of the bucket to create- Throws:
UnsupportedOperationException- if this provider does not support creating buckets (default)IOException
-
deleteBucket
Called when a bucket of this provider is to be deleted, for example through the HTTP API. The provider should delete the bucket, including its content, such that it is no longer returned fromloadBuckets(YConfiguration)on the next start.- Parameters:
bucket- the bucket to delete- Throws:
UnsupportedOperationException- if this provider does not support deleting buckets (default)IOException
-