public interface VirtualRepository extends Iterable<Asset>
Clients may:
discover(AssetType...)). Asset descriptions can be iterated over or looked up up by identifier (cf.
lookup(String));
retrieve(Asset, Class));
publish(Asset, Object)).
Asset,
AssetType,
RepositoryService| Modifier and Type | Method and Description |
|---|---|
int |
discover(AssetType... types)
Discovers all the assets of given
AssetTypes which are available through all the underlying
RepositoryServices, using a default timeout. |
int |
discover(Iterable<RepositoryService> services,
AssetType... types)
Discovers all the assets of given
AssetTypes which are available through one or more
RepositoryServices, using a default timeout. |
int |
discover(long timeout,
AssetType... types)
Discovers all the assets of given
AssetTypes which are available through the underlying
RepositoryServices, using a given timeout. |
int |
discover(long timeout,
Iterable<RepositoryService> services,
AssetType... types)
Discovers all the assets of given
AssetTypes which are available through one or more
RepositoryServices, using a default timeout. |
Map<AssetType,List<Asset>> |
lookup(AssetType... type)
|
List<Asset> |
lookup(AssetType type)
|
Asset |
lookup(String id)
Returns an
Asset previously discovered. |
void |
publish(Asset asset,
Object content)
Publishes a given
Asset with the RepositoryService bound to the asset. |
<A> A |
retrieve(Asset asset,
Class<A> api)
Retrieves the content of a given
Asset from the RepositoryService bound to the asset, under a
given API. |
Services |
services()
Returns the
RepositoryServices underlying this repository. |
void |
shutdown()
Closes this repository and releases its resources.
|
Collection<RepositoryService> |
sinks(AssetType... types)
Returns the
RepositoryServices underlying this repository which can publish `Asset`s of at least one of
given AssetTypes. |
Collection<RepositoryService> |
sources(AssetType... types)
Returns the
RepositoryServices underlying this repository which can retrieve `Asset`s of at least one of
given AssetTypes. |
forEach, iterator, spliteratorServices services()
RepositoryServices underlying this repository.Collection<RepositoryService> sinks(AssetType... types)
RepositoryServices underlying this repository which can publish `Asset`s of at least one of
given AssetTypes.AssetTypesCollection<RepositoryService> sources(AssetType... types)
RepositoryServices underlying this repository which can retrieve `Asset`s of at least one of
given AssetTypes.AssetTypesint discover(AssetType... types)
AssetTypes which are available through all the underlying
RepositoryServices, using a default timeout.types - the asset typesdiscover(long, AssetType...)int discover(Iterable<RepositoryService> services, AssetType... types)
AssetTypes which are available through one or more
RepositoryServices, using a default timeout.services - the repository servicestypes - the asset typesdiscover(long, AssetType...)int discover(long timeout,
AssetType... types)
AssetTypes which are available through the underlying
RepositoryServices, using a given timeout.
Discovery may involve networked interactions with repository services, and typically will. Failures that occur when interacting with given repository services are silently tolerated. The interactions do not imply the transfer of asset content, however, only content descriptions.
This method may be invoked multiple times in the lifetime of this repository, typically to discover new assets that may have become available through the repository services. In this case, discovering an asset overwrites any existing description of an asset with the same identifier.
types - the asset typesint discover(long timeout,
Iterable<RepositoryService> services,
AssetType... types)
AssetTypes which are available through one or more
RepositoryServices, using a default timeout.types - the asset typesservices - the repository servicesdiscover(long, AssetType...)Asset lookup(String id)
Asset previously discovered.
This is a local operation and does not trigger network interactions.
name - the asset identifierIllegalStateException - if an asset with the given identifier was not ingested in this repository<A> A retrieve(Asset asset, Class<A> api)
Asset from the RepositoryService bound to the asset, under a
given API.
Retrieval may involve networked interactions with the repository service, and typically will. Failures are reported as unchecked exceptions.
asset - the assetapi - the APIIllegalArgumentException - is the asset has no associated serviceIllegalStateException - if the content of the asset cannot be retrieved with the given APIvoid publish(Asset asset, Object content)
Asset with the RepositoryService bound to the asset.
Publication may involve networked interactions with the repository service, and typically will. Failures are reported as unchecked exceptions.
asset - the assetcontent - the content of the assetIllegalArgumentException - is the asset has no associated serviceIllegalStateException - if the asset cannot be published under the API of the content providedvoid shutdown()
Copyright © 2018. All rights reserved.