public abstract class BaseTelemetry<T extends Domain> extends java.lang.Object implements Telemetry
Modifier | Constructor and Description |
---|---|
protected |
BaseTelemetry() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
additionalSanitize()
Deprecated.
|
protected java.lang.String |
getBaseTypeName() |
TelemetryContext |
getContext()
Gets the context associated with the current telemetry item.
|
protected abstract T |
getData()
Concrete classes should implement this method which supplies the
data structure that this instance works with, which needs to implement
JsonSerializable |
protected java.lang.String |
getEnvelopName() |
java.util.Map<java.lang.String,java.lang.String> |
getProperties()
Gets a dictionary of application-defined property names and values providing additional information about this event.
|
java.lang.String |
getSequence()
Sequence field used to track absolute order of uploaded events.
|
java.util.Date |
getTimestamp()
Gets date and time when event was recorded.
|
protected void |
initialize(java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.String> properties)
Initializes the instance with the context properties
|
void |
reset() |
void |
sanitize()
Deprecated.
Makes sure the data to send is sanitized from bad chars, proper length etc.
|
void |
serialize(JsonTelemetryDataSerializer writer)
Serializes this object in JSON format.
|
protected void |
setSampleRate(Envelope envelope) |
void |
setSequence(java.lang.String sequence)
Sets the value that defines absolute order of the telemetry item.
|
void |
setTimestamp(java.util.Date date)
Sets date and time when event was recorded.
|
protected void initialize(java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.String> properties)
properties
- The context propertiespublic java.lang.String getSequence()
The Sequence helps track how many events were fired and how many events were uploaded and enables identification of data lost during upload and de-duplication of events on the ingress server.
Gets the value that defines absolute order of the telemetry item.
getSequence
in interface Telemetry
public void setSequence(java.lang.String sequence)
setSequence
in interface Telemetry
sequence
- The sequence of the Telemetry.public java.util.Date getTimestamp()
getTimestamp
in interface Telemetry
public void setTimestamp(java.util.Date date)
setTimestamp
in interface Telemetry
date
- The timestamp as Date.public TelemetryContext getContext()
getContext
in interface Telemetry
public java.util.Map<java.lang.String,java.lang.String> getProperties()
getProperties
in interface Telemetry
@Deprecated public void sanitize()
public void serialize(JsonTelemetryDataSerializer writer) throws java.io.IOException
serialize
in interface JsonSerializable
serialize
in interface Telemetry
writer
- The writer that helps with serializing into Json formatjava.io.IOException
- The exception that might be thrown during the serialization@Deprecated protected abstract void additionalSanitize()
protected abstract T getData()
JsonSerializable
protected void setSampleRate(Envelope envelope)
protected java.lang.String getEnvelopName()
protected java.lang.String getBaseTypeName()