org.gcube.opensearch.opensearchdatasource
Class OpenSearchDataSource
java.lang.Object
org.gcube.opensearch.opensearchdatasource.OpenSearchDataSource
public class OpenSearchDataSource
- extends java.lang.Object
OpenSearchDataSource implements the functionality needed to query the underlying OpenSearch providers using the OpenSearchOp
OpenSearch operator
Each OpenSearchDataSourceResource
of this stateful service handles a number of OpenSearch providers. Each provider is associated with
a collection and an OpenSearchResource
generic resource containing information for the provider.
A OpenSearchDataSourceResource
published a set field information, which specifies which search fields are searchable and presentable on a collection.
While querying, all generic resources and description documents retrieved are stored in a cache contained in each OpenSearchDataSourceResource
The cache can be refreshed either on demand or periodically, or through both ways to allow the service to update its state in the event of generic resource update
or modifications in the description documents of providers.
The cache purging time interval as well as whether the service should clear the cache on startup are configurable parameters
- Version:
- 1.2
- Author:
- Vassilis Verroios, NKUA, gerasimos.farantatos, NKUA
Constructor Summary |
OpenSearchDataSource()
Constructor - sets up some variables and creates a logging instance |
Method Summary |
AddProvidersResponse |
addProviders(AddProvidersParams req)
|
java.lang.String |
query(java.lang.String cqlQuery)
Performs a query on the OpenSearch provider associated with the WS resource used and described by the corresponding generic resource |
static void |
ready()
|
RefreshCacheResponse |
refreshCache(RefreshCache req)
Forced cache refresh operation |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
supportedRelations
public java.lang.String[] supportedRelations
OpenSearchDataSource
public OpenSearchDataSource()
throws java.rmi.RemoteException
- Constructor - sets up some variables and creates a logging instance
- Throws:
java.rmi.RemoteException
query
public java.lang.String query(java.lang.String cqlQuery)
throws java.rmi.RemoteException
- Performs a query on the OpenSearch provider associated with the WS resource used and described by the corresponding generic resource
- Parameters:
cqlQuery
- String
- the gCQL query to be translated a set of queries with the syntax of the OpenSearch operator -
space separated <(URLEncodedParameterNamespace|config):parameterName> strings)
- Returns:
String
- a gRS2 locator which holds the results of the query.
- Throws:
java.rmi.RemoteException
- In case of error
refreshCache
public RefreshCacheResponse refreshCache(RefreshCache req)
throws java.rmi.RemoteException
- Forced cache refresh operation
- Parameters:
req
- An empty RefreshCache
request
- Returns:
- An empty
RefreshCacheResponse
- Throws:
java.rmi.RemoteException
- In case of error- See Also:
CacheRefresher#forceRefresh()}
addProviders
public AddProvidersResponse addProviders(AddProvidersParams req)
throws java.rmi.RemoteException
- Throws:
java.rmi.RemoteException
ready
public static void ready()