Class AnalyticsTransmissionTarget
- java.lang.Object
-
- com.microsoft.appcenter.analytics.AnalyticsTransmissionTarget
-
public class AnalyticsTransmissionTarget extends java.lang.ObjectTarget for advanced transmission target usage.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidaddAuthenticationProvider(AuthenticationProvider authenticationProvider)Add an authentication provider to associate logs with user identifiers.PropertyConfiguratorgetPropertyConfigurator()Getter for property configurator to override Common Schema Part A properties.AnalyticsTransmissionTargetgetTransmissionTarget(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.voidpause()Pauses log transmission for this target.voidresume()Resumes log transmission for this target.com.microsoft.appcenter.utils.async.AppCenterFuture<java.lang.Void>setEnabledAsync(boolean enabled)Enable or disable this target.voidtrackEvent(java.lang.String name)Track a custom event with name.voidtrackEvent(java.lang.String name, EventProperties properties)Track a custom event with name and optional string properties.voidtrackEvent(java.lang.String name, EventProperties properties, int flags)Track a custom event with name and optional string properties.voidtrackEvent(java.lang.String name, java.util.Map<java.lang.String,java.lang.String> properties)Track a custom event with name and optional string properties.voidtrackEvent(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.
-
-
-
Method Detail
-
addAuthenticationProvider
public static void addAuthenticationProvider(AuthenticationProvider authenticationProvider)
Add an authentication provider to associate logs with user identifiers. Events tracked previous to calling this method are not impacted by this call. If the callback from the authentication provider takes a long time to process, events might be tracked anonymously.If you want to wait for authentication callback to complete before processing logs, you can pause and resume Analytics or a specific transmission target.
- Parameters:
authenticationProvider- The authentication provider.
-
trackEvent
public void trackEvent(java.lang.String name)
Track a custom event with name.The name cannot be null and needs to match the
[a-zA-Z0-9]((\.(?!(\.|$)))|[_a-zA-Z0-9]){3,99}regular expression.- Parameters:
name- An event name.
-
trackEvent
public 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.The following rules apply:
- The event name needs to match the
[a-zA-Z0-9]((\.(?!(\.|$)))|[_a-zA-Z0-9]){3,99}regular expression. - The property names or values cannot be null.
- The
baseDataandbaseDataTypeproperties are reserved and thus discarded. - The full event size when encoded as a JSON string cannot be larger than 1.9MB.
- Parameters:
name- An event name.properties- Optional properties.
- The event name needs to match the
-
trackEvent
public 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.The following rules apply:
- The event name needs to match the
[a-zA-Z0-9]((\.(?!(\.|$)))|[_a-zA-Z0-9]){3,99}regular expression. - The property names or values cannot be null.
- The
baseDataandbaseDataTypeproperties are reserved and thus discarded. - The full event size when encoded as a JSON string cannot be larger than 1.9MB.
- Parameters:
name- An event name.properties- Optional properties.flags- Optional flags. Events tracked with theFlags.CRITICALflag 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 theFlags.CRITICALflag.
- The event name needs to match the
-
trackEvent
public void trackEvent(java.lang.String name, EventProperties properties)Track a custom event with name and optional string properties.The following rules apply:
- The event name needs to match the
[a-zA-Z0-9]((\.(?!(\.|$)))|[_a-zA-Z0-9]){3,99}regular expression. - The property names or values cannot be null.
- Double values must be finite (NaN or Infinite values are discarded).
- The
baseDataandbaseDataTypeproperties are reserved and thus discarded. - The full event size when encoded as a JSON string cannot be larger than 1.9MB.
- Parameters:
name- An event name.properties- Optional properties.
- The event name needs to match the
-
trackEvent
public void trackEvent(java.lang.String name, EventProperties properties, int flags)Track a custom event with name and optional string properties.The following rules apply:
- The event name needs to match the
[a-zA-Z0-9]((\.(?!(\.|$)))|[_a-zA-Z0-9]){3,99}regular expression. - The property names or values cannot be null.
- Double values must be finite (NaN or Infinite values are discarded).
- The
baseDataandbaseDataTypeproperties are reserved and thus discarded. - The full event size when encoded as a JSON string cannot be larger than 1.9MB.
- Parameters:
name- An event name.properties- Optional properties.flags- Optional flags. Events tracked with theFlags.CRITICALflag 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 theFlags.CRITICALflag.
- The event name needs to match the
-
getTransmissionTarget
public AnalyticsTransmissionTarget getTransmissionTarget(java.lang.String transmissionTargetToken)
Create a new transmission target based on the properties of the current target.- Parameters:
transmissionTargetToken- The transmission target token of the new transmission target.- Returns:
- The new transmission target.
-
isEnabledAsync
public com.microsoft.appcenter.utils.async.AppCenterFuture<java.lang.Boolean> isEnabledAsync()
Check whether this target is enabled or not.- Returns:
- future with result being
trueif enabled,falseotherwise. - See Also:
AppCenterFuture
-
setEnabledAsync
public com.microsoft.appcenter.utils.async.AppCenterFuture<java.lang.Void> setEnabledAsync(boolean enabled)
Enable or disable this target. The state is applied on all descendant targets. The state is not changed if one ancestor target or Analytics module or AppCenter is disabled.- Parameters:
enabled-trueto enable,falseto disable.- Returns:
- future with null result to monitor when the operation completes.
-
pause
public void pause()
Pauses log transmission for this target. This does not pause child targets.
-
resume
public void resume()
Resumes log transmission for this target. This does not resume child targets.
-
getPropertyConfigurator
public PropertyConfigurator getPropertyConfigurator()
Getter for property configurator to override Common Schema Part A properties.- Returns:
- the Property Configurator
-
-