RepositoryDoc

public class RepositoryDoc extends Object
implements ApiOperation

Generic object for a single document in a repository.

This is a type of ApiOperation that performs an indexItem(Item, RequestMode) request. This single request can actually contain multiple requests if the data repository is hierarchical.

Sample usage:

Item item = ... // create an Item object
   ByteArrayContent content = ... // create item content, using HTML content for this example
   String contentHash = ... // optional content hash value
   RepositoryDoc.Builder builder = new RepositoryDoc.Builder()
       .setItem(item)
       .setContent(content, contentHash, ContentFormat.HTML)
       .setUpdateItemMode(RequestMode.SYNCHRONOUS);
   // if hierarchical, add children of this document
   List<String> childIds = ... // retrieve all child IDs
   for (childId : childIds) {
     PushItem pushItem = ... // populate a push item for this ID
     builder.addChildId(childId, pushItem);
   }
   RepositoryDoc document = builder.build();
   // now the document is ready for use, typically as a return value from a Repository method
 

Nested Class Summary

class RepositoryDoc.Builder  

Public Method Summary

boolean
equals(Object other)
List<GenericJson>
execute(IndexingService service)
Performs the indexing service request to index the document.
Map<String, PushItem>
AbstractInputStreamContent
getContent()
Gets the content of this repository document.
IndexingService.ContentFormat
String
getContentHash()
Gets the hash value of this repository document's content.
Map<String, Acl>
Item
getItem()
Gets the repository document converted into an Item.
IndexingService.RequestMode
int
String

Inherited Method Summary

Public Methods

public boolean equals (Object other)

Parameters
other

public List<GenericJson> execute (IndexingService service)

Performs the indexing service request to index the document.

In addition to updating the Item, the children (if any) are pushed and ACL fragments (possibly representing a directory in a hierarchical data repository) are created and updated.

Parameters
service the indexing service used to execute requests
Returns
  • results of the requests
Throws
IOException on SDK upload errors
InterruptedException on program interruption

public Map<String, PushItem> getChildIds ()

public AbstractInputStreamContent getContent ()

Gets the content of this repository document.

Returns
  • document content

public IndexingService.ContentFormat getContentFormat ()

public String getContentHash ()

Gets the hash value of this repository document's content.

Returns
  • document's content hash value

public Map<String, Acl> getFragments ()

public Item getItem ()

Gets the repository document converted into an Item.

Returns
  • a unique document ID

public IndexingService.RequestMode getRequestMode ()

public int hashCode ()

public String toString ()

Send feedback about...

Cloud Search
Cloud Search