com.ibm.ws.tpv.engine
Class UserPreferences
- java.lang.Object
-
- com.ibm.ws.tpv.engine.UserPreferences
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable
public class UserPreferences extends java.lang.Object implements java.io.Serializable, java.lang.Comparable
This class represents a user's preferences for a single server with respect to how they want to log their data and how they want to view their data. This class only cares about the user preferences with respect to how the buffer and data collector need to operate. Other user preferences such as the view mode (raw/change in value) are dealt with only at the user interace level and are not important to the TPV engine.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description UserPreferences()
Default constructor that initializes everything to an invalid value.
-
Method Summary
Methods Modifier and Type Method and Description int
compareTo(java.lang.Object that)
int
compareTo(UserPreferences that)
UserPreferences
copy()
Return a deep copy of this.boolean
equals(java.lang.Object that)
int
getBufferSize()
Returns the buffer size.java.lang.String
getLogFileName()
If the user is viewing a log (getViewLog() returns true) then this is the name of the log file being viewed, otherwise it is the name to use when logging data for the current server.long
getLogFileSize()
Returns the maximum log file size of each log file that could be generated.long
getLoggingDuration()
Returns the logging duration.java.lang.String
getNodeName()
Returns the node name.int
getNumLogFiles()
Returns the number of log files that can be used while logging.int
getRefreshRate()
Returns the refresh rate that this user has requested.java.lang.String
getServerName()
Returns the server name.java.lang.String
getTpvLogFormat()
Returns the tpv log formatjava.lang.String
getUserId()
Returns this user's id.boolean
getViewLog()
Returns true if viewing a logint
hashCode()
static boolean
isValid(int i)
Check if the integer is a valid UserPreferences valuestatic boolean
isValid(long l)
Check if the long is a valid UserPreferences valuestatic boolean
isValid(java.lang.String s)
Check if the String is a valid UserPreferences valuevoid
setBufferSize(int i)
Sets the number of entries to store in the buffervoid
setLogFileName(java.lang.String logFileName)
If the user is viewing a log (getViewLog() returns true) then this should set the name of the file being viewed.void
setLogFileSize(long l)
Sets the log file size.void
setLoggingDuration(long l)
Sets the logging duration.void
setNodeName(java.lang.String nodeName)
Set the node name.void
setNumLogFiles(int i)
Set the number of log files to use while logging.void
setRefreshRate(int i)
Set the refresh rate.void
setServerName(java.lang.String serverName)
Set the server name.void
setTpvLogFormat(java.lang.String logFormat)
Sets the format for the tpv logvoid
setUserId(java.lang.String userId)
Set the user's id.void
setViewLog(boolean bool)
Sets the viewLog statusjava.lang.String
toString()
Returns a String representation of the UserPreferences objectboolean
update(UserPreferences up)
This method updates the UserPreferences using all valid fields in the UserPreferences parameter.
-
-
-
Constructor Detail
-
UserPreferences
public UserPreferences()
Default constructor that initializes everything to an invalid value. This insures that only values that get set are valid.
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object that)
- Overrides:
equals
in classjava.lang.Object
-
compareTo
public int compareTo(java.lang.Object that)
- Specified by:
compareTo
in interfacejava.lang.Comparable
-
compareTo
public int compareTo(UserPreferences that)
-
getBufferSize
public int getBufferSize()
Returns the buffer size.- Returns:
- int
-
getLogFileSize
public long getLogFileSize()
Returns the maximum log file size of each log file that could be generated.- Returns:
- Number of bytes the log file is allowed to grow to
-
getLoggingDuration
public long getLoggingDuration()
Returns the logging duration.- Returns:
- Number of seconds logging can be active for a session
-
getNodeName
public java.lang.String getNodeName()
Returns the node name.- Returns:
- Node name
-
getNumLogFiles
public int getNumLogFiles()
Returns the number of log files that can be used while logging.- Returns:
- Number of log files to write while logging a server
-
getRefreshRate
public int getRefreshRate()
Returns the refresh rate that this user has requested.- Returns:
- Number of seconds in between requests for new data
-
getServerName
public java.lang.String getServerName()
Returns the server name.- Returns:
- Server name
-
getUserId
public java.lang.String getUserId()
Returns this user's id.- Returns:
- User ID used to login to the admin console
-
getViewLog
public boolean getViewLog()
Returns true if viewing a log- Returns:
- True if viewing a log, otherwise false
-
setBufferSize
public void setBufferSize(int i)
Sets the number of entries to store in the buffer- Parameters:
Size
- of the buffer
-
setLogFileSize
public void setLogFileSize(long l)
Sets the log file size.- Parameters:
Size
- an individual log file can grow to in bytes
-
setLoggingDuration
public void setLoggingDuration(long l)
Sets the logging duration. This is how long logging will stay active once it has been turned on, unless it is stopped manually by the user.- Parameters:
l
- Number of seconds logging will continue once activated
-
setNodeName
public void setNodeName(java.lang.String nodeName)
Set the node name.- Parameters:
nodeName
- Name of the node
-
setNumLogFiles
public void setNumLogFiles(int i)
Set the number of log files to use while logging.- Parameters:
i
- Number of log files to use while logging
-
setRefreshRate
public void setRefreshRate(int i)
Set the refresh rate.- Parameters:
i
- Number seconds between requests for new data
-
setServerName
public void setServerName(java.lang.String serverName)
Set the server name.- Parameters:
serverName
- Name of the server
-
setUserId
public void setUserId(java.lang.String userId)
Set the user's id.- Parameters:
userId
- Id the user used to login to the admin console
-
getLogFileName
public java.lang.String getLogFileName()
If the user is viewing a log (getViewLog() returns true) then this is the name of the log file being viewed, otherwise it is the name to use when logging data for the current server.- Returns:
- String Name of log file being viewed, or name of file to record to
-
setLogFileName
public void setLogFileName(java.lang.String logFileName)
If the user is viewing a log (getViewLog() returns true) then this should set the name of the file being viewed. Otherwise, this should be the name the user wants to use when recording new data.- Parameters:
logFileName
- Name of log file being viewed, or name of file to record to
-
setViewLog
public void setViewLog(boolean bool)
Sets the viewLog status- Parameters:
bool
- True if viewing a log, else false
-
isValid
public static final boolean isValid(int i)
Check if the integer is a valid UserPreferences value- Parameters:
i
- Integer to check- Returns:
- True if valid, else false
-
isValid
public static final boolean isValid(long l)
Check if the long is a valid UserPreferences value- Parameters:
l
- Long to check- Returns:
- True if valid, else false
-
isValid
public static final boolean isValid(java.lang.String s)
Check if the String is a valid UserPreferences value- Parameters:
s
- String to check- Returns:
- True if valid, else false
-
update
public boolean update(UserPreferences up)
This method updates the UserPreferences using all valid fields in the UserPreferences parameter.- Parameters:
up
- UserPreferences to use when updating this object- Returns:
- True if the node and server match, else false
-
copy
public UserPreferences copy()
Return a deep copy of this.- Returns:
- UserPreferences
-
toString
public java.lang.String toString()
Returns a String representation of the UserPreferences object- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
getTpvLogFormat
public java.lang.String getTpvLogFormat()
Returns the tpv log format- Returns:
- String
-
setTpvLogFormat
public void setTpvLogFormat(java.lang.String logFormat)
Sets the format for the tpv log- Parameters:
logFormat
-
-
-