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 Summary
ConstructorsConstructorDescriptionCommandLog
(String cmdName, CommandResult cr) Creates a new Command log entry.Creates a new Command log entry. -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(CommandLog cl2) Compares two log entries by comparing their dates.long
Returns the amount of time the database was in use.getDate()
Returns the date the Command was executed.getName()
Returns the Command name.int
Returns the database ID of the Pilot executing the Command.Returns the remote IP address.Returns the remote host name.Returns the command result data.Returns the CSS table row class name.boolean
Returns if the Command completed succesfully.long
getTime()
Returns the execution time.void
setBackEndTime
(long time) Updates the time spent accessing the database.void
Updates the Command name.void
setPilotID
(int id) Updates the database ID of the user executing this Command.void
setRemoteAddr
(String addr) Updates the IP address of the user executing the Command.void
setRemoteHost
(String hostName) Updates the host name of the user executing the Command.void
Updates the Command result data.void
setSuccess
(boolean isOK) Marks whether this Command executed successfully.void
setTime
(long time) Updates the total execution time.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.deltava.beans.RemoteAddressBean
getIsResolved
-
Constructor Details
-
CommandLog
Creates a new Command log entry.- Parameters:
d
- the date/time of the command invocation.- See Also:
-
CommandLog
Creates a new Command log entry.- Parameters:
cmdName
- the Command namecr
- the CommandResult bean
-
-
Method Details
-
getDate
Returns the date the Command was executed.- Returns:
- the execution date/time
-
getName
-
getRemoteAddr
Description copied from interface:RemoteAddressBean
Returns the remote IP address.- Specified by:
getRemoteAddr
in interfaceRemoteAddressBean
- Returns:
- an IPv4 or IPv6 address
-
getRemoteHost
Description copied from interface:RemoteAddressBean
Returns the remote host name.- Specified by:
getRemoteHost
in interfaceRemoteAddressBean
- Returns:
- the host name, or address if unresolved
-
getResult
-
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
Updates the Command name.- Parameters:
cmdName
- the name- See Also:
-
setRemoteAddr
Updates the IP address of the user executing the Command.- Parameters:
addr
- the IP address- See Also:
-
setRemoteHost
Updates the host name of the user executing the Command.- Parameters:
hostName
- the host name- See Also:
-
setResult
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
Compares two log entries by comparing their dates.- Specified by:
compareTo
in interfaceComparable<CommandLog>
-
getRowClassName
Returns the CSS table row class name.- Specified by:
getRowClassName
in interfaceViewEntry
- Returns:
- null or "warn" if execution not successful
- See Also:
-