public class AnalyticsTransmissionTarget
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
addAuthenticationProvider(AuthenticationProvider authenticationProvider)
Add an authentication provider to associate logs with user identifiers.
|
PropertyConfigurator |
getPropertyConfigurator()
Getter for property configurator to override Common Schema Part A properties.
|
AnalyticsTransmissionTarget |
getTransmissionTarget(java.lang.String transmissionTargetToken)
Create a new transmission target based on the properties of the current target.
|
com.microsoft.appcenter.utils.async.AppCenterFuture<java.lang.Boolean> |
isEnabledAsync()
Check whether this target is enabled or not.
|
void |
pause()
Pauses log transmission for this target.
|
void |
resume()
Resumes log transmission for this target.
|
com.microsoft.appcenter.utils.async.AppCenterFuture<java.lang.Void> |
setEnabledAsync(boolean enabled)
Enable or disable this target.
|
void |
trackEvent(java.lang.String name)
Track a custom event with name.
|
void |
trackEvent(java.lang.String name,
EventProperties properties)
Track a custom event with name and optional string properties.
|
void |
trackEvent(java.lang.String name,
EventProperties properties,
int flags)
Track a custom event with name and optional string properties.
|
void |
trackEvent(java.lang.String name,
java.util.Map<java.lang.String,java.lang.String> properties)
Track a custom event with name and optional string properties.
|
void |
trackEvent(java.lang.String name,
java.util.Map<java.lang.String,java.lang.String> properties,
int flags)
Track a custom event with name and optional string properties.
|
public static void addAuthenticationProvider(AuthenticationProvider authenticationProvider)
If you want to wait for authentication callback to complete before processing logs, you can pause and resume Analytics or a specific transmission target.
authenticationProvider - The authentication provider.public void trackEvent(java.lang.String name)
The name cannot be null and needs to match the [a-zA-Z0-9]((\.(?!(\.|$)))|[_a-zA-Z0-9]){3,99} regular expression.
name - An event name.public void trackEvent(java.lang.String name,
java.util.Map<java.lang.String,java.lang.String> properties)
The following rules apply:
name - An event name.properties - Optional properties.public void trackEvent(java.lang.String name,
java.util.Map<java.lang.String,java.lang.String> properties,
int flags)
The following rules apply:
name - An event name.properties - Optional properties.flags - Optional flags. Events tracked with the Flags.PERSISTENCE_CRITICAL
flag will take precedence over all other events in storage.
An event tracked with this option will only be dropped
if storage must make room for a newer event that is also marked with the
Flags.PERSISTENCE_CRITICAL flag.public void trackEvent(java.lang.String name,
EventProperties properties)
The following rules apply:
name - An event name.properties - Optional properties.public void trackEvent(java.lang.String name,
EventProperties properties,
int flags)
The following rules apply:
name - An event name.properties - Optional properties.flags - Optional flags. Events tracked with the Flags.PERSISTENCE_CRITICAL
flag will take precedence over all other events in storage.
An event tracked with this option will only be dropped
if storage must make room for a newer event that is also marked with the
Flags.PERSISTENCE_CRITICAL flag.public AnalyticsTransmissionTarget getTransmissionTarget(java.lang.String transmissionTargetToken)
transmissionTargetToken - The transmission target token of the new transmission target.public com.microsoft.appcenter.utils.async.AppCenterFuture<java.lang.Boolean> isEnabledAsync()
true if enabled, false otherwise.AppCenterFuturepublic com.microsoft.appcenter.utils.async.AppCenterFuture<java.lang.Void> setEnabledAsync(boolean enabled)
enabled - true to enable, false to disable.public void pause()
public void resume()
public PropertyConfigurator getPropertyConfigurator()