Class CommandLog

java.lang.Object
org.deltava.beans.system.CommandLog
All Implemented Interfaces:
Serializable, Comparable<CommandLog>, RemoteAddressBean, ViewEntry

public class CommandLog extends Object implements Serializable, Comparable<CommandLog>, RemoteAddressBean, ViewEntry
A bean to log Web Site Command invocations.
Since:
1.0
Version:
10.2
Author:
Luke
See Also:
  • Constructor Details

    • CommandLog

      public CommandLog(Instant d)
      Creates a new Command log entry.
      Parameters:
      d - the date/time of the command invocation.
      See Also:
    • CommandLog

      public CommandLog(String cmdName, CommandResult cr)
      Creates a new Command log entry.
      Parameters:
      cmdName - the Command name
      cr - the CommandResult bean
  • Method Details

    • getDate

      public Instant getDate()
      Returns the date the Command was executed.
      Returns:
      the execution date/time
    • getName

      public String getName()
      Returns the Command name.
      Returns:
      the Command name
      See Also:
    • getRemoteAddr

      public String getRemoteAddr()
      Description copied from interface: RemoteAddressBean
      Returns the remote IP address.
      Specified by:
      getRemoteAddr in interface RemoteAddressBean
      Returns:
      an IPv4 or IPv6 address
    • getRemoteHost

      public String getRemoteHost()
      Description copied from interface: RemoteAddressBean
      Returns the remote host name.
      Specified by:
      getRemoteHost in interface RemoteAddressBean
      Returns:
      the host name, or address if unresolved
    • getResult

      public String getResult()
      Returns the command result data.
      Returns:
      the result data
      See Also:
    • getPilotID

      public int getPilotID()
      Returns the database ID of the Pilot executing the Command.
      Returns:
      the database ID
      See Also:
    • getSuccess

      public boolean getSuccess()
      Returns if the Command completed succesfully.
      Returns:
      TRUE if execution was successful, otherwise FALSE
      See Also:
    • getBackEndTime

      public long getBackEndTime()
      Returns the amount of time the database was in use.
      Returns:
      the time in milliseconds
      See Also:
    • getTime

      public long getTime()
      Returns the execution time.
      Returns:
      the time of milliseconds
      See Also:
    • setName

      public void setName(String cmdName)
      Updates the Command name.
      Parameters:
      cmdName - the name
      See Also:
    • setRemoteAddr

      public void setRemoteAddr(String addr)
      Updates the IP address of the user executing the Command.
      Parameters:
      addr - the IP address
      See Also:
    • setRemoteHost

      public void setRemoteHost(String hostName)
      Updates the host name of the user executing the Command.
      Parameters:
      hostName - the host name
      See Also:
    • setResult

      public void setResult(String msg)
      Updates the Command result data.
      Parameters:
      msg - the result data
      See Also:
    • setPilotID

      public void setPilotID(int id)
      Updates the database ID of the user executing this Command.
      Parameters:
      id - the Pilot's database ID
      See Also:
    • setSuccess

      public void setSuccess(boolean isOK)
      Marks whether this Command executed successfully.
      Parameters:
      isOK - TRUE if the Command completed successfully, otherwise FALSE
      See Also:
    • setBackEndTime

      public void setBackEndTime(long time)
      Updates the time spent accessing the database.
      Parameters:
      time - the time in milliseconds
      See Also:
    • setTime

      public void setTime(long time)
      Updates the total execution time.
      Parameters:
      time - the time in milliseconds
      See Also:
    • compareTo

      public int compareTo(CommandLog cl2)
      Compares two log entries by comparing their dates.
      Specified by:
      compareTo in interface Comparable<CommandLog>
    • getRowClassName

      public String getRowClassName()
      Returns the CSS table row class name.
      Specified by:
      getRowClassName in interface ViewEntry
      Returns:
      null or "warn" if execution not successful
      See Also: