com.isti.trinetwatch.server
Class GUIServices_impl

java.lang.Object
  extended byorg.omg.CORBA.portable.ObjectImpl
      extended byorg.omg.CORBA.DynamicImplementation
          extended bycom.isti.trinetwatch.server.gui_services._GUIServicesImplBase
              extended bycom.isti.trinetwatch.server.GUIServices_impl
All Implemented Interfaces:
GUIServices, org.omg.CORBA.Object

public class GUIServices_impl
extends _GUIServicesImplBase

Class GUIServices implements the GUI services. All the methods that can be called through CORBA could potentially return an empty string. This universally occurs when one of these methods is called after the disconnect() method is called and before the server has time to realize it should no longer be accepting connections. Some of the methods may return empty strings for other reasons as well.


Field Summary
 
Fields inherited from class com.isti.trinetwatch.server.gui_services._GUIServicesImplBase
 
Constructor Summary
GUIServices_impl(Server sObj, java.lang.String clientID, long inactivityTimeout)
          Create a new GUIServices_impl object.
 
Method Summary
 void checkInactivityTimeout()
          Non-CORBA, Checks to see if enough time has passed since the last client activity to declare an inactivity timeout, and disconnect the client.
 void disconnect()
          Disconnects the calling GUI-client from the NSI server.
 java.lang.String getAgentInfo(java.lang.String agentName, int timeVal)
          Returns information about the given agent.
 java.lang.String getAgentNames(boolean longNamesFlag)
          Returns the names of all the agents reporting to the server.
 java.lang.String getAllStationsUpdate(int timeVal)
          Returns an update on all stations that have changed status or usage since the given time value.
 boolean getConnectedFlag()
          Non-CORBA, Returns the value of connected-to-ORB flag.
 boolean getDisPendingFlag()
          Non-CORBA, Returns the value of disconnect-pending flag.
 java.lang.String getExtendedAllStationsUpdate(int timeVal)
          Returns an update on all stations that have changed status or usage since the given time value.
 java.lang.String getHelpString()
          Gets the general help string.
 java.lang.String getIDString()
          Non-CORBA, Returns the ID of the client (the ip address).
 java.lang.String getNSIStartTime()
          Returns the local start time of the NSI server as a string.
 java.lang.String getNSIVersionString()
          Gets the version string of the NSI server.
 java.lang.String getParameterCompSet(java.lang.String stationName, java.lang.String paramName)
          Returns the comparison set for the given parameter from the given station (for its current usage level).
 java.lang.String getParameterHelpString(java.lang.String paramName)
          Gets the help string for the given parameter.
 java.lang.String getParameterHistory(java.lang.String stationName, java.lang.String paramName, int startSecs, int endSecs)
          Returns a set of values and timestamps representing the "history" of the given parameter from the given station.
 void getParameterInformation(java.lang.String stationName, java.lang.String paramName, org.omg.CORBA.LongHolder startSecs, org.omg.CORBA.LongHolder endSecs, org.omg.CORBA.IntHolder numPoints)
          Returns information for the given parameter from the given station.
 java.lang.String getPropertyList()
          Returns a list of property strings to be used in a selection combo-box used to display a subset of stations.
 java.lang.String getPropValuesList(java.lang.String propString)
          Returns a list of values strings to be used in a selection combo-box with the given property, to select a subset of stations.
 java.lang.String getSameStatusSubsets(int timeVal, java.lang.String statusLevelStr)
          Returns a String indicating all the subset-of-stations sets that contain stations that are all at the given status level as of the given server time value.
 java.lang.String getServerName()
          Gets the name of the server that this NSI server is receiving its data from.
 java.lang.String getStationChgdParams(java.lang.String stationName, int timeVal)
          Returns, for the given station, an update of dynamic parameters that have changed their status level since the given time value.
 java.lang.String getStationHelpString(java.lang.String stationName)
          Gets the help string for the given station.
 java.lang.String getStationInfo(java.lang.String stationName)
          Returns a dataset for the station containing detailed information items that are static in nature.
 java.lang.String getStationSnapshot(java.lang.String stationName, int timeVal)
          Returns an historical snapshot for the given station of detailed information items (that are of a dynamic nature) at the given time value.
 java.lang.String getStationUpdate(java.lang.String stationName, int timeVal)
          Returns an update for the given station of detailed information items that are of a dynamic nature and have changed since the given time value.
 java.lang.String getStatusLevelTable()
          Returns the table of status level objects.
 java.lang.String getSubsetStationsList(java.lang.String propString, int compCode, java.lang.String valueString)
          Returns a list of stations that match the given criteria.
 java.lang.String getSubsetStationsUpdate(int timeVal, java.lang.String propString, int compCode, java.lang.String valueString)
          Returns an update on all stations that match the given criteria and that have changed status or usage since the given time value.
 java.lang.String getUsageLevelTable()
          Returns the table of usage level objects.
 java.lang.String getUsageResult(java.lang.String stationName)
          Returns the final result of the last call to 'setStationUsage()' for the given station.
 int getUsageTimeout(java.lang.String stationName)
          Returns the timeout value associated with the last call to 'setStationUsage()' for the given station.
 void setConnectedFlag(boolean flagVal)
          Non-CORBA, Set the connected-to-ORB flag.
 java.lang.String setStationUsage(java.lang.String stationName, java.lang.String uLevelStr)
          Sets the usage level for a given station.
 
Methods inherited from class com.isti.trinetwatch.server.gui_services._GUIServicesImplBase
_ids, invoke
 
Methods inherited from class org.omg.CORBA.portable.ObjectImpl
_create_request, _create_request, _duplicate, _get_delegate, _get_domain_managers, _get_interface_def, _get_policy, _hash, _invoke, _is_a, _is_equivalent, _is_local, _non_existent, _orb, _release, _releaseReply, _request, _request, _servant_postinvoke, _servant_preinvoke, _set_delegate, _set_policy_override, equals, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.omg.CORBA.Object
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface_def, _get_policy, _hash, _is_a, _is_equivalent, _non_existent, _release, _request, _set_policy_override
 

Constructor Detail

GUIServices_impl

public GUIServices_impl(Server sObj,
                        java.lang.String clientID,
                        long inactivityTimeout)
Create a new GUIServices_impl object.

Parameters:
sObj - A handle to a Server object.
clientID - A string containing the client ID. It should be the client's IP address.
inactivityTimeout - number of seconds of client inactivity before a timeout occurs (and the client is disconnected).
Method Detail

getUsageLevelTable

public java.lang.String getUsageLevelTable()
Returns the table of usage level objects.

Returns:
An ASCII string formatted as follows: 'NNNN:VV,CCCC,"DDDD";...' where NNNN is a usage level tag name, VV is a numeric value, CCCC is a numeric RGB color value and DDDD is a description. (The DDDD item is optional.) Any number of name/value/color/description groups may be passed. There should be no semi-colon (';') after the last group.

getStatusLevelTable

public java.lang.String getStatusLevelTable()
Returns the table of status level objects.

Returns:
An ASCII string formatted in the same manor as that for getUsageLevelTable(), except with a status level tag name.

getAllStationsUpdate

public java.lang.String getAllStationsUpdate(int timeVal)
Returns an update on all stations that have changed status or usage since the given time value. Initially called with a time value of zero to get a list containing name, usage and status for all stations.

Parameters:
timeVal - a server epoch time value (seconds since 1/1/1970).
Returns:
An ASCII string formatted as follows: TTTT;NNNN:SSSSS,UUUUU;... where TTTT is the current server time (to be used in subsequent calls), NNNN is a station name (short station name, 1-5 chars), SSSSS is a status level tag name, and UUUUU is a usage level tag name. Any number of station/status/usages groups may be passed. There should be no semi-colon (';') after the last group.

getExtendedAllStationsUpdate

public java.lang.String getExtendedAllStationsUpdate(int timeVal)
Returns an update on all stations that have changed status or usage since the given time value. Initially called with a time value of zero to get a list containing name, usage and status for all stations.

Parameters:
timeVal - a server epoch time value (seconds since 1/1/1970).
Returns:
An ASCII string formatted as follows: TTTT;NNNN:SSSSS,UUUUU;... TTTT;NNNN:SSSSS,UUUUU:LL=LAT,LON... if extended information is available (all extended information is optional), where TTTT is the current server time (to be used in subsequent calls), NNNN is a station name (short station name, 1-5 chars), SSSSS is a status level tag name, UUUUU is a usage level tag name, LAT is the station latitude and LON is the station longitude. For the final string in the information a termination of end of string, semi-colon (';') or colon (':') should be used. For example the usage level (UUUUU) text may be terminated by the end of the string, the semi-colon (';') for the next station or the colon (':') for the next extended information entry. The same is true for the last value of any extended extries such as the longitude (LON) entry if it is supplied. Any number of station/status/usages groups may be passed. There should be no semi-colon (';') after the last group.

getStationInfo

public java.lang.String getStationInfo(java.lang.String stationName)
Returns a dataset for the station containing detailed information items that are static in nature.

Parameters:
stationName - the name of the desired station.
Returns:
An ASCII string formatted as follows: 'NNNN;"PPPP":"VVVV";...' where NNNN is the short name of the station, PPPP is the name of a static (or configuration) parameter, and VVVV is the value of that parameter. Any number of parameter name/value groups may be passed. If there are no static parameters available then only the name string will be passed back to the caller. There should be no semi-colon (';') after the last parameter.

getStationUpdate

public java.lang.String getStationUpdate(java.lang.String stationName,
                                         int timeVal)
Returns an update for the given station of detailed information items that are of a dynamic nature and have changed since the given time value. Initially called with a time value of zero to get a complete list of detailed information items.

Parameters:
stationName - the name of the desired station.
timeVal - a server epoch time value (seconds since 1/1/1970).
Returns:
An ASCII string formatted as follows: 'TTTT;NNNN;"PPPP":"VVVV",SSSS;...' where TTTT is the current server time (to be used in subsequent calls), NNNN is the short station name, PPPP is the name of a dynamic parameter, VVVV is the value of the dynamic parameter and SSSS is the status level tag name for the dynamic parameter (SSSS may be omitted). Any number of dynamic parameter name/value/status groups may be passed. There should be no semi-colon (';') after the last group.

getStationChgdParams

public java.lang.String getStationChgdParams(java.lang.String stationName,
                                             int timeVal)
Returns, for the given station, an update of dynamic parameters that have changed their status level since the given time value.

Parameters:
stationName - the name of the desired station.
timeVal - a server epoch time value (seconds since 1/1/1970).
Returns:
An ASCII string formatted as follows: 'TTTT;NNNN;"PPPP":"PVVV",PSSS,"VVVV",SSSS;...' where TTTT is the current server time, NNNN is the short station name, PPPP is the name of a dynamic parameter, PVVV is the previous value of the dynamic parameter, PSSS is the previous status level tag name for the dynamic parameter, VVVV is the current value of the dynamic parameter and SSSS is the current status level tag name for the dynamic parameter. Any number of dynamic parameter name/value/status/value/status groups may be passed. There should be no semi-colon (';') after the last group.

getPropertyList

public java.lang.String getPropertyList()
Returns a list of property strings to be used in a selection combo-box used to display a subset of stations.


getPropValuesList

public java.lang.String getPropValuesList(java.lang.String propString)
Returns a list of values strings to be used in a selection combo-box with the given property, to select a subset of stations.

Parameters:
propString - A string representing the selected property.
Returns:
An ASCII string which contains the list of value strings, and an indicator of which comparison codes may be used with the given property. The format of the string is as follows: '#;"VVVV",...' where '#' is a number representing the valid comparison codes for these property values, and '"VVVV"' represents one value of the given property. Multiple values may be passed separated by commas. There will be no comma at the end of the string. A return string containing a number and no values indicates that the value should be entered by the user. An empty return string indicates that no values could be generated for the given property.

getSubsetStationsList

public java.lang.String getSubsetStationsList(java.lang.String propString,
                                              int compCode,
                                              java.lang.String valueString)
Returns a list of stations that match the given criteria.

Parameters:
propString - a string representing the selected property.
compCode - a comparison code, one of the following: -2 = less than, -1 = less than or equals, 0 = equals, 1 = greater than or equals, 2 = greater than.
valueString - a string representing the value entered or selected by the user.
Returns:
A formatted ASCII string of station names separated by commas, or an empty string if no matching stations could be found.

getSubsetStationsUpdate

public java.lang.String getSubsetStationsUpdate(int timeVal,
                                                java.lang.String propString,
                                                int compCode,
                                                java.lang.String valueString)
Returns an update on 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).
propString - a string representing the selected property.
compCode - a comparison code, one of the following: -2 = less than, -1 = less than or equals, 0 = equals, 1 = greater than or equals, 2 = greater than.
valueString - a string representing the value entered or selected by the user.
Returns:
A formatted ASCII string of station names separated by commas, or an empty string if no matching stations could be found.

setStationUsage

public java.lang.String setStationUsage(java.lang.String stationName,
                                        java.lang.String uLevelStr)
Sets the usage level for a given station. The method does not wait for the final confirmation of the usage level change. (See 'getUsageResult()'.)

Parameters:
stationName - the name of the desired station.
uLevelStr - the name of the new usage level for the station.
Returns:
An empty string if the action was successful, or a text error message string if an error was detected.

getUsageResult

public java.lang.String getUsageResult(java.lang.String stationName)
Returns the final result of the last call to 'setStationUsage()' for the given station.

Parameters:
stationName - the name of the desired station.
Returns:
A text message string decribing the final result of the attempted level change, or an empty string if the action is still in progress.

getUsageTimeout

public int getUsageTimeout(java.lang.String stationName)
Returns the timeout value associated with the last call to 'setStationUsage()' for the given station.

Parameters:
stationName - the name of the desired station.
Returns:
The timeout value, in seconds, for the usage control change operation in progress; or -1 if the timeout value has not been set (not yet received from the control agent) or if a timeout value cannot be generated for the station name.

getNSIVersionString

public java.lang.String getNSIVersionString()
Gets the version string of the NSI server.

Returns:
the version string of the NSI server.

getNSIStartTime

public java.lang.String getNSIStartTime()
Returns the local start time of the NSI server as a string.

Returns:
A string representation of the start time, using the following format: "Mmm dd, yyyy hh:mm:ss".

getHelpString

public java.lang.String getHelpString()
Gets the general help string.

Returns:
the general help string.

getStationHelpString

public java.lang.String getStationHelpString(java.lang.String stationName)
Gets the help string for the given station.

Parameters:
stationName - A string containing the short name of the station from which you want a help string.
Returns:
the help string for the given station.

getParameterHelpString

public java.lang.String getParameterHelpString(java.lang.String paramName)
Gets the help string for the given parameter.

Parameters:
paramName - the name of the specified parameter.
Returns:
the help string for the given parameter. If no help string is available then an empty string is returned.

getServerName

public java.lang.String getServerName()
Gets the name of the server that this NSI server is receiving its data from.

Returns:
the name of the server that this NSI server is receiving its data from.

getParameterInformation

public void getParameterInformation(java.lang.String stationName,
                                    java.lang.String paramName,
                                    org.omg.CORBA.LongHolder startSecs,
                                    org.omg.CORBA.LongHolder endSecs,
                                    org.omg.CORBA.IntHolder numPoints)
Returns information for the given parameter from the given station.

Parameters:
stationName - the name of the desired station.
paramName - the name of the specified parameter.
startSecs - starting seconds of the history.
endSecs - ending seconds of the history.
numPoints - number of points in the history. If no match was found then numPoints will be 0.

getParameterHistory

public java.lang.String getParameterHistory(java.lang.String stationName,
                                            java.lang.String paramName,
                                            int startSecs,
                                            int endSecs)
Returns a set of values and timestamps representing the "history" of the given parameter from the given station.

Parameters:
stationName - the name of the desired station.
paramName - the name of the specified parameter.
startSecs - number of seconds before the present for the start time of the range, or 0 for the beginning of the history.
endSecs - number of seconds before the present for the end time of the range, or 0 for the end of the history.
Returns:
An ASCII string formatted as follows: '"VVVV",TTTT;...' where VVVV is the value of the dynamic parameter and TTTT is the server time value (in seconds since 1/1/1970) associated with the value preceding it. Any number of value/time groups may be passed. There should be no semi-colon (';') after the last group. If no matching value/time groups were found then an empty string is returned.

getParameterCompSet

public java.lang.String getParameterCompSet(java.lang.String stationName,
                                            java.lang.String paramName)
Returns the comparison set for the given parameter from the given station (for its current usage level). The comparison set consists of groups of value/status-level pairs.

Parameters:
stationName - the name of the desired station.
paramName - the name of the specified parameter.
Returns:
An ASCII string formatted as follows: '"VVVV","SSSS";...' where VVVV is a dynamic parameter value and SSSS is the status level name associated with the value preceding it. Any number of value/status-level groups may be passed. There should be no semi-colon (';') after the last group. If no matching groups were found then an empty string is returned.

getAgentNames

public java.lang.String getAgentNames(boolean longNamesFlag)
Returns the names of all the agents reporting to the server.

Parameters:
longNamesFlag - if true then the "long" versions of the agent names are returned; otherwise the "short" versions are returned.
Returns:
An ASCII string formatted as follows: 'NNNN",...' where NNNN is an agent name, any number of which may be returned. There should be no comma (',') after the last name.

getAgentInfo

public java.lang.String getAgentInfo(java.lang.String agentName,
                                     int timeVal)
Returns information about the given agent.

Parameters:
agentName - the name of the given agent; may be the "short" or the "long" name of the agent.
timeVal - if zero then all property items are returned; if non-zero then only dynamic property items are returned.
Returns:
An ASCII string formatted as follows: '"NNNN"="VVVV";...' where NNNN is the name of a property and VVVV represents its value. Any number of property name/value pairs may be returned. There should be no semi-colon (';') after the last property.

getSameStatusSubsets

public java.lang.String getSameStatusSubsets(int timeVal,
                                             java.lang.String statusLevelStr)
Returns a String indicating all the subset-of-stations sets that contain stations that are all at the given status level as of the given server time value.

Parameters:
timeVal - a server epoch time value (seconds since 1/1/1970).
statusLevelStr - the name of the status level to use.
Returns:
An ASCII string formatted as follows: 'TTTT;"PPPP",#,"VVVV";...' where TTTT is the current server time (to be used in subsequent calls), 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. If no sets then just the server time is returned. If error (such as bad 'statusLevelStr') then an empty string is returned.

getStationSnapshot

public java.lang.String getStationSnapshot(java.lang.String stationName,
                                           int timeVal)
Returns an historical snapshot for the given station of detailed information items (that are of a dynamic nature) at the given time value.

Parameters:
stationName - name of the desired station.
timeVal - server epoch time value (seconds since 1/1/1970).
Returns:
An ASCII string formatted as follows: 'NNNN;"PPPP":"VVVV",SSSS;...' where NNNN is the short station name, PPPP is the name of a dynamic parameter, VVVV is the value of the dynamic parameter and SSSS is the status level tag name for the dynamic parameter (SSSS may be omitted). Any number of dynamic parameter name/value/status groups may be passed. There should be no semi-colon (';') after the last group.

disconnect

public void disconnect()
Disconnects the calling GUI-client from the NSI server.


setConnectedFlag

public void setConnectedFlag(boolean flagVal)
Non-CORBA, Set the connected-to-ORB flag.

Parameters:
flagVal - true = connected, false = not connected

getConnectedFlag

public boolean getConnectedFlag()
Non-CORBA, Returns the value of connected-to-ORB flag.

Returns:
true if connected, false otherwise

getDisPendingFlag

public boolean getDisPendingFlag()
Non-CORBA, Returns the value of disconnect-pending flag.

Returns:
true if disconnect pending (waiting for disconnection), false otherwise

getIDString

public java.lang.String getIDString()
Non-CORBA, Returns the ID of the client (the ip address).

Returns:
The ID string of the client (it's ip address)

checkInactivityTimeout

public void checkInactivityTimeout()
Non-CORBA, Checks to see if enough time has passed since the last client activity to declare an inactivity timeout, and disconnect the client.