public class SolrCatalogProvider extends MaskableImpl implements CatalogProvider
CatalogProvider
implementation using Apache SolrModifier and Type | Field and Description |
---|---|
static int |
MAX_BOOLEAN_CLAUSES |
Constructor and Description |
---|
SolrCatalogProvider(org.apache.solr.client.solrj.SolrClient solrClient,
FilterAdapter adapter,
SolrFilterDelegateFactory solrFilterDelegateFactory)
Convenience constructor that creates a new ddf.catalog.source.solr.DynamicSchemaResolver
|
SolrCatalogProvider(org.apache.solr.client.solrj.SolrClient solrClient,
FilterAdapter adapter,
SolrFilterDelegateFactory solrFilterDelegateFactory,
DynamicSchemaResolver resolver)
Constructor that creates a new instance and allows for a custom
DynamicSchemaResolver |
Modifier and Type | Method and Description |
---|---|
CreateResponse |
create(CreateRequest request)
Publishes a list of
Metacard objects into the catalog. |
DeleteResponse |
delete(DeleteRequest deleteRequest)
Deletes records specified by a list of attribute values such as an id attribute.
|
Set<ContentType> |
getContentTypes()
Gets the
ContentType s 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 |
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. |
boolean |
isForcedAutoCommit() |
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 request) |
void |
shutdown() |
UpdateResponse |
update(UpdateRequest updateRequest)
Updates a list of
Metacard records. |
setId
getId, setDescription, setOrganization, setShortname, setTitle, setVersion
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSecurityAttributes
getId
public static final int MAX_BOOLEAN_CLAUSES
public SolrCatalogProvider(org.apache.solr.client.solrj.SolrClient solrClient, FilterAdapter adapter, SolrFilterDelegateFactory solrFilterDelegateFactory, DynamicSchemaResolver resolver)
DynamicSchemaResolver
solrClient
- Solr clientadapter
- injected implementation of FilterAdapterresolver
- Solr schema resolverpublic SolrCatalogProvider(org.apache.solr.client.solrj.SolrClient solrClient, FilterAdapter adapter, SolrFilterDelegateFactory solrFilterDelegateFactory)
solrClient
- Solr clientadapter
- injected implementation of FilterAdapterpublic Set<ContentType> getContentTypes()
Source
ContentType
s 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 Source
Set
of ContentType
s currently available from this Source
.public boolean isAvailable()
Source
This 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 Source
ddf.catalog.util.SourcePoller
public boolean isAvailable(SourceMonitor callback)
Source
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. 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 Source
callback
- - used to notify the caller of this method when the Source
object wants
to update its availability.public String getDescription()
Describable
getDescription
in interface Describable
getDescription
in class DescribableImpl
public String getOrganization()
Describable
getOrganization
in interface Describable
getOrganization
in class DescribableImpl
public String getTitle()
Describable
getTitle
in interface Describable
getTitle
in class DescribableImpl
public String getVersion()
Describable
getVersion
in interface Describable
getVersion
in class DescribableImpl
public void maskId(String id)
MaskableImpl
maskId
in interface Maskable
maskId
in class MaskableImpl
id
- the new id to usepublic SourceResponse query(QueryRequest request) throws UnsupportedQueryException
query
in interface Source
request
- the query to executeSourceResponse
with query results and query response detailsUnsupportedQueryException
- when the query is not understood, malformed, or not supported
by a Source
public CreateResponse create(CreateRequest request) throws IngestException
CatalogProvider
Metacard
objects into the catalog.create
in interface CatalogProvider
request
- - 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 UpdateResponse update(UpdateRequest updateRequest) throws IngestException
CatalogProvider
Metacard
records. Metacard
records that are not in the Catalog will not be created.update
in interface CatalogProvider
updateRequest
- - 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 DeleteResponse delete(DeleteRequest deleteRequest) throws IngestException
CatalogProvider
delete
in interface CatalogProvider
deleteRequest
- - the DeleteRequest
containing the attribute values associated
with Metacard
s to deleteDeleteResponse
with Metacard
s that were deleted.
These Metacard
s are fully populated in preparation for any
processing services.IngestException
- if an issue occurs during the deletepublic boolean isForcedAutoCommit()
public void shutdown()
This work is licensed under a Creative Commons Attribution 4.0 International License.