ItemRetriever
Stay organized with collections
Save and categorize content based on your preferences.
Known Indirect Subclasses
ListingConnector |
Template connector that performs complete repository list traversals. |
|
Public Method Summary
abstract
void
|
process(Item item)
Retrieves content and metadata for the polled Item .
|
Public Methods
public
abstract
void
process
(Item item)
Retrieves content and metadata for the polled Item
.
This method should provide the document's content, structured data, and metadata. The item's
getHash()
, getHash()
, and/or
getHash()
may be provided to allow the Cloud Search queue to automatically
track document changes during the next traversal.
If the connector implements a graph traversal strategy to navigate a hierarchical
repository, this method should also push PushItem
objects for any child documents when
the item is a repository container.
This method should be highly parallelizable and support ten or more concurrent calls.
Parameters
item |
Item object representing the document being sought |
Throws
IOException |
on errors retrieving the document's data, typically a
RepositoryException |
InterruptedException |
on IO operation errors
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-03-18 UTC.
[null,null,["Last updated 2025-03-18 UTC."],[],[],null,["# ItemRetriever\n\npublic interface **ItemRetriever** \n\n|---|---|---|\n| Known Indirect Subclasses [ListingConnector](/workspace/cloud-search/docs/reference/sdk/com/google/enterprise/cloudsearch/sdk/indexing/template/ListingConnector) |-----------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------| | [ListingConnector](/workspace/cloud-search/docs/reference/sdk/com/google/enterprise/cloudsearch/sdk/indexing/template/ListingConnector) | Template connector that performs complete repository list traversals. | |||\n\nConnector specific implementation for handling [Item](https://developers.google.com/resources/api-libraries/documentation/cloudsearch/v1/java/latest/com/google/api/services/cloudsearch/v1/model/Item.html) from [PollItemsResponse](https://developers.google.com/resources/api-libraries/documentation/cloudsearch/v1/java/latest/com/google/api/services/cloudsearch/v1/model/PollItemsResponse.html).\n\nThis interface is used by connectors implementing a listing traversal strategy, including the\ntemplate connector\n[ListingConnector](/workspace/cloud-search/docs/reference/sdk/com/google/enterprise/cloudsearch/sdk/indexing/template/ListingConnector).\n\nDuring [init(T)](/workspace/cloud-search/docs/reference/sdk/com/google/enterprise/cloudsearch/sdk/Connector#init(T)), the listing connector typically registers one or more\n[ItemRetriever](/workspace/cloud-search/docs/reference/sdk/com/google/enterprise/cloudsearch/sdk/indexing/ItemRetriever) instances using [registerTraverser(TraverserConfiguration)](/workspace/cloud-search/docs/reference/sdk/com/google/enterprise/cloudsearch/sdk/indexing/IndexingConnectorContext#registerTraverser(com.google.enterprise.cloudsearch.sdk.indexing.traverser.TraverserConfiguration)). After\n[init(T)](/workspace/cloud-search/docs/reference/sdk/com/google/enterprise/cloudsearch/sdk/Connector#init(T)) is executed, the SDK initializes worker threads to handle polled items. \n\n### Public Method Summary\n\n|---------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract void | [process](/workspace/cloud-search/docs/reference/sdk/com/google/enterprise/cloudsearch/sdk/indexing/ItemRetriever#process(com.google.api.services.cloudsearch.v1.model.Item))(Item item) Retrieves content and metadata for the polled [Item](https://developers.google.com/resources/api-libraries/documentation/cloudsearch/v1/java/latest/com/google/api/services/cloudsearch/v1/model/Item.html). |\n\nPublic Methods\n--------------\n\n#### public abstract void\n**process**\n(Item item)\n\nRetrieves content and metadata for the polled [Item](https://developers.google.com/resources/api-libraries/documentation/cloudsearch/v1/java/latest/com/google/api/services/cloudsearch/v1/model/Item.html).\n\nThis method should provide the document's content, structured data, and metadata. The item's\n[getHash()](https://developers.google.com/resources/api-libraries/documentation/cloudsearch/v1/java/latest/com/google/api/services/cloudsearch/v1/model/ItemContent.html#getHash()), [getHash()](https://developers.google.com/resources/api-libraries/documentation/cloudsearch/v1/java/latest/com/google/api/services/cloudsearch/v1/model/ItemStructuredData.html#getHash()), and/or\n[getHash()](https://developers.google.com/resources/api-libraries/documentation/cloudsearch/v1/java/latest/com/google/api/services/cloudsearch/v1/model/ItemMetadata.html#getHash()) may be provided to allow the Cloud Search queue to automatically\ntrack document changes during the next traversal.\n\nIf the connector implements a graph traversal strategy to navigate a hierarchical\nrepository, this method should also push [PushItem](https://developers.google.com/resources/api-libraries/documentation/cloudsearch/v1/java/latest/com/google/api/services/cloudsearch/v1/model/PushItem.html) objects for any child documents when\nthe item is a repository container.\n\nThis method should be highly parallelizable and support ten or more concurrent calls. \n\n##### Parameters\n\n| item | [Item](https://developers.google.com/resources/api-libraries/documentation/cloudsearch/v1/java/latest/com/google/api/services/cloudsearch/v1/model/Item.html) object representing the document being sought |\n|------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n\n##### Throws\n\n| IOException | on errors retrieving the document's data, typically a [RepositoryException](/workspace/cloud-search/docs/reference/sdk/com/google/enterprise/cloudsearch/sdk/RepositoryException) |\n| InterruptedException | on IO operation errors |\n|----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|"]]