-
Notifications
You must be signed in to change notification settings - Fork 2
ProbeBuilder
cketcham edited this page Jul 18, 2012
·
5 revisions
Probe builder class which makes it easy to create the probe response and send it. More information on how the json data should be structured can be found on the wiki
Constructor Summary | |
---|---|
ProbeBuilder()
|
|
ProbeBuilder(java.lang.String observerName,
int observerVersion)
|
Method Summary | |
---|---|
ProbeBuilder |
clear()
Clears everything associated with this probe. |
ProbeBuilder |
clearMetadata()
Clears all metadata for this probe. |
ProbeBuilder |
setData(java.lang.String data)
Set the probe data. |
ProbeBuilder |
setMetadata(java.lang.String metadata)
This should be a JSON object containing the metadata for this point. |
ProbeBuilder |
setObserver(java.lang.String observerId,
int observerVersion)
The unique ID for the observer and the number describing this observer's version. |
ProbeBuilder |
setStream(java.lang.String streamId,
int streamVersion)
The unique identifier for the stream to which this data applies and the version of this stream to which this data applies. |
ProbeBuilder |
setUploadPriority(int uploadPriority)
|
ProbeBuilder |
withId(java.lang.String id)
A UUID unique to this probe. |
ProbeBuilder |
withLocation(Location location,
java.lang.String timezone)
Location that this response was taken |
ProbeBuilder |
withLocation(long time,
java.lang.String timezone,
double latitude,
double longitude,
float accuracy,
java.lang.String provider)
Location that this response was taken |
ProbeBuilder |
withTime(long time,
java.lang.String timezone)
A long specifying the survey completion time by the number of milliseconds since the UNIX epoch and the timezone ID for the timezone of the device when this survey was taken. |
ProbeBuilder |
withTimestamp(java.lang.String timestamp)
The ISO8601-formatted date-time-timezone string. |
void |
write(ProbeWriter writer)
|
Constructor Detail |
---|
public ProbeBuilder()
public ProbeBuilder(java.lang.String observerName, int observerVersion)
Method Detail |
---|
public ProbeBuilder setObserver(java.lang.String observerId, int observerVersion)
- The unique ID for the observer and the number describing this observer's
version.
-
-
- Parameters:
-
observerId
- -
observerVersion
-
- Returns:
public ProbeBuilder setStream(java.lang.String streamId, int streamVersion)
- The unique identifier for the stream to which this data applies and the
version of this stream to which this data applies.
-
-
- Parameters:
-
streamId
- -
streamVersion
-
- Returns:
public ProbeBuilder setUploadPriority(int uploadPriority)
public ProbeBuilder setData(java.lang.String data)
- Set the probe data.
-
-
- Parameters:
-
data
- - Returns:
public ProbeBuilder setMetadata(java.lang.String metadata)
- This should be a JSON object containing the metadata for this point. This
field is optional. This field will be ignored on write if any other
metadata for this probe is supplied.
-
-
- Parameters:
-
metadata
- - Returns:
public ProbeBuilder withId(java.lang.String id)
- A UUID unique to this probe.
-
-
- Parameters:
-
id
- - Returns:
public ProbeBuilder withTimestamp(java.lang.String timestamp)
- The ISO8601-formatted date-time-timezone string. If this is not present,
then the time and timezone fields will be used.
-
-
- Parameters:
-
timestamp
- - Returns:
public ProbeBuilder withTime(long time, java.lang.String timezone)
- A long specifying the survey completion time by the number of
milliseconds since the UNIX epoch and the timezone ID for the timezone of
the device when this survey was taken.
-
-
- Parameters:
-
time
- -
timezone
-
- Returns:
public ProbeBuilder withLocation(Location location, java.lang.String timezone)
- Location that this response was taken
-
-
- Parameters:
-
location
- -
timezone
-
- Returns:
public ProbeBuilder withLocation(long time, java.lang.String timezone, double latitude, double longitude, float accuracy, java.lang.String provider)
- Location that this response was taken
-
-
- Parameters:
-
time
- -
timezone
- -
latitude
- -
longitude
- -
accuracy
- -
provider
-
- Returns:
public ProbeBuilder clearMetadata()
- Clears all metadata for this probe. Any other data will remain.
-
-
- Returns:
public ProbeBuilder clear()
- Clears everything associated with this probe.
-
-
- Returns:
public void write(ProbeWriter writer) throws RemoteException
RemoteException