\Drupal\strata\Storage TierProviderFactoryInterface

A provider factory that can build the same endpoint pointed at a second location.

Tiered storage needs several buckets from one set of credentials. Rather than asking a site to configure a whole endpoint per tier - the same URL, region and keys typed four times - a factory that implements this takes the one thing that differs and builds a provider for it.

Separate from StorageProviderFactoryInterface rather than added to it, because a provider with exactly one possible location is a legitimate implementation and should not be forced to declare a method it cannot honour. A factory that does not implement this can still serve the nearest tier; it just cannot serve a second one, and Engine says so rather than writing two tiers into one bucket.

Summary

Methods
Constants
createFor()
id()
create()
No public constants found

Methods

createFor()

createFor(\Drupal\strata\Tier\TierTarget  $target) : \Drupal\strata\Storage\StorageProviderInterface

Builds a provider for one tier's location.

Parameters

\Drupal\strata\Tier\TierTarget $target

The tier's bucket and storage class. A target whose location is empty is built exactly as StorageProviderFactoryInterface::create() would build it, so the nearest tier of a single-bucket site is the same object either way.

Throws

\RuntimeException

When the endpoint is not configured well enough to address that location.

Returns

\Drupal\strata\Storage\StorageProviderInterface —

The provider.

id()

id() : string

The id the provider registers under, as it appears in configuration.

Returns

string —

A short lowercase token such as "s3" or "sftp".

create()

create() : \Drupal\strata\Storage\StorageProviderInterface

Builds the provider.

Throws

\RuntimeException

When the configuration does not describe a usable endpoint.

Returns

\Drupal\strata\Storage\StorageProviderInterface —

The provider.