public class OpenSearchSource extends Object implements FederatedSource, ConfiguredService
| Modifier and Type | Field and Description |
|---|---|
protected SecureCxfClientFactory<OpenSearch> |
factory |
| Constructor and Description |
|---|
OpenSearchSource(FilterAdapter filterAdapter,
OpenSearchParser openSearchParser,
OpenSearchFilterVisitor openSearchFilterVisitor,
EncryptionService encryptionService)
Creates an OpenSearch Site instance.
|
OpenSearchSource(FilterAdapter filterAdapter,
OpenSearchParser openSearchParser,
OpenSearchFilterVisitor openSearchFilterVisitor,
EncryptionService encryptionService,
BiConsumer<List<org.jdom2.Element>,SourceResponse> foreignMarkupBiConsumer)
Creates an OpenSearch Site instance.
|
| Modifier and Type | Method and Description |
|---|---|
protected SecureCxfClientFactory<OpenSearch> |
createClientFactory(String url,
String username,
String password) |
void |
destroy(int code) |
Boolean |
getAllowRedirects() |
String |
getConfigurationPid()
Returns the PID of the configuration that corresponds to this service
|
Integer |
getConnectionTimeout() |
Set<ContentType> |
getContentTypes()
Gets the
ContentTypes that are currently stored by the Source. |
String |
getDescription()
Returns a description of the describable item.
|
Boolean |
getDisableCnCheck() |
String |
getEndpointUrl()
Get the URL of the endpoint.
|
String |
getId()
Returns the name, aka ID, of the describable item.
|
boolean |
getLocalQueryOnly()
Get the boolean flag that indicates only local queries are being executed by this OpenSearch
Source.
|
List<String> |
getMarkUpSet() |
Set<String> |
getOptions(Metacard metacard)
Obtain a set of all options supported by this ResourceReader.
|
String |
getOrganization()
Returns the organization associated with the describable item.
|
List<String> |
getParameters() |
String |
getPassword() |
Integer |
getReceiveTimeout() |
boolean |
getShouldConvertToBBox()
Get the boolean flag that determines if point-radius and polygon geometries should be
converting to bounding boxes before sending.
|
Set<String> |
getSupportedSchemes()
|
String |
getTitle()
Returns the title of the describable item.
|
String |
getUsername() |
String |
getVersion()
Retrieve the version.
|
void |
init()
Called when this OpenSearch Source is created, but after all of the setter methods have been
called for each property specified in the metatype.xml file.
|
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. |
protected InputTransformer |
lookupTransformerReference(String namespaceUri) |
SourceResponse |
query(QueryRequest queryRequest) |
ResourceResponse |
retrieveResource(URI uri,
Map<String,Serializable> requestProperties)
|
void |
setAllowRedirects(Boolean allowRedirects) |
void |
setConfigurationPid(String configurationPid)
Sets the PID of this service's corresponding configuration
|
void |
setConnectionTimeout(Integer connectionTimeout) |
void |
setDisableCnCheck(Boolean disableCnCheck) |
void |
setEndpointUrl(String endpointUrl)
Set URL of the endpoint.
|
void |
setLocalQueryOnly(boolean localQueryOnly)
Sets the boolean flag that indicates all queries executed should be to its local source only,
i.e., no federated or enterprise queries.
|
void |
setMarkUpSet(List<String> markUpSet) |
protected boolean |
setOpenSearchParameters(QueryRequest queryRequest,
Subject subject,
org.apache.cxf.jaxrs.client.WebClient client) |
void |
setParameters(List<String> parameters) |
void |
setPassword(String password) |
void |
setReceiveTimeout(Integer receiveTimeout) |
void |
setResourceReader(ResourceReader reader) |
void |
setShortname(String shortname)
Sets the shortname for this site.
|
void |
setShouldConvertToBBox(boolean shouldConvertToBBox)
Sets the boolean flag that tells the code to convert point-radius and polygon geometries to a
bounding box before sending them.
|
void |
setUsername(String username) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetSecurityAttributesprotected SecureCxfClientFactory<OpenSearch> factory
public OpenSearchSource(FilterAdapter filterAdapter, OpenSearchParser openSearchParser, OpenSearchFilterVisitor openSearchFilterVisitor, EncryptionService encryptionService)
public OpenSearchSource(FilterAdapter filterAdapter, OpenSearchParser openSearchParser, OpenSearchFilterVisitor openSearchFilterVisitor, EncryptionService encryptionService, BiConsumer<List<org.jdom2.Element>,SourceResponse> foreignMarkupBiConsumer)
public void init()
protected SecureCxfClientFactory<OpenSearch> createClientFactory(String url, String username, String password)
public void destroy(int code)
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 Sourceprotected boolean setOpenSearchParameters(QueryRequest queryRequest, Subject subject, org.apache.cxf.jaxrs.client.WebClient client)
public String getEndpointUrl()
public void setEndpointUrl(String endpointUrl)
endpointUrl - Full url of the endpoint.public String getDescription()
DescribablegetDescription in interface Describablepublic String getOrganization()
DescribablegetOrganization in interface Describablepublic String getId()
Describablehtml for a MetacardTransformer that transforms Metacards to HTMLgetId in interface Describablepublic void setShortname(String shortname)
shortname - Name of this site.public String getTitle()
DescribablegetTitle in interface Describablepublic String getVersion()
DescribablegetVersion in interface Describableprotected InputTransformer lookupTransformerReference(String namespaceUri) throws org.osgi.framework.InvalidSyntaxException
org.osgi.framework.InvalidSyntaxExceptionpublic boolean getLocalQueryOnly()
public void setLocalQueryOnly(boolean localQueryOnly)
localQueryOnly - true indicates only local queries, false indicates enterprise querypublic boolean getShouldConvertToBBox()
public void setShouldConvertToBBox(boolean shouldConvertToBBox)
shouldConvertToBBox - public ResourceResponse retrieveResource(URI uri, Map<String,Serializable> requestProperties) throws ResourceNotFoundException, ResourceNotSupportedException, IOException
ResourceReaderretrieveResource in interface ResourceReaderuri - A URI that defines what Resource to retrieve and how to do it.requestProperties - Any additional arguments that should be passed to the ResourceReader.ResourceResponse containing the retrieved Resource.ResourceNotFoundExceptionResourceNotSupportedExceptionIOExceptionpublic 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 Set<String> getSupportedSchemes()
ResourceReaderURI schemes that the ResourceReader can accept when doing a Resource lookup. Custom schemes can be created for a ResourceReader to support.getSupportedSchemes in interface ResourceReaderSet of supported schemespublic Set<String> getOptions(Metacard metacard)
ResourceReaderResource in a unique way.getOptions in interface ResourceReaderSet of all options that this ResourceReader supports. This will be an empty set
if no options are supported.public String getConfigurationPid()
ConfiguredServicegetConfigurationPid in interface ConfiguredServicepublic void setConfigurationPid(String configurationPid)
ConfiguredServicesetConfigurationPid in interface ConfiguredServiceconfigurationPid - The unique PID of the configuration associated with this servicepublic String getUsername()
public void setUsername(String username)
public String getPassword()
public void setPassword(String password)
public Boolean getDisableCnCheck()
public void setDisableCnCheck(Boolean disableCnCheck)
public Boolean getAllowRedirects()
public void setAllowRedirects(Boolean allowRedirects)
public Integer getConnectionTimeout()
public void setConnectionTimeout(Integer connectionTimeout)
public Integer getReceiveTimeout()
public void setReceiveTimeout(Integer receiveTimeout)
public void setResourceReader(ResourceReader reader)
This work is licensed under a Creative Commons Attribution 4.0 International License.