public abstract class BaseTelemetry<T extends Domain> extends java.lang.Object implements Telemetry
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TELEMETRY_NAME_PREFIX |
Modifier | Constructor and Description |
---|---|
protected |
BaseTelemetry() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
additionalSanitize()
Deprecated.
|
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 |
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.
|
static java.lang.String |
getTelemetryName(java.lang.String normalizedInstrumentationKey,
java.lang.String envelopType) |
java.util.Date |
getTimestamp()
Gets date and time when event was recorded.
|
abstract int |
getVer() |
protected void |
initialize(java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.String> properties)
Initializes the instance with the context properties
|
static java.lang.String |
normalizeInstrumentationKey(java.lang.String instrumentationKey) |
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.
|
java.lang.String |
toString()
THIS IS FOR DEBUGGING AND TESTING ONLY!
DON'T USE THIS IN HAPPY-PATH, PRODUCTION CODE.
|
public static final java.lang.String TELEMETRY_NAME_PREFIX
protected void initialize(java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.String> properties)
properties
- The context propertiespublic abstract int getVer()
public 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 serializationpublic java.lang.String toString()
toString
in class java.lang.Object
@Deprecated protected abstract void additionalSanitize()
protected abstract T getData()
JsonSerializable
protected void setSampleRate(Envelope envelope)
public java.lang.String getEnvelopName()
public java.lang.String getBaseTypeName()
public static java.lang.String normalizeInstrumentationKey(java.lang.String instrumentationKey)
public static java.lang.String getTelemetryName(java.lang.String normalizedInstrumentationKey, java.lang.String envelopType)