Package com.attivio.client
Class AbstractSearchClient
- java.lang.Object
-
- com.attivio.client.AbstractSearchClient
-
- All Implemented Interfaces:
HasSecurityCredentials
,SearchClient
- Direct Known Subclasses:
LocalSearchClientImpl
,RemoteSearchClient
public abstract class AbstractSearchClient extends java.lang.Object implements SearchClient, HasSecurityCredentials
Client for querying Attivio AIE. Also handles sending schema requests. A single client can be created and held onto for the life of the application as there is no saved state and the client is thread safe. Multiple clients can be created for tracking purposes by client ID however there is no associated performance gain with having multiple clients.
-
-
Field Summary
-
Fields inherited from interface com.attivio.sdk.client.SearchClient
DEFAULT_SEARCH_WORKFLOW, ENDPOINT
-
-
Constructor Summary
Constructors Constructor Description AbstractSearchClient()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract java.lang.String
endpoint(PlatformMessage pm)
Determine the destination endpoint (local or remote) based on the messagejava.lang.String
getClientWorkflow()
Schema
getDefaultSchema()
Gets the schema named 'default' which is the most commonly one used throughout the system.SearchDocument
getDocumentById(java.lang.String documentId)
Gets a document by a specific document IdSchema
getSchema(java.lang.String schemaName)
Get a named schema in the system or null if it does not exist.protected abstract boolean
isSSL()
QueryResponse
search(QueryRequest query)
Sends the query to the Attivio search and returns the result.StreamingQueryResponse
search(StreamingQueryRequest req)
Sends the streaming query request to the Attivio search and returns the result.QueryResponse
search(java.lang.String query)
Searches using a query string only.void
setClientWorkflow(java.lang.String clientWorkflow)
Sets the default client workflow to use for this search client.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.attivio.client.HasSecurityCredentials
setConnectionCredentials
-
-
-
-
Method Detail
-
endpoint
public abstract java.lang.String endpoint(PlatformMessage pm)
Determine the destination endpoint (local or remote) based on the message
-
isSSL
protected abstract boolean isSSL()
-
getClientWorkflow
public java.lang.String getClientWorkflow()
-
setClientWorkflow
public void setClientWorkflow(java.lang.String clientWorkflow)
Description copied from interface:SearchClient
Sets the default client workflow to use for this search client.- Specified by:
setClientWorkflow
in interfaceSearchClient
- Parameters:
clientWorkflow
- the workflow name to use
-
search
public QueryResponse search(QueryRequest query) throws AttivioException
Sends the query to the Attivio search and returns the result.- Specified by:
search
in interfaceSearchClient
- Parameters:
query
- the query to send- Returns:
- query response
- Throws:
AttivioException
-
getDocumentById
public SearchDocument getDocumentById(java.lang.String documentId) throws AttivioException
Gets a document by a specific document Id- Specified by:
getDocumentById
in interfaceSearchClient
- Parameters:
documentId
- ID of the document that will be returned- Returns:
- document that was requested or null if does not exist.
- Throws:
AttivioException
-
search
public QueryResponse search(java.lang.String query) throws AttivioException
Searches using a query string only. The query is assumed to be in the simple Attivio query language.- Specified by:
search
in interfaceSearchClient
- Parameters:
query
- the query to use- Returns:
- the query response
- Throws:
AttivioException
-
getDefaultSchema
public Schema getDefaultSchema() throws AttivioException
Description copied from interface:SearchClient
Gets the schema named 'default' which is the most commonly one used throughout the system.- Specified by:
getDefaultSchema
in interfaceSearchClient
- Throws:
AttivioException
-
getSchema
public Schema getSchema(java.lang.String schemaName) throws AttivioException
Description copied from interface:SearchClient
Get a named schema in the system or null if it does not exist.- Specified by:
getSchema
in interfaceSearchClient
- Throws:
AttivioException
-
search
public StreamingQueryResponse search(StreamingQueryRequest req) throws AttivioException, java.io.IOException
Sends the streaming query request to the Attivio search and returns the result.- Specified by:
search
in interfaceSearchClient
- Parameters:
req
- the streaming query request to send- Returns:
- streaming query response
- Throws:
AttivioException
java.io.IOException
-
-