@NotThreadSafe public interface MetadataProvider
A service provider interface for metadata system plugins.
Implementations of MetadataProvider are typically not thread-safe; that is,
the behavior when accessing a single instance from multiple threads is undefined.
| Modifier and Type | Method and Description |
|---|---|
DatasetDescriptor |
create(String namespace,
String name,
DatasetDescriptor descriptor)
Create a
DatasetDescriptor for the dataset named name. |
Collection<String> |
datasets(String namespace)
List the dataset names managed by this
MetadataProvider in the
given namespace. |
boolean |
delete(String namespace,
String name)
Delete all metadata associated with the dataset named
name. |
boolean |
exists(String namespace,
String name)
Checks if there is a
DatasetDescriptor for the dataset named
name. |
DatasetDescriptor |
load(String namespace,
String name)
Load the dataset descriptor for the dataset
name. |
Collection<String> |
namespaces()
List the namespaces for
Datasets managed by this
MetadataProvider. |
DatasetDescriptor |
update(String namespace,
String name,
DatasetDescriptor descriptor)
Update a
DatasetDescriptor for the dataset named name. |
DatasetDescriptor load(String namespace, String name)
name.namespace - A namespace, or logical group name, for the dataset.name - The name of an existing dataset.DatasetNotFoundException - If there is no descriptor for nameDatasetException - If the dataset doesn't exist or the descriptor can not be loaded.DatasetDescriptor create(String namespace, String name, DatasetDescriptor descriptor)
DatasetDescriptor for the dataset named name.
The descriptor will be stored for the named data set in this provider's
metadata store. It is illegal to create more than one descriptor for a
named data set, and an exception will be thrown.namespace - A namespace, or logical group name, for the dataset.name - The name of a dataset.descriptor - A dataset descriptor.DatasetExistsException - If a DatasetDescriptor already
exists for nameDatasetException - If the DatasetDescriptor can not
be savedDatasetDescriptor update(String namespace, String name, DatasetDescriptor descriptor)
DatasetDescriptor for the dataset named name.
The new descriptor will be stored for the named data set in this provider's
metadata store, replacing the previous descriptor. The named dataset must
already exist or an error will be thrown.
This method is optional.namespace - A namespace, or logical group name, for the dataset.name - The name of a dataset.descriptor - A dataset descriptor.DatasetNotFoundException - If there is no descriptor for
nameUnsupportedOperationException - If descriptor updates are not
supported by the implementation.DatasetException - If the dataset descriptor can not be
updated.boolean delete(String namespace, String name)
name.
After this method is called, there will be no DatasetDescriptor
stored for the given name, unless an exception has been thrown. If
metadata was removed, this method will return true. If there was
no DatasetDescriptor corresponding to the given name, then this
method will not make any changes and will return false.namespace - A namespace, or logical group name, for the dataset.name - The name of a dataset.true if the metadata is successfully deleted,
false if no action was taken.DatasetException - If the dataset metadata exists but can
not be deleted.boolean exists(String namespace, String name)
DatasetDescriptor for the dataset named
name.namespace - A namespace, or logical group name, for the dataset.name - a Dataset name to check the existence ofname exists, false otherwiseDatasetExceptionCollection<String> namespaces()
Datasets managed by this
MetadataProvider. If there is not at least one Dataset, an
empty list will be returned.Collection of namespace names (Strings)DatasetExceptionCollection<String> datasets(String namespace)
MetadataProvider in the
given namespace. If there is not at least one Dataset in the
namespace or if the namespace does not exist, an empty list will be
returned.Collection of Dataset names (Strings)DatasetExceptionCopyright © 2013–2015. All rights reserved.