public class JTelemetry.Payload
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
addData(java.lang.String key,
boolean data)
Adds a piece of data to this
JTelemetry.Payload in the form of a boolean
(1-bit integer). |
void |
addData(java.lang.String key,
byte... data)
Adds raw data to this
JTelemetry.Payload in the form of a byte array. |
void |
addData(java.lang.String key,
byte data)
Adds a piece of data to this
JTelemetry.Payload in the form of a boolean
(1-bit integer). |
void |
addData(java.lang.String key,
double data)
Adds a piece of data to this
JTelemetry.Payload in the form of an IEEE
double-precision floating point number. |
void |
addData(java.lang.String key,
float data)
Adds a piece of data to this
JTelemetry.Payload in the form of an IEEE
floating-point number. |
void |
addData(java.lang.String key,
int data)
Adds a piece of data to this
JTelemetry.Payload in the form of a 32-bit
signed integer. |
void |
addData(java.lang.String key,
int[] data)
Adds a piece of data to this
JTelemetry.Payload in the form of a 32-bit
integer array. |
void |
addData(java.lang.String key,
long data)
Adds a piece of data to this
JTelemetry.Payload in the form of a long
(64-bit) signed integer. |
void |
addData(java.lang.String key,
short data)
Adds a piece of data to this
JTelemetry.Payload in the form of a short
(16-bit) signed integer. |
void |
addData(java.lang.String key,
java.lang.String data)
Adds a piece of data to this
JTelemetry.Payload in the form of a string. |
void |
addData(java.lang.String key,
java.lang.String[] data)
Adds a piece of data to this
JTelemetry.Payload in the form of a string
array. |
JTelemetry |
getParent()
Returns the parent
JTelemetry of this JTelemetry.Payload . |
JTelemetry.HttpResponse |
submit()
Attempts to submit this payload to the address defined by the parent
JTelemetry . |
public JTelemetry getParent()
JTelemetry
of this JTelemetry.Payload
.JTelemetry
of this JTelemetry.Payload
public JTelemetry.HttpResponse submit() throws java.io.IOException
JTelemetry
.
The server will respond with a 2xx
response code upon the
request being accepted. Additionally, it may return a non-success
response code:
413
- If the payload exceeds the size limit defined
by the server (usually 32 KB)501
- If the server does not support the protocol
version specified by the client (this usually denotes an outdated
server)HTTP response
returned by
the serverjava.io.IOException
- If an exception occurs while sending a request to
the remote serverpublic void addData(java.lang.String key, boolean data) throws java.lang.IllegalArgumentException
JTelemetry.Payload
in the form of a boolean
(1-bit integer).key
- The key to assign to the datadata
- The content of the datajava.lang.IllegalArgumentException
- If this payload already contains
a data entry with the given key, or if the key is null
public void addData(java.lang.String key, byte data) throws java.lang.IllegalArgumentException
JTelemetry.Payload
in the form of a boolean
(1-bit integer).key
- The key to assign to the datadata
- The content of the datajava.lang.IllegalArgumentException
- If this payload already contains
a data entry with the given key, or if the key is null
public void addData(java.lang.String key, short data) throws java.lang.IllegalArgumentException
JTelemetry.Payload
in the form of a short
(16-bit) signed integer.key
- The key to assign to the datadata
- The content of the datajava.lang.IllegalArgumentException
- If this payload already contains
a data entry with the given key, or if the key is null
public void addData(java.lang.String key, int data) throws java.lang.IllegalArgumentException
JTelemetry.Payload
in the form of a 32-bit
signed integer.key
- The key to assign to the datadata
- The content of the datajava.lang.IllegalArgumentException
- If this payload already contains
a data entry with the given key, or if the key is null
public void addData(java.lang.String key, long data) throws java.lang.IllegalArgumentException
JTelemetry.Payload
in the form of a long
(64-bit) signed integer.key
- The key to assign to the datadata
- The content of the datajava.lang.IllegalArgumentException
- If this payload already contains
a data entry with the given key, or if the key is null
public void addData(java.lang.String key, float data) throws java.lang.IllegalArgumentException
JTelemetry.Payload
in the form of an IEEE
floating-point number.key
- The key to assign to the datadata
- The content of the datajava.lang.IllegalArgumentException
- If this payload already contains
a data entry with the given key, or if the key is null
public void addData(java.lang.String key, double data) throws java.lang.IllegalArgumentException
JTelemetry.Payload
in the form of an IEEE
double-precision floating point number.key
- The key to assign to the datadata
- The content of the datajava.lang.IllegalArgumentException
- If this payload already contains
a data entry with the given key, or if the key is null
public void addData(java.lang.String key, java.lang.String data) throws java.lang.IllegalArgumentException
JTelemetry.Payload
in the form of a string.key
- The key to assign to the datadata
- The content of the datajava.lang.IllegalArgumentException
- If this payload already contains
a data entry with the given key, or if the key is null
public void addData(java.lang.String key, byte... data) throws java.lang.IllegalArgumentException
JTelemetry.Payload
in the form of a byte array.key
- The key to assign to the datadata
- The content of the datajava.lang.IllegalArgumentException
- If this payload already contains
a data entry with the given key, or if the key or data is
null
public void addData(java.lang.String key, int[] data) throws java.lang.IllegalArgumentException
JTelemetry.Payload
in the form of a 32-bit
integer array.key
- The key to assign to the datadata
- The content of the datajava.lang.IllegalArgumentException
- If this payload already contains
a data entry with the given key, or if the key or data is
null
public void addData(java.lang.String key, java.lang.String[] data) throws java.lang.IllegalArgumentException
JTelemetry.Payload
in the form of a string
array.key
- The key to assign to the datadata
- The content of the datajava.lang.IllegalArgumentException
- If this payload already contains
a data entry with the given key, or if the key, data, or any
element of the data array is null