/// <summary>
            /// Creates a new builder instance with pre-initialized fields from the given <see cref="IResponseAttributes"/>.
            /// </summary>
            /// <param name="responseAttributes">response attributes used for initializing this builder.</param>
            public Builder(IResponseAttributes responseAttributes)
            {
                IsCaptureEnabled        = responseAttributes.IsCapture;
                IsCrashReportingEnabled = responseAttributes.IsCaptureCrashes;
                IsErrorReportingEnabled = responseAttributes.IsCaptureErrors;
                ServerId          = responseAttributes.ServerId;
                BeaconSizeInBytes = responseAttributes.MaxBeaconSizeInBytes;
                Multiplicity      = responseAttributes.Multiplicity;

                SendIntervalInMilliseconds = responseAttributes.SendIntervalInMilliseconds;

                MaxSessionDurationInMilliseconds       = responseAttributes.MaxSessionDurationInMilliseconds;
                IsSessionSplitBySessionDurationEnabled =
                    responseAttributes.IsAttributeSet(ResponseAttribute.MAX_SESSION_DURATION);

                MaxEventsPerSession           = responseAttributes.MaxEventsPerSession;
                IsSessionSplitByEventsEnabled =
                    responseAttributes.IsAttributeSet(ResponseAttribute.MAX_EVENTS_PER_SESSION);

                SessionTimeoutInMilliseconds       = responseAttributes.SessionTimeoutInMilliseconds;
                IsSessionSplitByIdleTimeoutEnabled =
                    responseAttributes.IsAttributeSet(ResponseAttribute.SESSION_IDLE_TIMEOUT);

                VisitStoreVersion = responseAttributes.VisitStoreVersion;
            }
 private static void ApplyStatus(Builder builder, IResponseAttributes attributes)
 {
     if (attributes.IsAttributeSet(ResponseAttribute.STATUS))
     {
         builder.WithStatus(attributes.Status);
     }
 }
 private static void ApplyServerId(Builder builder, IResponseAttributes attributes)
 {
     if (attributes.IsAttributeSet(ResponseAttribute.SERVER_ID))
     {
         builder.WithServerId(attributes.ServerId);
     }
 }
 private static void ApplyMultiplicity(Builder builder, IResponseAttributes attributes)
 {
     if (attributes.IsAttributeSet(ResponseAttribute.MULTIPLICITY))
     {
         builder.WithMultiplicity(attributes.Multiplicity);
     }
 }
 private static void ApplyApplicationId(Builder builder, IResponseAttributes attributes)
 {
     if (attributes.IsAttributeSet(ResponseAttribute.APPLICATION_ID))
     {
         builder.WithApplicationId(attributes.ApplicationId);
     }
 }
 private static void ApplyTrafficControlPercentage(Builder builder, IResponseAttributes attributes)
 {
     if (attributes.IsAttributeSet(ResponseAttribute.TRAFFIC_CONTROL_PERCENTAGE))
     {
         builder.WithTrafficControlPercentage(attributes.TrafficControlPercentage);
     }
 }
 private static void ApplyCaptureErrors(Builder builder, IResponseAttributes attributes)
 {
     if (attributes.IsAttributeSet(ResponseAttribute.IS_CAPTURE_ERRORS))
     {
         builder.WithCaptureErrors(attributes.IsCaptureErrors);
     }
 }
 private static void ApplyBeaconSize(Builder builder, IResponseAttributes attributes)
 {
     if (attributes.IsAttributeSet(ResponseAttribute.MAX_BEACON_SIZE))
     {
         builder.WithMaxBeaconSizeInBytes(attributes.MaxBeaconSizeInBytes);
     }
 }
 private static void ApplyCapture(Builder builder, IResponseAttributes attributes)
 {
     if (attributes.IsAttributeSet(ResponseAttribute.IS_CAPTURE))
     {
         builder.WithCapture(attributes.IsCapture);
     }
 }
예제 #10
0
 private static void ApplyVisitStoreVersion(Builder builder, IResponseAttributes attributes)
 {
     if (attributes.IsAttributeSet(ResponseAttribute.VISIT_STORE_VERSION))
     {
         builder.WithVisitStoreVersion(attributes.VisitStoreVersion);
     }
 }
예제 #11
0
 private static void ApplySendInterval(Builder builder, IResponseAttributes attributes)
 {
     if (attributes.IsAttributeSet(ResponseAttribute.SEND_INTERVAL))
     {
         builder.WithSendIntervalInMilliseconds(attributes.SendIntervalInMilliseconds);
     }
 }
예제 #12
0
 private static void ApplySessionTimeout(Builder builder, IResponseAttributes attributes)
 {
     if (attributes.IsAttributeSet(ResponseAttribute.SESSION_IDLE_TIMEOUT))
     {
         builder.WithSessionTimeoutInMilliseconds(attributes.SessionTimeoutInMilliseconds);
     }
 }
예제 #13
0
 private static void ApplyEventsPerSession(Builder builder, IResponseAttributes attributes)
 {
     if (attributes.IsAttributeSet(ResponseAttribute.MAX_EVENTS_PER_SESSION))
     {
         builder.WithMaxEventsPerSession(attributes.MaxEventsPerSession);
     }
 }
예제 #14
0
 private static void ApplySessionDuration(Builder builder, IResponseAttributes attributes)
 {
     if (attributes.IsAttributeSet(ResponseAttribute.MAX_SESSION_DURATION))
     {
         builder.WithMaxSessionDurationInMilliseconds(attributes.MaxSessionDurationInMilliseconds);
     }
 }
예제 #15
0
 private static void ApplyTimestamp(Builder builder, IResponseAttributes attributes)
 {
     if (attributes.IsAttributeSet(ResponseAttribute.TIMESTAMP))
     {
         builder.WithTimestampInMilliseconds(attributes.TimestampInMilliseconds);
     }
 }
예제 #16
0
            public Builder(IResponseAttributes defaults)
            {
                SetAttributes = new HashSet <ResponseAttribute>();

                MaxBeaconSizeInBytes             = defaults.MaxBeaconSizeInBytes;
                MaxSessionDurationInMilliseconds = defaults.MaxSessionDurationInMilliseconds;
                MaxEventsPerSession          = defaults.MaxEventsPerSession;
                SessionTimeoutInMilliseconds = defaults.SessionTimeoutInMilliseconds;
                SendIntervalInMilliseconds   = defaults.SendIntervalInMilliseconds;
                VisitStoreVersion            = defaults.VisitStoreVersion;

                IsCapture                = defaults.IsCapture;
                IsCaptureCrashes         = defaults.IsCaptureCrashes;
                IsCaptureErrors          = defaults.IsCaptureErrors;
                TrafficControlPercentage = defaults.TrafficControlPercentage;
                ApplicationId            = defaults.ApplicationId;

                Multiplicity = defaults.Multiplicity;
                ServerId     = defaults.ServerId;
                Status       = defaults.Status;

                TimestampInMilliseconds = defaults.TimestampInMilliseconds;

                foreach (var attribute in Enum.GetValues(typeof(ResponseAttribute)).Cast <ResponseAttribute>())
                {
                    if (defaults.IsAttributeSet(attribute))
                    {
                        SetAttribute(attribute);
                    }
                }
            }
예제 #17
0
 private static void ApplyCaptureCrashes(Builder builder, IResponseAttributes attributes)
 {
     if (attributes.IsAttributeSet(ResponseAttribute.IS_CAPTURE_CRASHES))
     {
         builder.WithCaptureCrashes(attributes.IsCaptureCrashes);
     }
 }