Class AbstractData

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

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

      • Fields inherited from interface com.xceptance.xlt.api.engine.Data

        DELIMITER
    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractData​(java.lang.String typeCode)
      Creates a new AbstractData object and gives it the specified type code.
      AbstractData​(java.lang.String name, java.lang.String 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
      protected java.util.List<java.lang.String> addValues()
      Builds a list of string values that represents the state of this object.
      void fromCSV​(java.lang.String s)
      Recreates the state of this object from a list of values separated by the DELIMITER constant.
      java.lang.String getAgentName()
      Returns the name of the agent that produced this data record.
      protected int getMinNoCSVElements()
      Returns the minimum number of elements in the CSV string.
      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.
      java.lang.String getTypeCode()
      Returns the type code of this data record.
      protected void parseValues​(java.lang.String[] values)
      Recreates the state of this object from an array of string values.
      void setAgentName​(java.lang.String agentName)
      Sets the name of the agent that produced this data record.
      void setName​(java.lang.String name)
      Sets the name of this data record.
      void setTime()
      Sets the time when this record's event occurred to the current time.
      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.lang.String toCSV()
      Returns the state of this object as a list of values separated by the DELIMITER constant.
      • 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 typeCode)
        Creates a new AbstractData object and gives it the specified type code.
        Parameters:
        typeCode - the type code
      • AbstractData

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

      • fromCSV

        public final void fromCSV​(java.lang.String s)
        Recreates the state of this object from a list of values separated by the DELIMITER constant.
        Specified by:
        fromCSV in interface Data
        Parameters:
        s - the list of values
      • 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 java.lang.String 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()
        Sets the time when this record's event occurred to the current time.
        Specified by:
        setTime in interface Data
      • setTime

        public void setTime​(long time)
        Sets the time when this record's event occurred.
        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
      • toCSV

        public final java.lang.String toCSV()
        Returns the state of this object as a list of values separated by the DELIMITER constant.
        Specified by:
        toCSV in interface Data
        Returns:
        the list of values
      • addValues

        protected java.util.List<java.lang.String> addValues()
        Builds a list of string values that represents the state of this object. Override this method in sub classes to add custom values and use the list created by the super class.
        Returns:
        the list of values
      • getMinNoCSVElements

        protected int getMinNoCSVElements()
        Returns the minimum number of elements in the CSV string.
        Returns:
        minimum number of elements in the CSV string
      • parseValues

        protected void parseValues​(java.lang.String[] values)
        Recreates the state of this object from an array of string values. Override this method in sub classes to restore custom values, but do not forget to call the super class first.
        Parameters:
        values - the list of values, must have at least the length getMinNoCSVElements()