public class CatalogFrameworkImpl extends DescribableImpl implements CatalogFramework
| Constructor and Description |
|---|
CatalogFrameworkImpl(CreateOperations createOperations,
UpdateOperations updateOperations,
DeleteOperations deleteOperations,
QueryOperations queryOperations,
ResourceOperations resourceOperations,
SourceOperations sourceOperations,
TransformOperations transformOperations)
Instantiates a new CatalogFrameworkImpl which delegates its work to surrogate operations
classes.
|
getDescription, getId, getOrganization, getTitle, getVersion, setDescription, setOrganization, setShortname, setTitle, setVersionclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetDescription, getId, getOrganization, getTitle, getVersionpublic CatalogFrameworkImpl(CreateOperations createOperations, UpdateOperations updateOperations, DeleteOperations deleteOperations, QueryOperations queryOperations, ResourceOperations resourceOperations, SourceOperations sourceOperations, TransformOperations transformOperations)
createOperations - delegate that handles create operationsupdateOperations - delegate that handles update operationsdeleteOperations - delegate that handles delete operationsqueryOperations - delegate that handles query operationsresourceOperations - delegate that handles resource operationssourceOperations - delegate that handles source operationstransformOperations - delegate that handles transformation operationspublic QueryOperations getQueryOperations()
public ResourceOperations getResourceOperations()
public SourceOperations getSourceOperations()
public TransformOperations getTransformOperations()
public void setFanoutEnabled(boolean fanoutEnabled)
public void setMasker(Masker masker)
Maskermasker - the Masker this framework will usepublic void setId(String sourceId)
setId in class DescribableImplsourceId - the sourceId to setpublic Set<String> getSourceIds()
CatalogFrameworkCatalogFramework. This set includes the local
provider and any federated sources, but not connected sources as they are hidden from external
clients.getSourceIds in interface CatalogFrameworkpublic SourceInfoResponse getSourceInfo(SourceInfoRequest sourceInfoRequest) throws SourceUnavailableException
CatalogFrameworkSource that is endpoint-addressable in
CatalogFramework, including its own CatalogProvider, based
on the contents of the SourceInfoRequest.
The SourceInfoRequest specifies either:
getSourceInfo in interface CatalogFrameworksourceInfoRequest - the SourceInfoRequestSourceInfoResponseSourceUnavailableException - if the source indicated in the SourceInfoRequest is
null, not found, or cannot provide the requested informationpublic CreateResponse create(CreateStorageRequest createRequest) throws IngestException, SourceUnavailableException
CatalogFrameworkMetacards in the CatalogProvider.
Implementations of this method must:
PreIngestPlugin.process(CreateRequest) for each registered PreIngestPlugin in order determined by the OSGi SERVICE_RANKING
(Descending, highest first), "daisy chaining" their responses to each other.
Call CatalogProvider.create(CreateRequest) on the registered
CatalogProvider
Call PostIngestPlugin.process(CreateResponse) for each
registered PostIngestPlugin in order determined by the OSGi
SERVICE_RANKING (Descending, highest first), "daisy chaining" their responses to each
other.
Call PreCreateStoragePlugin.process(CreateStorageRequest) for each
registered PreCreateStoragePlugin in order determined
by the OSGi SERVICE_RANKING (Descending, highest first), "daisy chaining" their responses
to each other.
Call StorageProvider.create(CreateStorageRequest) on the
registered CatalogProvider
Call PostCreateStoragePlugin.process(ddf.catalog.content.operation.CreateStorageResponse)
for each registered PostCreateStoragePlugin in order
determined by the OSGi SERVICE_RANKING (Descending, highest first), "daisy chaining"
their responses to each other.
create in interface CatalogFrameworkcreateRequest - the CreateStorageRequestCreateResponseIngestException - if an issue occurs during the updateSourceUnavailableException - if the source being updated is unavailablepublic CreateResponse create(CreateRequest createRequest) throws IngestException, SourceUnavailableException
CatalogFrameworkMetacards in the CatalogProvider.
Implementations of this method must:
PreIngestPlugin.process(CreateRequest) for each registered PreIngestPlugin in order determined by the OSGi SERVICE_RANKING
(Descending, highest first), "daisy chaining" their responses to each other.
Call CatalogProvider.create(CreateRequest) on the registered
CatalogProvider
Call PostIngestPlugin.process(CreateResponse) for each
registered PostIngestPlugin in order determined by the OSGi
SERVICE_RANKING (Descending, highest first), "daisy chaining" their responses to each
other.
create in interface CatalogFrameworkcreateRequest - the CreateRequestCreateResponseIngestException - if an issue occurs during the updateSourceUnavailableException - if the source being updated is unavailablepublic UpdateResponse update(UpdateStorageRequest updateRequest) throws IngestException, SourceUnavailableException
CatalogFrameworkIf a Metacard in the list to be updated does not have its ID attribute set, then the
associated ID for that Metacard in the UpdateRequest will be used.
Implementations of this method must:
PreIngestPlugin.process(UpdateRequest) for each registered PreIngestPlugin in order determined by the OSGi SERVICE_RANKING
(Descending, highest first), "daisy chaining" their responses to each other.
Call CatalogProvider.update(UpdateRequest) on the registered
CatalogProvider
Call PostIngestPlugin.process(UpdateResponse) for each
registered PostIngestPlugin in order determined by the OSGi
SERVICE_RANKING (Descending, highest first), "daisy chaining" their responses to each
other.
Call PreUpdateStoragePlugin.process(UpdateStorageRequest) for each
registered PreUpdateStoragePlugin in order determined
by the OSGi SERVICE_RANKING (Descending, highest first), "daisy chaining" their responses
to each other.
Call StorageProvider.update(UpdateStorageRequest) on the
registered CatalogProvider
Call PostUpdateStoragePlugin.process(ddf.catalog.content.operation.UpdateStorageResponse)
for each registered PostUpdateStoragePlugin in order
determined by the OSGi SERVICE_RANKING (Descending, highest first), "daisy chaining"
their responses to each other.
update in interface CatalogFrameworkupdateRequest - the UpdateStorageRequestUpdateResponseIngestException - if an issue occurs during the updateSourceUnavailableException - if the source being updated is unavailablepublic UpdateResponse update(UpdateRequest updateRequest) throws IngestException, SourceUnavailableException
CatalogFrameworkIf a Metacard in the list to be updated does not have its ID attribute set, then the
associated ID for that Metacard in the UpdateRequest will be used.
Implementations of this method must:
PreIngestPlugin.process(UpdateRequest) for each registered PreIngestPlugin in order determined by the OSGi SERVICE_RANKING
(Descending, highest first), "daisy chaining" their responses to each other.
Call CatalogProvider.update(UpdateRequest) on the registered
CatalogProvider
Call PostIngestPlugin.process(UpdateResponse) for each
registered PostIngestPlugin in order determined by the OSGi
SERVICE_RANKING (Descending, highest first), "daisy chaining" their responses to each
other.
update in interface CatalogFrameworkupdateRequest - the UpdateRequestUpdateResponseIngestException - if an issue occurs during the updateSourceUnavailableException - if the source being updated is unavailablepublic DeleteResponse delete(DeleteRequest deleteRequest) throws IngestException, SourceUnavailableException
CatalogFrameworkMetacards with Attributes matching a specified value.
Implementations of this method must:
PreIngestPlugin.process(DeleteRequest) for each registered PreIngestPlugin in order determined by the OSGi SERVICE_RANKING
(Descending, highest first), "daisy chaining" their responses to each other.
Call CatalogProvider.delete(DeleteRequest) on the registered
CatalogProvider
Call PostIngestPlugin.process(DeleteResponse) for each
registered PostIngestPlugin in order determined by the OSGi
SERVICE_RANKING (Descending, highest first), "daisy chaining" their responses to each
other.
delete in interface CatalogFrameworkdeleteRequest - the DeleteRequestDeleteResponseIngestException - if an issue occurs during the deletionSourceUnavailableException - if the source being updated is unavailablepublic QueryResponse query(QueryRequest fedQueryRequest) throws UnsupportedQueryException, SourceUnavailableException, FederationException
CatalogFrameworkQueryRequest using the default FederationStrategy
Implementations of this method must:
PreQueryPlugin.process(QueryRequest)
for each registered PreQueryPlugin in order determined by the
OSGi SERVICE_RANKING (Descending, highest first), "daisy chaining" their responses to
each other.
Call Source.query(QueryRequest) on the registered
CatalogProvider
Call Source.query(QueryRequest) on all registered
ConnectedSources
If applicable, invoke the default FederationStrategy which will call Source.query(QueryRequest) on all registered FederatedSources
Before returning, call PostQueryPlugin.process(QueryResponse)
for each registered PostQueryPlugin in order determined by the
OSGi SERVICE_RANKING (Descending, highest first), "daisy chaining" their responses to
each other.
Return the last QueryResponse to the caller.
Important: Implementations are free to limit the number of results returned
regardless of the page size requested in the QueryRequest. For that reason, clients
should not assume that the number of results returned matches the page size requested and write
their paging code accordingly. If the QueryResponse does not need to be used, it is
highly recommended that clients use an iterable class such as ResultIterable to retrieve and process results. If partitioning of
results is required clients may use Guavas Iterables.partition(Iterable, int) method.
query in interface CatalogFrameworkfedQueryRequest - the QueryRequestQueryResponse the resulting responseUnsupportedQueryException - if the provided query can not be interpreted by a required
SourceSourceUnavailableException - if a required Source is not
availableFederationException - if federation is requested but can not complete, usually due to the
FederationStrategyCatalogFramework.query(QueryRequest, FederationStrategy)public QueryResponse query(QueryRequest queryRequest, FederationStrategy strategy) throws SourceUnavailableException, UnsupportedQueryException, FederationException
CatalogFrameworkQueryRequest using the FederationStrategy provided.
Implementations of this method must implement all of the rules defined in CatalogFramework.query(QueryRequest), but use the specified FederationStrategy
Important: Implementations are free to limit the number of results returned
regardless of the page size requested in the QueryRequest. For that reason, clients
should not assume that the number of results returned matches the page size requested and write
their paging code accordingly. If the QueryResponse does not need to be used, it is
highly recommended that clients use an iterable class such as ResultIterable to retrieve and process results. If partitioning of
results is required clients may use Guavas Iterables.partition(Iterable, int) method.
query in interface CatalogFrameworkqueryRequest - the QueryRequeststrategy - the FederationStrategy to useQueryResponse the resulting responseSourceUnavailableException - if a required Source is
unavailableUnsupportedQueryException - if the Query can not be
evaluated by this CatalogFramework or any of its Sources.FederationException - if the QueryRequest includes FederatedSources and there is either a problem connecting to a FederatedSource or a FederatedSource cannot
evaluate the Querypublic BinaryContent transform(Metacard metacard, String transformerShortname, Map<String,Serializable> arguments) throws CatalogTransformerException
CatalogFrameworkMetacard into BinaryContent. The transformerId is used
to uniquely identify the MetacardTransformer desired.transform in interface CatalogFrameworkmetacard - the Metacard to be transformedtransformerShortname - the id of the MetacardTransformer desired,
as registered with the OSGi Service Registry.arguments - to be used by the the transformer, if applicableBinaryContent the transformed MetacardCatalogTransformerException - if there is a problem transforming the Metacardpublic BinaryContent transform(SourceResponse response, String transformerShortname, Map<String,Serializable> arguments) throws CatalogTransformerException
CatalogFrameworkSourceResponse (or QueryResponse) into BinaryContent. The transformerId is used to uniquely identify the QueryResponseTransformer desired.transform in interface CatalogFrameworkresponse - the SourceResponse to be transformedtransformerShortname - the id of the transformerarguments - to be used by the the transformer, if applicableBinaryContent the transformed SourceResponseCatalogTransformerException - if there is a problem transforming the SourceResponsepublic ResourceResponse getLocalResource(ResourceRequest resourceRequest) throws IOException, ResourceNotFoundException, ResourceNotSupportedException
CatalogFrameworkResourceRequest using available ResourceReaders
(does not attempt to locate the resource via federation).
Implementations of this method must:
PreResourcePlugin.process(ResourceRequest) for each registered PreResourcePlugin in order determined by the OSGi SERVICE_RANKING
(Descending, highest first), "daisy chaining" their responses to each other.
If not provided with a java.net.URI (
ResourceRequest.GET_RESOURCE_BY_PRODUCT_URI.equals(ResourceRequest.getAttributeName())==false
) , retrieve the matching Metacard and get its Product java.net.URI.
Locate the ResourceReader that supports the URI.getScheme() of the java.net.URI on the OSGi Registry.
Call ResourceReader.retrieveResource(java.net.URI, Map)
Call PostResourcePlugin.process(ResourceResponse) for each
registered PostResourcePlugin in order determined by the OSGi
SERVICE_RANKING (Descending, highest first), "daisy chaining" their responses to each
other.
getLocalResource in interface CatalogFrameworkresourceRequest - the ResourceRequestResourceResponseIOException - if there was a problem communicating with the system containing the
resourceResourceNotFoundException - if the requested resource was not foundResourceNotSupportedException - if the scheme used in the associated java.net.URI is not
supported by this CatalogFrameworkpublic ResourceResponse getResource(ResourceRequest resourceRequest, String resourceSiteName) throws IOException, ResourceNotFoundException, ResourceNotSupportedException
CatalogFrameworkResourceRequest using the specified site name.
Implementations of this method must:
PreResourcePlugin.process(ResourceRequest) for each registered PreResourcePlugin in order determined by the OSGi SERVICE_RANKING
(Descending, highest first), "daisy chaining" their responses to each other.
If not provided with a java.net.URI (
ResourceRequest.GET_RESOURCE_BY_PRODUCT_URI.equals(ResourceRequest.getAttributeName())==false
) , retrieve the matching Metacard and get its Product java.net.URI.
Locate the ResourceReader that supports the URI.getScheme() of the java.net.URI on the OSGi Registry.
Call ResourceReader.retrieveResource(java.net.URI, Map)
Call PostResourcePlugin.process(ResourceResponse) for each
registered PostResourcePlugin in order determined by the OSGi
SERVICE_RANKING (Descending, highest first), "daisy chaining" their responses to each
other.
getResource in interface CatalogFrameworkresourceRequest - the ResourceRequestresourceSiteName - name of the site/source to retrieve the resource fromResourceResponseIOException - if there was a problem communicating with the system containing the
resourceResourceNotFoundException - if the requested resource was not foundResourceNotSupportedException - if the scheme used in the associated java.net.URI is not
supported by this CatalogFrameworkpublic ResourceResponse getEnterpriseResource(ResourceRequest resourceRequest) throws IOException, ResourceNotFoundException, ResourceNotSupportedException
CatalogFrameworkResourceRequest against the local CatalogProvider
and RemoteSources.
Implementations of this method must:
PreResourcePlugin.process(ResourceRequest) for each registered PreResourcePlugin in order determined by the OSGi SERVICE_RANKING
(Descending, highest first), "daisy chaining" their responses to each other.
If not provided with a java.net.URI (
ResourceRequest.GET_RESOURCE_BY_PRODUCT_URI.equals(ResourceRequest.getAttributeName())==false
) , retrieve the matching Metacard and get its Product java.net.URI.
Locate the ResourceReader that supports the URI.getScheme() of the java.net.URI on the OSGi Registry.
Call ResourceReader.retrieveResource(java.net.URI, Map)
Call PostResourcePlugin.process(ResourceResponse) for each
registered PostResourcePlugin in order determined by the OSGi
SERVICE_RANKING (Descending, highest first), "daisy chaining" their responses to each
other.
getEnterpriseResource in interface CatalogFrameworkresourceRequest - the ResourceRequestResourceResponseIOException - if there was a problem communicating with the system containing the
resourceResourceNotFoundException - if the requested resource was not foundResourceNotSupportedException - if the scheme used in the associated java.net.URI is not
supported by this CatalogFramework@Deprecated public Map<String,Set<String>> getLocalResourceOptions(String metacardId) throws ResourceNotFoundException
CatalogFrameworkMetacard locally and retrieve arguments that can be used in the retrieval
of its associated Resource.getLocalResourceOptions in interface CatalogFrameworkmetacardId - the ID of the MetacardResourceNotFoundException - if the Metacard is not found or there is no Resource
associated with the Metacard@Deprecated public Map<String,Set<String>> getEnterpriseResourceOptions(String metacardId) throws ResourceNotFoundException
CatalogFrameworkMetacard in the enterprise and retrieve arguments that can be used in the
retrieval of its associated ResourcegetEnterpriseResourceOptions in interface CatalogFrameworkmetacardId - the ID of the MetacardResourceNotFoundException - if the Metacard is not found or there is no Resource
associated with the Metacard@Deprecated public Map<String,Set<String>> getResourceOptions(String metacardId, String sourceId) throws ResourceNotFoundException
CatalogFrameworkMetacard on specified Source and retrieve
arguments that can be used in the retrieval of its associated ResourcegetResourceOptions in interface CatalogFrameworkmetacardId - the ID of the metacardsourceId - the ID of the source to retrieve the metacard fromResourceNotFoundException - if the Metacard is not found or there is no Resource
associated with the MetacardThis work is licensed under a Creative Commons Attribution 4.0 International License.