org.kitesdk.data
Interface MetadataProvider

All Known Implementing Classes:
org.kitesdk.data.spi.AbstractMetadataProvider, FileSystemMetadataProvider

@NotThreadSafe
public interface MetadataProvider

A service provider interface for metadata system plugins.

Implementations of DatasetRepository are written against this interface and, by extension, can store dataset metadata information contained in the DatasetDescriptor in a system of the user's choosing.

Implementations of MetadataProvider are typically not thread-safe; that is, the behavior when accessing a single instance from multiple threads is undefined.


Method Summary
 DatasetDescriptor create(String name, DatasetDescriptor descriptor)
          Create a DatasetDescriptor for the dataset named name.
 boolean delete(String name)
          Delete all metadata associated with the dataset named name.
 boolean exists(String name)
          Checks if there is a DatasetDescriptor for the dataset named name.
 Collection<String> list()
          List the names of the Datasets managed by this MetadataProvider.
 DatasetDescriptor load(String name)
          Load the dataset descriptor for the dataset name.
 DatasetDescriptor update(String name, DatasetDescriptor descriptor)
          Update a DatasetDescriptor for the dataset named name.
 

Method Detail

load

DatasetDescriptor load(String name)
Load the dataset descriptor for the dataset name.

Parameters:
name - The fully qualified name of an existing dataset.
Returns:
A dataset descriptor.
Throws:
DatasetNotFoundException - If there is no descriptor for name
MetadataProviderException - If the dataset doesn't exist or the descriptor can not be loaded.

create

DatasetDescriptor create(String name,
                         DatasetDescriptor descriptor)
Create a 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.

Parameters:
name - The fully qualified name of a dataset.
descriptor - A dataset descriptor.
Returns:
The descriptor as persisted to the Metadata store.
Throws:
DatasetExistsException - If a DatasetDescriptor already exists for name
MetadataProviderException - If the DatasetDescriptor can not be saved
Since:
0.7.0

update

DatasetDescriptor update(String name,
                         DatasetDescriptor descriptor)
Update a 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.

Parameters:
name - The fully qualified name of a dataset.
descriptor - A dataset descriptor.
Returns:
The descriptor as persisted to the Metadata store.
Throws:
DatasetNotFoundException - If there is no descriptor for name
UnsupportedOperationException - If descriptor updates are not supported by the implementation.
MetadataProviderException - If the dataset descriptor can not be updated.
Since:
0.7.0

delete

boolean delete(String name)
Delete all metadata associated with the dataset named name.

Parameters:
name - The fully qualified name of a dataset.
Returns:
True if the dataset is successfully deleted, false if the dataset doesn't exist.
Throws:
MetadataProviderException - If the dataset metadata exists but can not be deleted.

exists

boolean exists(String name)
Checks if there is a DatasetDescriptor for the dataset named name.

Parameters:
name - a Dataset name to check the existence of
Returns:
true if name exists, false otherwise
Throws:
MetadataProviderException
Since:
0.7.0

list

Collection<String> list()
List the names of the Datasets managed by this MetadataProvider. If there is not at least one Dataset, an empty list will be returned.

Returns:
a Collection of Dataset names (Strings)
Throws:
MetadataProviderException
Since:
0.8.0


Copyright © 2013–2014. All rights reserved.