public class JsonEdgePoster extends java.lang.Object implements ObservationPoster
This class does NOT implement the asynchronous transaction method doPostAsync. An asynchronous implementation is left to sub-classes.
ObservationPoster.PostCallback
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ACK_PROPERTY |
Constructor and Description |
---|
JsonEdgePoster(java.lang.String url,
java.lang.String uuid) |
JsonEdgePoster(java.lang.String url,
java.lang.String uuid,
int connectTimeout,
int readTimeout) |
Modifier and Type | Method and Description |
---|---|
void |
abortPostAsync()
Cancels any transaction currently in progress.
|
PostResult |
doPost(java.util.List<Observation> observations)
Performs a transaction sending observations to the edge.
|
void |
doPostAsync(java.util.List<Observation> observations,
ObservationPoster.PostCallback callback)
Not implemented in this class.
|
void |
doPostAsync(Observation observation,
ObservationPoster.PostCallback callback)
Not implemented in this class.
|
int |
getContentLimit()
Returns the maximum number of observations that can be sent
in one transaction.
|
void |
setContentLimit(int limit)
Set the (maximum) number of observations to send in one
transaction.
|
public static final java.lang.String ACK_PROPERTY
public JsonEdgePoster(java.lang.String url, java.lang.String uuid)
url
- edge URLuuid
- identifier of the posterpublic JsonEdgePoster(java.lang.String url, java.lang.String uuid, int connectTimeout, int readTimeout)
url
- edge URLuuid
- identifier of the posterconnectTimeout
- connection timeout for transactions (milliseconds), 0 for nonereadTimeout
- read timeout for transactions (milliseconds), 0 for nonepublic void setContentLimit(int limit)
ObservationPoster
setContentLimit
in interface ObservationPoster
public int getContentLimit()
ObservationPoster
getContentLimit
in interface ObservationPoster
public PostResult doPost(java.util.List<Observation> observations)
ObservationPoster
doPost
in interface ObservationPoster
observations
- objects to postpublic void doPostAsync(java.util.List<Observation> observations, ObservationPoster.PostCallback callback)
doPostAsync
in interface ObservationPoster
observations
- objects to postcallback
- called when the transaction is overjava.lang.UnsupportedOperationException
public void doPostAsync(Observation observation, ObservationPoster.PostCallback callback)
doPostAsync
in interface ObservationPoster
observation
- object to postcallback
- called when the transaction is overjava.lang.UnsupportedOperationException
public void abortPostAsync()
ObservationPoster
abortPostAsync
in interface ObservationPoster