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 Type
    Method
    Description
    default Bucket
    createBucket(String bucketName)
    Called when a new bucket is to be created, if this provider entry has createBuckets: true.
    default void
    Called when a bucket of this provider is to be deleted, for example through the HTTP API.
    Description of provider location
    Returns the valid configuration options for this plugin.
    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

      List<Bucket> loadBuckets(YConfiguration config) throws IOException
      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

      default Bucket createBucket(String bucketName) throws IOException
      Called when a new bucket is to be created, if this provider entry has createBuckets: 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

      default void deleteBucket(Bucket bucket) throws IOException
      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 from loadBuckets(YConfiguration) on the next start.
      Parameters:
      bucket - the bucket to delete
      Throws:
      UnsupportedOperationException - if this provider does not support deleting buckets (default)
      IOException