|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gcube.opensearch.opensearchoperator.OpenSearchOp
public class OpenSearchOp
Operator class used to query and obtain results from an external OpenSearch provider identified by
an OpenSearchResource. An OpenSearch provider can be either direct or brokered. In the second case,
the top provider is used to obtain a list of providers which will provide the actual results. The
brokered providers are also described by their OpenSearchResource objects, which are automatically
retrieved using a ResourceRepository. The search results undergo a transformation step using a
suitable transformation specification that is contained as well in the OpenSearchResource.
The transformation allows the operator to split a search result page to individual records and
to transform these records to the desired schema, optionally adding an id field extracted from the data.
The query(String)
method returns an IProxyLocator identifying the ResultSet
which contains GenericRecords comprised of one or (optionally) two StringFields, with the first
containing the record content and the second containing the record id.
Constructor Summary | |
---|---|
OpenSearchOp(OpenSearchResource resource,
java.lang.String[] fixedParams,
gr.uoa.di.madgik.environment.hint.EnvHintCollection envHints)
Creates a new OpenSearchOp using the default configuration specified in OpenSearchOpConfig. |
|
OpenSearchOp(OpenSearchResource resource,
java.lang.String[] fixedParams,
OpenSearchOpConfig config,
gr.uoa.di.madgik.environment.hint.EnvHintCollection envHints)
Creates a new OpenSearchOp using the configuration specified in the respective argument. |
Method Summary | |
---|---|
static void |
main(java.lang.String[] args)
|
java.net.URI |
query(java.lang.String queryString)
Performs a query in order to obtain results from an OpenSearch provider |
void |
test(OpenSearchResource res)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OpenSearchOp(OpenSearchResource resource, java.lang.String[] fixedParams, gr.uoa.di.madgik.environment.hint.EnvHintCollection envHints) throws java.lang.Exception
resource
- The OpenSearch Resource identifying an OpenSearch provider and the transformations necessary to obtain the resultsfixedParams
- A set of pre-fixed OpenSearch parameters that override user parameters and are to be used while querying a broker.
The user parameters are used while querying the retrieved OpenSearch providers.envHints
- An Environment Hint collection to be passed to the InformationSystem, if it is available.
java.lang.Exception
- In case of errorpublic OpenSearchOp(OpenSearchResource resource, java.lang.String[] fixedParams, OpenSearchOpConfig config, gr.uoa.di.madgik.environment.hint.EnvHintCollection envHints) throws java.lang.Exception
resource
- The OpenSearch Resource identifying an OpenSearch provider and the transformations necessary to obtain the resultsfixedParams
- A set of pre-fixed OpenSearch parameters that override user parameters and are to be used while querying a broker.
The user parameters are used while querying the retrieved OpenSearch providers.config
- The configuration to be usedenvHints
- An Environment Hint collection to be passed to the InformationSystem, if it is available.
java.lang.Exception
- In case of errorMethod Detail |
---|
public java.net.URI query(java.lang.String queryString) throws java.lang.Exception
queryString
- The operator query, in the form of qualified OpenSearch parameter, value
pairs, where value should
be double-quoted.
The qualified OpenSearch parameters consist of the parameter names prefixed by their URl-encoded URI namespace.
The namespace prefix should also be present in the case of standard OpenSearch parameters such as searchTerms
.
Some configuration parameters of the operator are exposed through the query interface, namely sequentialResults and
numOfResults. In that case, their name should be prefixed by the config
prefix, e.g. config:numOfResults="100"
java.lang.Exception
- In case of error while creating an OpenSearchWorker
to handle the requestpublic static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
public void test(OpenSearchResource res) throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |