Class AbstractData

  • All Implemented Interfaces:
    Data
    Direct Known Subclasses:
    CustomValue, EventData, TimerData, WebVitalData

    public abstract class AbstractData
    extends java.lang.Object
    implements Data
    The AbstractData class may be the super class of a special data record class.

    Import change in 7.0: We are not longer automatically capturing the start time when this object is created for performance reasons. You have to set the time explicitly.

    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractData​(char typeCode)
      Creates a new AbstractData object and gives it the specified type code.
      AbstractData​(java.lang.String name, char typeCode)
      Creates a new AbstractData object and gives it the specified name and type code.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getAgentName()
      Returns the name of the agent that produced this data record.
      java.lang.String getName()
      Returns the name of this data record.
      long getTime()
      Returns the time when the event occurred that this data record was created for.
      java.lang.String getTransactionName()
      Returns the name of the transaction that produced this data record.
      char getTypeCode()
      Returns the type code of this data record.
      void setAgentName​(java.lang.String agentName)
      Sets the name of the agent that produced this data record.
      void setAllValues​(java.util.List<XltCharBuffer> values)
      Recreates the full object state at once.
      void setBaseValues​(java.util.List<XltCharBuffer> values)
      Called by XLT during report creation to recreate the base object state (type code, name, and timestamp) from the passed string list.
      void setName​(java.lang.String name)
      Sets the name of this data record.
      void setTime​(long time)
      Sets the time when this record's event occurred.
      void setTransactionName​(java.lang.String transactionName)
      Sets the name of the transaction that produced this data record.
      java.util.List<java.lang.String> toList()
      Called by XLT during a load test to return the full state of the object as a list of strings.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractData

        public AbstractData​(java.lang.String name,
                            char typeCode)
        Creates a new AbstractData object and gives it the specified name and type code.
        Parameters:
        name - the request name
        typeCode - the type code
      • AbstractData

        public AbstractData​(char typeCode)
        Creates a new AbstractData object and gives it the specified type code.
        Parameters:
        typeCode - the type code
    • Method Detail

      • setAllValues

        public final void setAllValues​(java.util.List<XltCharBuffer> values)
        Recreates the full object state at once. Mainly for testing.
        Parameters:
        values - the string list to recreate the object state from
      • setBaseValues

        public void setBaseValues​(java.util.List<XltCharBuffer> values)
        Called by XLT during report creation to recreate the base object state (type code, name, and timestamp) from the passed string list. The remaining values may later be initialized by calling Data.setRemainingValues(List) with the same list of values. Splitting the process of recreating the full object state into two methods is purely for performance reasons as the second step is not always needed.
        Specified by:
        setBaseValues in interface Data
        Parameters:
        values - the string list to recreate the object state from
        See Also:
        Data.setRemainingValues(List), Data.toList()
      • getAgentName

        public java.lang.String getAgentName()
        Returns the name of the agent that produced this data record. Only used during report generation or analysis.
        Specified by:
        getAgentName in interface Data
        Returns:
        the agent's name
      • getName

        public java.lang.String getName()
        Returns the name of this data record.
        Specified by:
        getName in interface Data
        Returns:
        the name
      • getTime

        public long getTime()
        Returns the time when the event occurred that this data record was created for.
        Specified by:
        getTime in interface Data
        Returns:
        the time
      • getTransactionName

        public java.lang.String getTransactionName()
        Returns the name of the transaction that produced this data record. Only used during report generation or analysis.
        Specified by:
        getTransactionName in interface Data
        Returns:
        the transaction's name
      • getTypeCode

        public char getTypeCode()
        Returns the type code of this data record.
        Specified by:
        getTypeCode in interface Data
        Returns:
        the type code
      • setAgentName

        public void setAgentName​(java.lang.String agentName)
        Sets the name of the agent that produced this data record. Only used during report generation or analysis.
        Specified by:
        setAgentName in interface Data
        Parameters:
        agentName - the agent's name
      • setName

        public void setName​(java.lang.String name)
        Sets the name of this data record.
        Specified by:
        setName in interface Data
        Parameters:
        name - the name
      • setTime

        public void setTime​(long time)
        Sets the time when this record's event occurred. To obtain the timestamp, please use GlobalClock.millis().
        Specified by:
        setTime in interface Data
        Parameters:
        time - the timestamp
      • setTransactionName

        public void setTransactionName​(java.lang.String transactionName)
        Sets the name of the transaction that produced this data record. Only used during report generation or analysis.
        Specified by:
        setTransactionName in interface Data
        Parameters:
        transactionName - the transaction's name
      • toList

        public java.util.List<java.lang.String> toList()
        Called by XLT during a load test to return the full state of the object as a list of strings. The first three entries have to be, in this order, the type code, the name, and the timestamp. All remaining entries and their order are specific to the concrete implementation class.

        Override this method in sub classes by calling the super method and adding custom values to the list it returns.

        Specified by:
        toList in interface Data
        Returns:
        the list of values that form the state of this object
        See Also:
        Data.setBaseValues(List), Data.setRemainingValues(List)