public class Discovery extends WatsonService implements EnvironmentManager, ConfigurationManager, CollectionManager, DocumentManager, QueryManager
defaultHeaders, MESSAGE_CODE, MESSAGE_ERROR, skipAuthentication, VERSION
CREATED, DESCRIPTION, DISK_USAGE, ENVIRONMENTS, ID, INDEX_CAPACITY, MEMORY_USAGE, NAME, PERCENT_USED, READ_ONLY, SIZE, STATUS, TOTAL, TOTAL_BYTES, UPDATED, USED, USED_BYTES
BOLD, CONFIGURATION, CONFIGURATIONS, CONVERSIONS, CREATED, DESCRIPTION, DESTINATION_FIELD, ENRICHMENT, ENRICHMENTS, EXCLUDE_CONTENT, EXCLUDE_TAG_ATTRIBUTES, EXCLUDE_TAGS_COMPLETELY, EXCLUDE_TAGS_KEEP_CONTENT, FIELD, FONT_NAME, FONT_SETTINGS, FONT_STYLES, HEADING, HTML, ID, ITALIC, JSON, KEEP_CONTENT, KEEP_TAG_ATTRIBUTES, LEVEL, MAX_SIZE, MIN_SIZE, NAME, NAMES, NORMALIZATIONS, OPERATION, OPTIONS, OVERWRITE, PDF, SOURCE_FIELD, STATUS, TYPE, UPDATED, WORD, XPATHS
AVAILABLE, COLLECTIONS, CONFIGURATION_ID, CREATED, DESCRIPTION, DOCUMENT_COUNTS, FAILED, FIELD, FIELDS, ID, LANGUAGE, NAME, PROCESSING, STATUS, TYPE, UPDATED
CONFIGURATION_ID, CREATED, FILE, ID, METADATA, STATUS, STATUS_DESCRIPTION, UPDATED
AGGREGATION, AGGREGATION_ID, AGGREGATIONS, COUNT, COUNT_PARAM, FIELD, FILTER, ID, INTERNAL_ID, INTERVAL, KEY, LOGIC, MATCHING_RESULTS, OFFSET, QUERY, RESULTS, RETURN, SCORE, TYPE, VALUE
Constructor and Description |
---|
Discovery(java.lang.String versionDate)
Instantiates a new Discovery service.
|
configureHttpClient, createServiceCall, getApiKey, getEndPoint, getName, getToken, processServiceCall, setApiKey, setAuthentication, setDefaultHeaders, setEndPoint, setSkipAuthentication, setUsernameAndPassword, toString
public Discovery(java.lang.String versionDate)
versionDate
- the version datepublic static java.lang.String cleanFieldName(java.lang.String fieldName)
fieldName
- the field name to escapepublic static java.lang.String escapeControlChracters(java.lang.String value)
value
- the value that potentially contains control characterspublic boolean ping() throws java.lang.RuntimeException
java.lang.RuntimeException
- if the service is unreachablepublic ServiceCall<GetEnvironmentsResponse> getEnvironments(GetEnvironmentsRequest getRequest)
EnvironmentManager
getEnvironments
in interface EnvironmentManager
getRequest
- options for getting the environmentsGetEnvironmentsResponse
containing result of the GetEnvironmentsRequest
public ServiceCall<GetEnvironmentResponse> getEnvironment(GetEnvironmentRequest getRequest)
EnvironmentManager
getEnvironment
in interface EnvironmentManager
getRequest
- options for getting the environmentGetEnvironmentResponse
containing the result of the GetEnvironmentRequest
public ServiceCall<CreateEnvironmentResponse> createEnvironment(CreateEnvironmentRequest createRequest)
EnvironmentManager
createEnvironment
in interface EnvironmentManager
createRequest
- options for creating the environmentCreateEnvironmentResponse
containing the result of the CreateEnvironmentRequest
public ServiceCall<DeleteEnvironmentResponse> deleteEnvironment(DeleteEnvironmentRequest deleteRequest)
EnvironmentManager
deleteEnvironment
in interface EnvironmentManager
deleteRequest
- options for deleting the environmentDeleteEnvironmentResponse
containing the result of the DeleteEnvironmentRequest
public ServiceCall<UpdateEnvironmentResponse> updateEnvironment(UpdateEnvironmentRequest updateRequest)
EnvironmentManager
updateEnvironment
in interface EnvironmentManager
updateRequest
- options for deleting the environmentUpdateEnvironmentResponse
containing the result of the UpdateEnvironmentRequest
public ServiceCall<GetConfigurationsResponse> getConfigurations(GetConfigurationsRequest getRequest)
ConfigurationManager
getConfigurations
in interface ConfigurationManager
getRequest
- options for getting the configurationsGetConfigurationsResponse
containing result of the GetConfigurationsRequest
public ServiceCall<GetConfigurationResponse> getConfiguration(GetConfigurationRequest getRequest)
ConfigurationManager
getConfiguration
in interface ConfigurationManager
getRequest
- options for getting the configurationGetConfigurationResponse
containing result of the GetConfigurationRequest
public ServiceCall<CreateConfigurationResponse> createConfiguration(CreateConfigurationRequest createRequest)
ConfigurationManager
createConfiguration
in interface ConfigurationManager
createRequest
- options for creating the configurationCreateConfigurationResponse
containing the result of the CreateConfigurationRequest
public ServiceCall<DeleteConfigurationResponse> deleteConfiguration(DeleteConfigurationRequest deleteRequest)
ConfigurationManager
deleteConfiguration
in interface ConfigurationManager
deleteRequest
- options for deleting the configurationDeleteConfigurationResponse
containing the result of the DeleteConfigurationRequest
public ServiceCall<UpdateConfigurationResponse> updateConfiguration(UpdateConfigurationRequest updateRequest)
ConfigurationManager
updateConfiguration
in interface ConfigurationManager
updateRequest
- options for updating the configurationUpdateConfigurationResponse
containing the result of the UpdateConfigurationRequest
public ServiceCall<GetCollectionsResponse> getCollections(GetCollectionsRequest getRequest)
CollectionManager
Collection
. An optional parameter of name can be provided to filter by name.getCollections
in interface CollectionManager
getRequest
- options for getting the Collection
sGetCollectionsResponse
containing the result of GetCollectionsRequest
public ServiceCall<GetCollectionResponse> getCollection(GetCollectionRequest getRequest)
CollectionManager
Collection
.getCollection
in interface CollectionManager
getRequest
- options for getting the Collection
GetCollectionResponse
containing the result of GetCollectionRequest
public ServiceCall<CreateCollectionResponse> createCollection(CreateCollectionRequest createRequest)
CollectionManager
Collection
.createCollection
in interface CollectionManager
createRequest
- options for creating a Collection
CreateCollectionResponse
containing the result of CreateCollectionRequest
public ServiceCall<DeleteCollectionResponse> deleteCollection(DeleteCollectionRequest deleteRequest)
CollectionManager
Collection
.deleteCollection
in interface CollectionManager
deleteRequest
- options for deleting a Collection
DeleteCollectionResponse
containing the result of DeleteCollectionRequest
public ServiceCall<GetCollectionFieldsResponse> getCollectionFields(GetCollectionFieldsRequest getRequest)
CollectionManager
Field
s from a Collection
.getCollectionFields
in interface CollectionManager
getRequest
- options for getting a unique fields from a Collection
GetCollectionFieldsResponse
containing the result of GetCollectionFieldsRequest
public ServiceCall<GetDocumentResponse> getDocument(GetDocumentRequest getRequest)
DocumentManager
Document
.getDocument
in interface DocumentManager
getRequest
- options for getting a Document
GetDocumentResponse
containing the details of GetDocumentRequest
public ServiceCall<CreateDocumentResponse> createDocument(CreateDocumentRequest createRequest)
DocumentManager
createDocument
in interface DocumentManager
createRequest
- options for creating a Document
CreateDocumentResponse
containing the details of CreateDocumentRequest
public ServiceCall<DeleteDocumentResponse> deleteDocument(DeleteDocumentRequest deleteRequest)
DocumentManager
Document
.deleteDocument
in interface DocumentManager
deleteRequest
- options for deleting a Document
DeleteDocumentResponse
containing the details of DeleteDocumentRequest
public ServiceCall<UpdateDocumentResponse> updateDocument(UpdateDocumentRequest updateRequest)
DocumentManager
updateDocument
in interface DocumentManager
updateRequest
- options for updating a Document
UpdateDocumentResponse
containing the details of UpdateDocumentRequest
public ServiceCall<QueryResponse> query(QueryRequest queryRequest)
QueryManager
query
in interface QueryManager
queryRequest
- options for the queryQueryResponse
containing the details from the QueryRequest