com.isti.trinetwatch.controlAgentSim
Class CtaSimToS_provider

java.lang.Object
  extended by _PushSupplierImplBase
      extended by com.isti.trinetwatch.controlAgentSim.CtaSimToS_provider

public class CtaSimToS_provider
extends _PushSupplierImplBase

Class CtaToS_provider sends the necessary responses to requests for changing the usage level of a given station. The format of the responses is:

'CTRL_RESULT:SSSSS:ID:AGENT:COMMAND:ARGS'
where SSSSS is the station name, ID is the id of the cta message manager in the NSI, AGENT is the name of the replying control agent, and COMMAND:ARGS is the result command and its return arguments. ARGS is optional.

There are currently four possible CTRL_RESULT messages:

1. ACK -- This command is returned by the CTA controling the station to acknowledge the receit of a CTRL_MSG request. Its argument syntax is:

ACK:USAGE:TIMEOUT


where USAGE is the desired usage echoed back and TIMEOUT is the maximum number of seconds the control operation will requre to complete.

2. DONE -- The DONE result command is returned by the CTA once the usage level change operation is complete. This result command has no argments.

3. FAILURE -- The FAILURE result command is returned by the CTA if the usage level change does not happen successfully. That is, the script or program being executed exits abnormally (non-zero exit status).

4. TIMEOUT -- The TIMEOUT result command is returned by the CTA if the script or program being executed has not returned after the advertised timeout indicating a problem or a poorly defined timeout setting.


Constructor Summary
CtaSimToS_provider(org.omg.CORBA.ORB orb, com.ooc.CORBA.BOA boa, PushConsumer sConsumer, ControlAgentSim ctaObj)
          Creates an object of CtaSimToS_provider.
 
Method Summary
 void disconnect_push_supplier()
          Disconnect from the event channel.
 void sendAckMessage(java.lang.String stationName, java.lang.String msgManId, int uLevel, int timeoutLen)
          Sends an ack message to the NSI server.
 void sendDoneMessage(java.lang.String stationName, java.lang.String msgManId)
          Sends a done message to the NSI server.
 void sendFailureMessage(java.lang.String stationName, java.lang.String msgManId)
          Sends failure message to the NSI server.
 void sendInProgressMessage(java.lang.String stationName, java.lang.String msgManId)
          Sends in-progress message to the NSI server.
 void sendTimeoutMessage(java.lang.String stationName, java.lang.String msgManId)
          Sends timeout message to the NSI server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CtaSimToS_provider

CtaSimToS_provider(org.omg.CORBA.ORB orb,
                   com.ooc.CORBA.BOA boa,
                   PushConsumer sConsumer,
                   ControlAgentSim ctaObj)
Creates an object of CtaSimToS_provider.

Parameters:
orb - A handle to the orb which controls the event channels.
boa - A handle to the boa being used.
sConsumer - A handle to the channel to be used.
ctaObj - A handle to the ControlAgentSim object.
Method Detail

disconnect_push_supplier

public void disconnect_push_supplier()
Disconnect from the event channel.


sendAckMessage

public void sendAckMessage(java.lang.String stationName,
                           java.lang.String msgManId,
                           int uLevel,
                           int timeoutLen)
Sends an ack message to the NSI server.

Parameters:
stationName - A string holding the station name.
msgManId - A string containing the id of the NSI cta message manager.
uLevel - An int holding the requested usage level.
timeoutLen - An int representing the maximum length of time necessary to complete the usage level change.

sendDoneMessage

public void sendDoneMessage(java.lang.String stationName,
                            java.lang.String msgManId)
Sends a done message to the NSI server.

Parameters:
stationName - A string holding the station name.
msgManId - A string containing the id of the NSI cta message manager.

sendFailureMessage

public void sendFailureMessage(java.lang.String stationName,
                               java.lang.String msgManId)
Sends failure message to the NSI server.

Parameters:
stationName - A string holding the station name.
msgManId - A string containing the id of the NSI cta message manager.

sendTimeoutMessage

public void sendTimeoutMessage(java.lang.String stationName,
                               java.lang.String msgManId)
Sends timeout message to the NSI server.

Parameters:
stationName - A string holding the station name.
msgManId - A string containing the id of the NSI cta message manager.

sendInProgressMessage

public void sendInProgressMessage(java.lang.String stationName,
                                  java.lang.String msgManId)
Sends in-progress message to the NSI server.

Parameters:
stationName - A string holding the station name.
msgManId - A string containing the id of the NSI cta message manager.