com.isti.trinetwatch.controlAgentSim
Class CtaSimToS_provider

java.lang.Object
  extended byorg.omg.CORBA.portable.ObjectImpl
      extended byorg.omg.CORBA.DynamicImplementation
          extended byorg.omg.CosEventComm._PushSupplierImplBase
              extended bycom.isti.trinetwatch.controlAgentSim.CtaSimToS_provider
All Implemented Interfaces:
org.omg.CORBA.Object, org.omg.CosEventComm.PushSupplier

public class CtaSimToS_provider
extends org.omg.CosEventComm._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.


Field Summary
 
Fields inherited from class org.omg.CosEventComm._PushSupplierImplBase
 
Constructor Summary
(package private) CtaSimToS_provider(org.omg.CORBA.ORB orb, com.ooc.CORBA.BOA boa, org.omg.CosEventComm.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 org.omg.CosEventComm._PushSupplierImplBase
_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

CtaSimToS_provider

CtaSimToS_provider(org.omg.CORBA.ORB orb,
                   com.ooc.CORBA.BOA boa,
                   org.omg.CosEventComm.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.