public abstract class RemoteSolrCatalogProvider extends MaskableImpl implements CatalogProvider
createClient() method and return a new SolrClient.| Modifier and Type | Field and Description |
|---|---|
protected static String |
SOLR_CATALOG_CORE_NAME |
| Constructor and Description |
|---|
RemoteSolrCatalogProvider(FilterAdapter filterAdapter,
org.apache.solr.client.solrj.SolrClient client,
SolrFilterDelegateFactory solrFilterDelegateFactory)
Constructor.
|
RemoteSolrCatalogProvider(FilterAdapter filterAdapter,
org.apache.solr.client.solrj.SolrClient client,
SolrFilterDelegateFactory solrFilterDelegateFactory,
DynamicSchemaResolver resolver)
Constructor.
|
RemoteSolrCatalogProvider(FilterAdapter filterAdapter,
SolrFilterDelegateFactory solrFilterDelegateFactory)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
CreateResponse |
create(CreateRequest createRequest)
Publishes a list of
Metacard objects into the catalog. |
protected abstract Future<org.apache.solr.client.solrj.SolrClient> |
createClient()
Request the creation of a new
SolrClient. |
DeleteResponse |
delete(DeleteRequest deleteRequest)
Deletes records specified by a list of attribute values such as an id attribute.
|
Set<ContentType> |
getContentTypes()
Gets the
ContentTypes that are currently stored by the Source. |
String |
getDescription()
Returns a description of the describable item.
|
String |
getOrganization()
Returns the organization associated with the describable item.
|
String |
getTitle()
Returns the title of the describable item.
|
String |
getUrl()
Returns the current Solr server URL.
|
String |
getVersion()
Retrieve the version.
|
boolean |
isAvailable()
This method states whether this source is available, typically connecting and performing some
sort of simple query or ping to the native catalog.
|
boolean |
isAvailable(SourceMonitor callback)
This method is the same as
Source.isAvailable() but allows a caller to provide a SourceMonitor callback object which is meant to be used as a way for the Source to
dynamically contact the caller with its availability. |
void |
maskId(String id)
Sets the masked ID of this maskable item to the specified ID, and then sets an internal flag
indicating that the masked ID cannot be changed.
|
SourceResponse |
query(QueryRequest queryRequest) |
void |
setDisableTextPath(boolean disableTextPath)
Disables text path indexing for every subsequent update or insert.
|
void |
setForceAutoCommit(boolean forceAutoCommit)
Used to signal to the Solr client to commit on every transaction.
|
void |
setUrl(String url)
Sets Solr's URL.
|
void |
shutdown()
Shuts down the connection to Solr and releases resources.
|
UpdateResponse |
update(UpdateRequest updateRequest)
Updates a list of
Metacard records. |
protected void |
updateClient()
Forces an update of the Solr client.
|
setIdgetId, setDescription, setOrganization, setShortname, setTitle, setVersionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetSecurityAttributesgetIdprotected static final String SOLR_CATALOG_CORE_NAME
public RemoteSolrCatalogProvider(FilterAdapter filterAdapter, @Nullable org.apache.solr.client.solrj.SolrClient client, SolrFilterDelegateFactory solrFilterDelegateFactory, @Nullable DynamicSchemaResolver resolver)
filterAdapter - filter adaptor this provider will useclient - client this provider will use to connect to Solr. If set to null, a new
client will be created using createClient() when needed.solrFilterDelegateFactory - Solr filter delegate factory this provider will useresolver - schema resolver this provider will use. A default schema resolver will be used
if this parameter is null.public RemoteSolrCatalogProvider(FilterAdapter filterAdapter, @Nullable org.apache.solr.client.solrj.SolrClient client, SolrFilterDelegateFactory solrFilterDelegateFactory)
DynamicSchemaResolver.filterAdapter - filter adaptor this provider will useclient - client this provider will use to connect to Solr. If set to null, a new
client will be created using createClient() when needed.solrFilterDelegateFactory - Solr filter delegate factory this provider will usepublic RemoteSolrCatalogProvider(FilterAdapter filterAdapter, SolrFilterDelegateFactory solrFilterDelegateFactory)
SolrClient and DynamicSchemaResolver.filterAdapter - filter adaptor this provider will usesolrFilterDelegateFactory - Solr filter delegate factory this provider will usepublic void maskId(String id)
MaskableImplmaskId in interface MaskablemaskId in class MaskableImplid - the new id to usepublic void setForceAutoCommit(boolean forceAutoCommit)
ConfigurationStore so that the property is propagated throughout the Solr Catalog Provider
code.forceAutoCommit - true to force auto-commitspublic void setDisableTextPath(boolean disableTextPath)
disableTextPath - true to turn off text path indexingpublic Set<ContentType> getContentTypes()
SourceContentTypes that are currently stored by the Source. Notice the
return object is a Set, meaning it returns all unique content types found in the Source
without duplications.getContentTypes in interface SourceSet of ContentTypes currently available from this Source.public boolean isAvailable()
SourceThis is expected to be an expensive operation, possibly involving network I/O.
Typically only CatalogFramework implementations will call this and only
periodically.
isAvailable in interface Sourceddf.catalog.util.SourcePollerpublic boolean isAvailable(SourceMonitor callback)
SourceSource.isAvailable() but allows a caller to provide a SourceMonitor callback object which is meant to be used as a way for the Source to
dynamically contact the caller with its availability. The intent is to return a boolean as to
whether the Source is available at this very moment and also to use the SourceMonitor object to update the caller of this method if this Source's availability changes
later in the future.isAvailable in interface Sourcecallback - - used to notify the caller of this method when the Source object wants
to update its availability.public SourceResponse query(QueryRequest queryRequest) throws UnsupportedQueryException
query in interface SourcequeryRequest - the query to executeSourceResponse with query results and query response detailsUnsupportedQueryException - when the query is not understood, malformed, or not supported
by a Sourcepublic String getDescription()
DescribablegetDescription in interface DescribablegetDescription in class DescribableImplpublic String getOrganization()
DescribablegetOrganization in interface DescribablegetOrganization in class DescribableImplpublic String getTitle()
DescribablegetTitle in interface DescribablegetTitle in class DescribableImplpublic String getVersion()
DescribablegetVersion in interface DescribablegetVersion in class DescribableImplpublic CreateResponse create(CreateRequest createRequest) throws IngestException
CatalogProviderMetacard objects into the catalog.create in interface CatalogProvidercreateRequest - - the CreateRequest that includes a List of
Metacard objects to be stored in a Source. The ID of the
Metacard object will be ignored and populated / generated by the
CatalogProvider when the record has been stored.CreateResponse containing a List of fully populated
metacards. This should be similar to the parameter list of Metacard objects but it must have the ddf.catalog.data.Metacard ID
populated.IngestException - if any problem occurs when storing the metacardspublic DeleteResponse delete(DeleteRequest deleteRequest) throws IngestException
CatalogProviderdelete in interface CatalogProviderdeleteRequest - - the DeleteRequest containing the attribute values associated
with Metacards to deleteDeleteResponse with Metacards that were deleted.
These Metacards are fully populated in preparation for any
processing services.IngestException - if an issue occurs during the deletepublic UpdateResponse update(UpdateRequest updateRequest) throws IngestException
CatalogProviderMetacard records. Metacard
records that are not in the Catalog will not be created.update in interface CatalogProviderupdateRequest - - the UpdateRequest that includes updates to Metacard records that have been previously stored in a Source. A
given Attribute name-value pair in this request must uniquely
identify zero metacards or one metacard in the Source, otherwise an IngestException will be thrown.UpdateResponse containing a List of Update objects that represent the new (updated) and old (previous)
Metacard records.IngestException - if an issue occurs during the update such as multiple records were
matched for a single update entrypublic void shutdown()
@Nullable public String getUrl()
public void setUrl(@Nullable String url)
system.properties configuration file for the
different options and formats. createClient().url - new Solr URLprotected void updateClient()
protected abstract Future<org.apache.solr.client.solrj.SolrClient> createClient()
SolrClient.Future used to retrieve the new SolrClient createdThis work is licensed under a Creative Commons Attribution 4.0 International License.