Wrapper object for CloudSearch.Indexing.
This is the access point between the connector developer and the indexing service. All calls
for updating and retrieving CloudSearch.Indexing.Datasources.Items objects are
processed through this object.
Configuration parameters:
.ROOT_URL- Specifies the indexing service base URL path..SOURCE_ID- Specifies the data source ID (created via the admin console) indicating the location for the ingested repository documents..IDENTITY_SOURCE_ID- Specifies the identity source ID (created via the admin console) to use for users and groups that are attached to ACL definitions..CONNECTOR_ID- Specifies the connector identifier for making Indexing API.UPLOAD_THRESHOLD_BYTES- Specifies the threshold for content, in number of bytes, that determines whether it is uploaded "in-line" with the other document info or using a separate upload..INDEXING_SERVICE_REQUEST_MODE- Specifies the default request mode for index and delete item requests
Nested Class Summary
| class | IndexingServiceImpl.Builder | ||
| enum | IndexingServiceImpl.Operations | API Operations | |
| enum | IndexingServiceImpl.PollItemStatus | Valid values for poll Item status. |
|
| class | IndexingServiceImpl.ServiceManagerHelper | ||
Constant Summary
| String | ALLOW_UNKNOWN_GSUITE_PRINCIPALS | |
| String | CONNECTOR_ID | |
| int | DEFAULT_CONTENT_UPLOAD_THRESHOLD_BYTES | |
| String | ENABLE_API_DEBUGGING | |
| String | IDENTITY_SOURCE_ID | |
| String | INDEXING_SERVICE_REQUEST_MODE | |
| String | REQUEST_CONNECT_TIMEOUT | |
| String | REQUEST_READ_TIMEOUT | |
| String | ROOT_URL | |
| String | SOURCE_ID | |
| String | UPLOAD_THRESHOLD_BYTES |
Field Summary
| public static final Set<String> | API_SCOPES |
Public Method Summary
| ListenableFuture<Operation> | |
| ListenableFuture<Operation> |
deleteQueueItems(String queueName)
Deletes items from a queue.
|
| Item | |
| Operation |
getOperation(String name)
Returns the
Operation with the given name. |
| Schema | |
| ListenableFuture<Operation> | |
| ListenableFuture<Operation> |
indexItemAndContent(Item item, AbstractInputStreamContent content, String contentHash, IndexingService.ContentFormat contentFormat, IndexingService.RequestMode requestMode)
Updates an
Item. |
| Iterable<Item> | |
| List<Item> |
poll(PollItemsRequest pollQueueRequest)
Polls the queue using custom API parameters.
|
| Iterable<Item> |
pollAll(PollItemsRequest pollQueueRequest)
Polls the queue repeatedly until the entire queue is polled.
|
| ListenableFuture<Item> | |
| UploadItemRef |
startUpload(String itemId)
Creates
UploadItemRef for uploading media content. |
| ListenableFuture<Operation> |
Inherited Method Summary
Constants
public static final String ALLOW_UNKNOWN_GSUITE_PRINCIPALS
public static final String CONNECTOR_ID
public static final int DEFAULT_CONTENT_UPLOAD_THRESHOLD_BYTES
public static final String ENABLE_API_DEBUGGING
public static final String IDENTITY_SOURCE_ID
public static final String INDEXING_SERVICE_REQUEST_MODE
public static final String REQUEST_CONNECT_TIMEOUT
public static final String REQUEST_READ_TIMEOUT
public static final String ROOT_URL
public static final String SOURCE_ID
public static final String UPLOAD_THRESHOLD_BYTES
Fields
public static final Set<String> API_SCOPES
Public Methods
public ListenableFuture<Operation> deleteItem (String id, byte[] version, IndexingService.RequestMode requestMode)
Deletes an Item.
Cloud Search won't delete an item if the passed version value is less than the currently indexed item's version.
Parameters
| id | the item id. |
|---|---|
| version | the item's version used to compare against the previously indexed item's version |
| requestMode | mode for delete request |
Returns
ListenableFuturethat the caller uses to obtain the result of a delete operation (usingget()).
Throws
| IOException | when service throws an exception. |
|---|
public ListenableFuture<Operation> deleteQueueItems (String queueName)
Deletes items from a queue.
Parameters
| queueName | the queue name |
|---|
Returns
ListenableFuturethat the caller uses to obtain the result of a delete queue items operation (usingget()).
Throws
| IOException | when the service throws an exception |
|---|
public Item getItem (String id)
Gets an Item.
Parameters
| id | the item ID |
|---|
Returns
- the item or
nullif not found
Throws
| IOException | when the service throws an exception |
|---|
public Operation getOperation (String name)
Returns the Operation with the given name.
Parameters
| name | the operation name |
|---|
Returns
- the Operation object describing the current state of the long-running operation
Throws
| IOException |
|---|
public Schema getSchema ()
public ListenableFuture<Operation> indexItem (Item item, IndexingService.RequestMode requestMode)
Updates an Item.
Parameters
| item | the item to update |
|---|---|
| requestMode | the IndexingService.RequestMode for the request |
Returns
ListenableFuture. Caller can useget()to obtain a result of an update operation
Throws
| IOException | when the service throws an exception |
|---|
public ListenableFuture<Operation> indexItemAndContent (Item item, AbstractInputStreamContent content, String contentHash, IndexingService.ContentFormat contentFormat, IndexingService.RequestMode requestMode)
Updates an Item.
The content parameter should use a concrete implementation of AbstractInputStreamContent based on the natural source object:
- For
InputStream, useInputStreamContent. For best results, if the length of the content (in bytes) is known without reading the stream, callsetLengthon theInputStreamContent. - For
Stringorbyte[], useByteArrayContent. - For existing files, use
FileContent.
Parameters
| item | the item to update |
|---|---|
| content | the item's content |
| contentHash | the hash of the item's content |
| contentFormat | format of the content |
| requestMode | the IndexingService.RequestMode for the request |
Returns
ListenableFuture. Caller can useget()to obtain the result of an update operation
Throws
| IOException | when the service throws an exception |
|---|
public Iterable<Item> listItem (boolean brief)
public List<Item> poll (PollItemsRequest pollQueueRequest)
Polls the queue using custom API parameters.
Parameters
| pollQueueRequest | the user created and populated poll request |
|---|
Returns
- entries returned from the queue
Throws
| IOException | when the service throws an exception |
|---|
public Iterable<Item> pollAll (PollItemsRequest pollQueueRequest)
Polls the queue repeatedly until the entire queue is polled.
Parameters
| pollQueueRequest | the user created and populated poll request |
|---|
Returns
- an iterator for entries returned from the queue
Throws
| IOException | when the service throws an exception |
|---|
public ListenableFuture<Item> push (String id, PushItem pushItem)
Pushes a PushItem object to the indexing API Queue.
Parameters
| id | the item id |
|---|---|
| pushItem | the item to push |
Returns
ListenableFuture. Caller can useget()to obtain the result of a push operation
Throws
| IOException | when the service throws an exception |
|---|
public UploadItemRef startUpload (String itemId)
Creates UploadItemRef for uploading media content.
Parameters
| itemId | for which upload reference to be created. |
|---|
Returns
UploadItemReffor uploading media content
Throws
| IOException |
|---|
public ListenableFuture<Operation> unreserve (String queue)
Unreserves the polled Item objects in a specific queue.
Parameters
| queue | the queue to unreserve (null for the default queue) |
|---|
Returns
ListenableFuture. Caller can useget()to obtain the result of an unreserve operation
Throws
| IOException | when the service throws an exception |
|---|