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.Stringendpoint(PlatformMessage pm)Determine the destination endpoint (local or remote) based on the messagejava.lang.StringgetClientWorkflow()SchemagetDefaultSchema()Gets the schema named 'default' which is the most commonly one used throughout the system.SearchDocumentgetDocumentById(java.lang.String documentId)Gets a document by a specific document IdSchemagetSchema(java.lang.String schemaName)Get a named schema in the system or null if it does not exist.protected abstract booleanisSSL()QueryResponsesearch(QueryRequest query)Sends the query to the Attivio search and returns the result.StreamingQueryResponsesearch(StreamingQueryRequest req)Sends the streaming query request to the Attivio search and returns the result.QueryResponsesearch(java.lang.String query)Searches using a query string only.voidsetClientWorkflow(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:SearchClientSets the default client workflow to use for this search client.- Specified by:
setClientWorkflowin 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:
searchin 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:
getDocumentByIdin 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:
searchin interfaceSearchClient- Parameters:
query- the query to use- Returns:
- the query response
- Throws:
AttivioException
-
getDefaultSchema
public Schema getDefaultSchema() throws AttivioException
Description copied from interface:SearchClientGets the schema named 'default' which is the most commonly one used throughout the system.- Specified by:
getDefaultSchemain interfaceSearchClient- Throws:
AttivioException
-
getSchema
public Schema getSchema(java.lang.String schemaName) throws AttivioException
Description copied from interface:SearchClientGet a named schema in the system or null if it does not exist.- Specified by:
getSchemain 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:
searchin interfaceSearchClient- Parameters:
req- the streaming query request to send- Returns:
- streaming query response
- Throws:
AttivioExceptionjava.io.IOException
-
-