Class QueryEvent

All Implemented Interfaces:
Comparable

public class QueryEvent extends EventHistory.Event
This class defines a (weighed) event that occurs in the query execution phase (see StandardDBStatement) and can be traced for reasons of maintenance of an operation history, logging and debugging.
  • Field Details

    • _query

      protected String _query
    • _rows

      protected int _rows
    • _time

      protected long _time
    • _startTime

      protected long _startTime
    • _endTime

      protected long _endTime
    • _params

      protected Map _params
    • _transaction

      protected String _transaction
    • _lastDBClientIdentifier

      protected String _lastDBClientIdentifier
  • Constructor Details

    • QueryEvent

      public QueryEvent(String transaction, String query, Map params, int rows, long startTime, long endTime)
      Creates a new QueryEvent
      Parameters:
      transaction - A string that describes the activity (transaction) associated to the query
      query - The query string
      params - The map of parameters of the query
      rows - The number of the rows extracted with the query
      startTime - The time, in milliseconds, of the starting of the query's execution
      endTime - The time, in milliseconds, of the ending of the query's execution
    • QueryEvent

      public QueryEvent(String lastDBClientIdentifier, String transaction, String query, Map params, int rows, long startTime, long endTime)
      Creates a new QueryEvent
      Parameters:
      lastDBClientIdentifier - A string that describes the client identifier, for the DB, associated to the query
      transaction - A string that describes the activity (transaction) associated to the query
      query - The query string
      params - The map of parameters of the query
      rows - The number of the rows extracted with the query
      startTime - The time, in milliseconds, of the starting of the query's execution
      endTime - The time, in milliseconds, of the ending of the query's execution
  • Method Details

    • getParams

      public Map getParams()
      Returns the Map of the query's parameters
      Returns:
      The query's parameters
    • getWeight

      public long getWeight()
      Returns the weight of the event
      Specified by:
      getWeight in class EventHistory.Event
      Returns:
      The number of the rows
    • getEndTime

      public long getEndTime()
      Returns the time, expressed in milliseconds, of the ending of the query's execution
      Returns:
      The time of the ending of the query's execution
    • getQuery

      public String getQuery()
      Returns the query associated to the QueryEvent
      Returns:
      The string that defines the query
    • getRows

      public int getRows()
      Returns the number of the rows
      Returns:
      The number of the rows
    • getStartTime

      public long getStartTime()
      Returns the time, expressed in milliseconds, of the starting of the query's execution
      Returns:
      The time of the starting of the query's execution
    • getTime

      public long getTime()
      Returns the time of query's execution
      Returns:
      End time - start time
    • getTransaction

      public String getTransaction()
      Returns the string that describes the activity associated to the query
      Returns:
      The transaction associated to the QueryEvent
    • getLastDBClientIdentifier

      public String getLastDBClientIdentifier()
      Returns the string that defines the last client identifier, for the DB, associated to the query
      Returns:
      The last DB client identifier associated to the QueryEvent