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 TypeMethodDescriptionintcompareTo(CommandLog cl2) Compares two log entries by comparing their dates.longReturns the amount of time the database was in use.getDate()Returns the date the Command was executed.getName()Returns the Command name.intReturns 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.booleanReturns if the Command completed succesfully.longgetTime()Returns the execution time.voidsetBackEndTime(long time) Updates the time spent accessing the database.voidUpdates the Command name.voidsetPilotID(int id) Updates the database ID of the user executing this Command.voidsetRemoteAddr(String addr) Updates the IP address of the user executing the Command.voidsetRemoteHost(String hostName) Updates the host name of the user executing the Command.voidUpdates the Command result data.voidsetSuccess(boolean isOK) Marks whether this Command executed successfully.voidsetTime(long time) Updates the total execution time.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface 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:RemoteAddressBeanReturns the remote IP address.- Specified by:
getRemoteAddrin interfaceRemoteAddressBean- Returns:
- an IPv4 or IPv6 address
-
getRemoteHost
Description copied from interface:RemoteAddressBeanReturns the remote host name.- Specified by:
getRemoteHostin 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:
compareToin interfaceComparable<CommandLog>
-
getRowClassName
Returns the CSS table row class name.- Specified by:
getRowClassNamein interfaceViewEntry- Returns:
- null or "warn" if execution not successful
- See Also:
-