public class MockIngestApi extends Object implements com.attivio.service.IngestApi
IngestApi
that keeps a list of all messages sent to it. Messages may be retrieved with
getMessage(Class)
and the list may be reset with reset()
. If a MockIngestApi is in use via a standard
ContentFeeder
, you can get the mock api in use via ServiceFactory.getService(MockIngestApi.class)
.
The public member msgs
can also be accessed directly. Any test which is using msgs
to check test
conditions should call reset()
at the beginning of the test as the instance retrieved by the test may have
side-effects from previous tests.
This class simulates the processing of messages by posting CREATED and COMPLETED audit records for each documents. This allows
it to be used by a ContentFeeder. The getCompletionDelay()
field controls the number of milliseconds to delay the
posting of the COMPLETED audit record after the CREATED is posted. The completion delay is set to 0
whenever the
reset()
method is called.
Modifier and Type | Class and Description |
---|---|
static class |
MockIngestApi.MockAuditDetail |
Modifier and Type | Field and Description |
---|---|
ArrayList<PlatformMessage> |
msgs |
Constructor and Description |
---|
MockIngestApi() |
Modifier and Type | Method and Description |
---|---|
void |
feed(PlatformMessage msg) |
long |
getCompletionDelay() |
<T> T |
getMessage(Class<T> clazz)
Get the first message of the type
clazz |
List<PlatformMessage> |
getMessages() |
void |
reset() |
void |
setCompletionDelay(long completionDelay)
Sets the new delay.
|
public ArrayList<PlatformMessage> msgs
public MockIngestApi() throws AttivioException
AttivioException
public void feed(PlatformMessage msg) throws AttivioException
feed
in interface com.attivio.service.IngestApi
AttivioException
public <T> T getMessage(Class<T> clazz)
clazz
clazz
- public List<PlatformMessage> getMessages()
public void reset()
public long getCompletionDelay()
public void setCompletionDelay(long completionDelay)
reset()
is called.completionDelay
- 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.