com.ibm.ws.tpv.engine

Class UserPreferences

  1. java.lang.Object
  2. extended bycom.ibm.ws.tpv.engine.UserPreferences
All implemented interfaces:
java.io.Serializable, java.lang.Comparable

  1. public class UserPreferences
  2. extends java.lang.Object
  3. 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

Constructor and Description
UserPreferences()
Default constructor that initializes everything to an invalid value.

Method Summary

Modifier and Type Method and Description
  1. int
compareTo(java.lang.Object that)
  1. int
compareTo(UserPreferences that)
  1. UserPreferences
copy()
Return a deep copy of this.
  1. boolean
equals(java.lang.Object that)
  1. int
getBufferSize()
Returns the buffer size.
  1. 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.
  1. long
getLogFileSize()
Returns the maximum log file size of each log file that could be generated.
  1. long
getLoggingDuration()
Returns the logging duration.
  1. java.lang.String
getNodeName()
Returns the node name.
  1. int
getNumLogFiles()
Returns the number of log files that can be used while logging.
  1. int
getRefreshRate()
Returns the refresh rate that this user has requested.
  1. java.lang.String
getServerName()
Returns the server name.
  1. java.lang.String
getTpvLogFormat()
Returns the tpv log format
  1. java.lang.String
getUserId()
Returns this user's id.
  1. boolean
getViewLog()
Returns true if viewing a log
  1. int
hashCode()
  1. static
  2. boolean
isValid(int i)
Check if the integer is a valid UserPreferences value
  1. static
  2. boolean
isValid(long l)
Check if the long is a valid UserPreferences value
  1. static
  2. boolean
isValid(java.lang.String s)
Check if the String is a valid UserPreferences value
  1. void
setBufferSize(int i)
Sets the number of entries to store in the buffer
  1. 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.
  1. void
setLogFileSize(long l)
Sets the log file size.
  1. void
setLoggingDuration(long l)
Sets the logging duration.
  1. void
setNodeName(java.lang.String nodeName)
Set the node name.
  1. void
setNumLogFiles(int i)
Set the number of log files to use while logging.
  1. void
setRefreshRate(int i)
Set the refresh rate.
  1. void
setServerName(java.lang.String serverName)
Set the server name.
  1. void
setTpvLogFormat(java.lang.String logFormat)
Sets the format for the tpv log
  1. void
setUserId(java.lang.String userId)
Set the user's id.
  1. void
setViewLog(boolean bool)
Sets the viewLog status
  1. java.lang.String
toString()
Returns a String representation of the UserPreferences object
  1. boolean
update(UserPreferences up)
This method updates the UserPreferences using all valid fields in the UserPreferences parameter.
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

UserPreferences

  1. public UserPreferences()
Default constructor that initializes everything to an invalid value. This insures that only values that get set are valid.

Method Detail

equals

  1. public boolean equals(java.lang.Object that)
Overrides:
equals in class java.lang.Object

compareTo

  1. public int compareTo(java.lang.Object that)
Specified by:
compareTo in interface java.lang.Comparable

compareTo

  1. public int compareTo(UserPreferences that)

getBufferSize

  1. public int getBufferSize()
Returns the buffer size.
Returns:
int

getLogFileSize

  1. 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

  1. public long getLoggingDuration( )
Returns the logging duration.
Returns:
Number of seconds logging can be active for a session

getNodeName

  1. public java.lang.String getNodeName( )
Returns the node name.
Returns:
Node name

getNumLogFiles

  1. 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

  1. public int getRefreshRate()
Returns the refresh rate that this user has requested.
Returns:
Number of seconds in between requests for new data

getServerName

  1. public java.lang.String getServerName( )
Returns the server name.
Returns:
Server name

getUserId

  1. public java.lang.String getUserId( )
Returns this user's id.
Returns:
User ID used to login to the admin console

getViewLog

  1. public boolean getViewLog()
Returns true if viewing a log
Returns:
True if viewing a log, otherwise false

setBufferSize

  1. public void setBufferSize(int i)
Sets the number of entries to store in the buffer

setLogFileSize

  1. public void setLogFileSize(long l)
Sets the log file size.

setLoggingDuration

  1. 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

  1. public void setNodeName(java.lang.String nodeName)
Set the node name.
Parameters:
nodeName - Name of the node

setNumLogFiles

  1. 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

  1. public void setRefreshRate(int i)
Set the refresh rate.
Parameters:
i - Number seconds between requests for new data

setServerName

  1. public void setServerName(java.lang.String serverName)
Set the server name.
Parameters:
serverName - Name of the server

setUserId

  1. 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

  1. 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

  1. 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

  1. public void setViewLog(boolean bool)
Sets the viewLog status
Parameters:
bool - True if viewing a log, else false

isValid

  1. 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

  1. 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

  1. 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

  1. 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

  1. public UserPreferences copy()
Return a deep copy of this.
Returns:
UserPreferences

toString

  1. public java.lang.String toString( )
Returns a String representation of the UserPreferences object
Overrides:
toString in class java.lang.Object

hashCode

  1. public int hashCode()
Overrides:
hashCode in class java.lang.Object

getTpvLogFormat

  1. public java.lang.String getTpvLogFormat( )
Returns the tpv log format
Returns:
String

setTpvLogFormat

  1. public void setTpvLogFormat(java.lang.String logFormat)
Sets the format for the tpv log
Parameters:
logFormat -