Class NullTrailImpl

  • All Implemented Interfaces:
    Trail

    public final class NullTrailImpl
    extends Object
    implements Trail

    This is public because package-private is classloader-package-private. Do not use in deployed code.

    • Field Detail

      • NULL_TRAIL

        public static final Trail NULL_TRAIL
    • Method Detail

      • id

        public long id()
      • isEnabled

        public boolean isEnabled()
        Description copied from interface: Trail

        Check if reporting is enabled.

        Specified by:
        isEnabled in interface Trail
        Returns:
        true if SAS tracing is enabled on the SAS facility this trail was created from
      • event

        public EventMessage event​(Enum<? extends SasEventEnum> event)
        Description copied from interface: Trail

        Create an event message with given event.

        Specified by:
        event in interface Trail
        Parameters:
        event - an event defined in an enum that implements SasEventEnum
        Returns:
        the event message, ready to add parameters and send
      • marker

        public MarkerMessage marker​(Markers marker)
        Description copied from interface: Trail

        Create a marker message with given marker.

        Specified by:
        marker in interface Trail
        Parameters:
        marker - a marker defined in the Markers enum
        Returns:
        the marker message, ready to add parameters and send
      • marker

        public MarkerMessage marker​(int markerId)
        Description copied from interface: Trail

        Create a marker message with given marker ID.

        This method should not be used unless new Markers have been added to SAS that are not available in the Markers enum.

        Specified by:
        marker in interface Trail
        Parameters:
        markerId - a marker constant known to SAS
        Returns:
        the marker message, ready to add parameters and send
      • associate

        public void associate​(Trail otherTrail,
                              Scope scope)
        Description copied from interface: Trail

        Send a trail association message or correlation marker, depending on whether this trail and the given trail are on the same SAS server or not.

        With a SAS federation, it is possible that a pair of trails may not be reporting to the same SAS server. In this case this method will send a generic correlation marker using a UUID v4 (random) identifier to both SAS servers.

        Specified by:
        associate in interface Trail
      • report

        public void report​(Markers marker)
        Description copied from interface: Trail

        Build and report a marker with no parameters

        Specified by:
        report in interface Trail
      • report

        public void report​(Enum<? extends SasEventEnum> event)
        Description copied from interface: Trail

        Build and report an event with no parameters

        Specified by:
        report in interface Trail
      • end

        public void end()
        Description copied from interface: Trail

        End this trail. Sends an Markers.END_MARKER to denote the end of the user experience. Trails must be ended to be searchable in SAS. It is better to call end() twice than never. Events received within 5s of an end marker being sent are associated with the same trail but trail-trail association can no longer occur.

        Specified by:
        end in interface Trail
      • flush

        public void flush()
        Description copied from interface: Trail

        Write reported events and markers for this trail to permanent storage on the SAS server. Sends an Markers.FLUSH_MARKER to denote a break in control of the dialog. Flushing a trail should be performed at the end of an active control phase where a delay is anticipated before the next dialog event.

        Specified by:
        flush in interface Trail