public class UploaderSink extends ContextualVehicleDataSink
| Constructor and Description |
|---|
UploaderSink(android.content.Context context,
java.lang.String path) |
UploaderSink(android.content.Context context,
java.net.URI uri)
Initialize and start a new UploaderSink immediately.
|
| Modifier and Type | Method and Description |
|---|---|
void |
receive(VehicleMessage message)
Receive a data point with a name, a value and a event value.
|
void |
stop()
Release any acquired resources and either stop sending measurements (if a
source) or stop expecting to receive them (if a sink).
|
java.lang.String |
toString() |
static boolean |
validatePath(java.lang.String path)
Returns true if the path is not null and if it is a valid URI.
|
getContextpublic UploaderSink(android.content.Context context,
java.net.URI uri)
uri - the URI to send HTTP POST requests to with the JSON data.public UploaderSink(android.content.Context context,
java.lang.String path)
throws DataSinkException
DataSinkExceptionpublic void stop()
VehicleDataSinkstop in interface VehicleDataSinkstop in class ContextualVehicleDataSinkpublic void receive(VehicleMessage message)
VehicleDataSinkreceive in interface VehicleDataSinkreceive in class ContextualVehicleDataSinkmessage - The new measurement.public static boolean validatePath(java.lang.String path)
path - a URI to validatepublic java.lang.String toString()
toString in class java.lang.Object