
com.microsoft.applicationinsights.telemetry.BaseTelemetry Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of applicationinsights-core Show documentation
Show all versions of applicationinsights-core Show documentation
This is the core module of Microsoft Application Insights Java SDK
The newest version!
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package com.microsoft.applicationinsights.telemetry;
import java.util.Date;
import java.util.Map;
import java.util.concurrent.ConcurrentMap;
/** Superclass for all telemetry data classes. */
public abstract class BaseTelemetry implements Telemetry {
private TelemetryContext context;
private Date timestamp;
protected BaseTelemetry() {}
/** Initializes the instance with the context properties */
protected void initialize(ConcurrentMap properties) {
context = new TelemetryContext(properties, new ContextTagsMap());
}
/** Gets date and time when event was recorded. */
@Override
public Date getTimestamp() {
return timestamp;
}
/** Sets date and time when event was recorded. */
@Override
public void setTimestamp(Date timestamp) {
this.timestamp = timestamp;
}
/** Gets the context associated with the current telemetry item. */
@Override
public TelemetryContext getContext() {
return context;
}
/**
* Gets a dictionary of application-defined property names and values providing additional
* information about this event.
*/
@Override
public Map getProperties() {
return context.getProperties();
}
protected abstract Object getData();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy