Skip navigation links

Package com.attivio.sdk.client

Interfaces for client side AIE development.

See: Description

Package com.attivio.sdk.client Description

Interfaces for client side AIE development. The ServiceFactory can be used to create all clients represented here using various host+port/uri combinations.

Example Ingestion Code

 System.setProperty("AIE_ZOOKEEPER", "myHost:17001");
 * IngestClient feeder = ServiceFactory.getService(IngestClient.class);
 IngestDocument doc1 = new IngestDocument("myId-1");
 doc1.setField("title", "my title");
 feeder.feed(doc1);
 // feed more documents
 feeder.commit();
 // wait for the commit to complete
 feeder.waitForCompletion();
 

Example Search Code

 System.setProperty("AIE_ZOOKEEPER", "myHost:17001");
 SearchClient searcher = ServiceFactory.getService(SearchClient.class);
 QueryRequest req = new QueryRequest("foo");
 req.addFacetField("myFacetField");
 // set more query parameters
 QueryResponse resp = searcher.search(req);
 // output response information
 

Example Content Store Code

 System.setProperty("AIE_ZOOKEEPER", "myHost:17001");
 ContentStoreClient contentStore = ServiceFactory.getService(ContentStoreClient.class);
 
 // Create an object which can produce an input stream with relevant content (any useful bytes - like an image file) 
 InputStreamBuilder contentSource = new InputStreamBuilder()
                                                   {
                                                       private final FileInputStream fis = new FileInputStream("some_image.png");
                                                                       
                                                       @Override
                                                       InputStream createInputStream() throws IOException {
                                                         return fis;
                                                       }
                                                                       
                                                       @Override
                                                       void close() throws IOException {                                                                         
                                                         if (fis != null) {
                                                           fis.close();
                                                          }                                                                       
                                                       }                                                                       
                                                    };
 // Store the content in the content store and get back a content pointer                                                                  
 ContentPointer cp = contentStore.store("my_content_id", contentSource);
 
 // do something with the content pointer, like store it in a document
 IngestDocument doc = new IngestDocument("my_doc_id");
 IngestField imageField = new IngestField("image");
 imageField.addFieldValue(cp);
 doc.setField(imageField);
 

Example Connector Code

 System.setProperty("AIE_ZOOKEEPER", "myHost:17001");
 ConnectorControlApi connectorClient = ServiceFactory.getService(ConnectorControlApi.class);
 
 // start the connector named "myCustomConnector" 
 connectorClient.start("myCustomConnector");
 
Copyright 2017 Attivio Inc., All rights reserved.
Skip navigation links

Copyright © 2018 Attivio, Inc. All Rights Reserved.

PATENT NOTICE: Attivio, Inc. Software Related Patents. With respect to the Attivio software product(s) being used, the following patents apply: Querying Joined Data Within A Search Engine Index: United States Patent No.(s): 8,073,840. Ordered Processing of Groups of Messages: U.S. Patent No.(s) 8,495,656. Signal processing approach to sentiment analysis for entities in documents: U.S. Patent No.(s) 8,725,494. Other U.S. and International Patents Pending.