com.isti.trinetwatch.server
Class SubsetPropInfo

java.lang.Object
  extended by com.isti.trinetwatch.server.SubsetPropInfo

public class SubsetPropInfo
extends java.lang.Object

Class SubsetPropInfo defines a block of information for a subset-of-stations property item.


Nested Class Summary
static class SubsetPropInfo.AgentStationsUpdater
          Class AgentStationsUpdater implements a method used to gather a list of stations that match a given agent-name criteria and that have changed status or usage since a given time value.
static interface SubsetPropInfo.StationsUpdatable
          Interface StationsUpdatable defines a method used to gather a list of stations that match a given criteria and that have changed status or usage since a given time value.
 
Constructor Summary
SubsetPropInfo(java.lang.String name, byte propCodeMask, GroupTableInfo groupTableObj, SubsetPropInfo.StationsUpdatable stationUpdater)
          Creates an property item information block.
 
Method Summary
 boolean getCheckSameStatusFlag()
          Returns true if subsets should be checked for all stations at same status level (via 'procSameStatusGroups()' method).
 java.util.Enumeration getGroupKeys()
          Returns an enumeration of group names associated with this property item.
 java.lang.String getName()
          Returns this property item's name.
 byte getPropCodeMask()
          Returns this property item's bit mask for its property code (used with the 'GUIServices.getPropValuesList()' method).
 java.lang.String getSameStatusString(long timeVal, StatusLevelTag sLevel)
          Returns a String indicating which subset-of-stations sets contain stations that are all at the given status level as of the given server time value (if no sets then an empty string is returned).
 java.lang.String getStationsString(int compCode, java.lang.String groupName)
          Returns a String of names of stations associated with the given group name (within this property item).
 StationTable getStationsTable(int compCode, java.lang.String groupName)
          Returns the table of station objects associated with the given group name (within this property item).
 java.lang.String getSubsetUpdateString(long timeVal, int compCode, java.lang.String agentName)
          Returns an update string of entries for all stations that match the given criteria and that have changed status or usage since the given time value.
 void procSameStatusGroups()
          Tracks the status levels of the stations in all of the groups held by this object.
 void setCheckSameStatusFlag(boolean flg)
          Sets flag that is true to indicate that subsets should be checked for all stations at same status level (via 'procSameStatusGroups()' method).
 java.lang.String toString()
          Returns this property item's name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SubsetPropInfo

public SubsetPropInfo(java.lang.String name,
                      byte propCodeMask,
                      GroupTableInfo groupTableObj,
                      SubsetPropInfo.StationsUpdatable stationUpdater)
Creates an property item information block.

Parameters:
name - name of the property item.
propCodeMask - bit mask for the property code; used with the 'GUIServices.getPropValuesList()' method.
groupTableObj - table of station groups associated with the property item.
stationUpdater - the station updater object to use with this information block; defines action taken by 'getSubsetUpdateString()' method.
Method Detail

getName

public java.lang.String getName()
Returns this property item's name.


getPropCodeMask

public byte getPropCodeMask()
Returns this property item's bit mask for its property code (used with the 'GUIServices.getPropValuesList()' method).


getGroupKeys

public java.util.Enumeration getGroupKeys()
Returns an enumeration of group names associated with this property item.


getStationsString

public java.lang.String getStationsString(int compCode,
                                          java.lang.String groupName)
Returns a String of names of stations associated with the given group name (within this property item).

Parameters:
compCode - the comparison code associated with the group name (not currently used).
groupName - the group name to use.
Returns:
A String of station name strings, each surrounded by double-quotes and separated by a comma; or an empty String if no station names could be generated.

getStationsTable

public StationTable getStationsTable(int compCode,
                                     java.lang.String groupName)
Returns the table of station objects associated with the given group name (within this property item).

Parameters:
compCode - the comparison code associated with the group name (not currently used).
groupName - the group name to use.
Returns:
A 'StationTable' object, or null if no group with the given name could be found in the group table.

getSubsetUpdateString

public java.lang.String getSubsetUpdateString(long timeVal,
                                              int compCode,
                                              java.lang.String agentName)
Returns an update string of entries for all stations that match the given criteria and that have changed status or usage since the given time value.

Parameters:
timeVal - a server epoch time value (seconds since 1/1/1970).
compCode - the comparison code associated with the group name (not currently used).
agentName - the name of the agent to use in determining status, or null for no agent.
Returns:
An ASCII string formatted as follows: ;NNNN:SSSSS,UUUUU... where NNNN is a station name, SSSSS is a status level tag name, and UUUUU is a usage level tag name. Any number of station/status/usage groups may be passed.

setCheckSameStatusFlag

public void setCheckSameStatusFlag(boolean flg)
Sets flag that is true to indicate that subsets should be checked for all stations at same status level (via 'procSameStatusGroups()' method).


getCheckSameStatusFlag

public boolean getCheckSameStatusFlag()
Returns true if subsets should be checked for all stations at same status level (via 'procSameStatusGroups()' method).


procSameStatusGroups

public void procSameStatusGroups()
Tracks the status levels of the stations in all of the groups held by this object. This method should be called on a regular basis to keep track of when all of the stations in any given group have the same status level, thus allowing the 'getSameStatusString()' method to report the current status.


getSameStatusString

public java.lang.String getSameStatusString(long timeVal,
                                            StatusLevelTag sLevel)
Returns a String indicating which subset-of-stations sets contain stations that are all at the given status level as of the given server time value (if no sets then an empty string is returned).

Parameters:
timeVal - a server epoch time value (seconds since 1/1/1970).
sLevel - the status level to use.
Returns:
An ASCII string formatted as follows: ';"PPPP",#,"VVVV";...' where PPPP is the name of a property item, '#' is a comparison code and VVVV is a value for the property. Any number of name,code,value items may be passed. There should be no semicolon (';') after the last item.

toString

public java.lang.String toString()
Returns this property item's name.

Overrides:
toString in class java.lang.Object