FourMS
Class UpdateOpticalComponentList

java.lang.Object
  extended by FourMS.SequenceSubaction
      extended by FourMS.UpdateOpticalComponentList
All Implemented Interfaces:
SubActionCompletionListenerOperations, SubActionOperations, java.lang.Runnable

public class UpdateOpticalComponentList
extends SequenceSubaction
implements java.lang.Runnable, SubActionOperations

This is an subaction which can be used to update the noticeboard items which hold the details of the optical components for each of the mechanisms which can hold optical components which are located in a specified instrument controller system.

As part of the initialisation sequence, the details of all of the mechanisms which contain optical components are passed into the constructor so when the subaction is invoked, it can calculate which optical components it needs to update in the noticeboard. The data relating to the optical components is stored in the ICS database.

Version:
$Id: UpdateOpticalComponentList.java,v 1.5 2006/04/07 08:03:30 cb Exp $
Author:
Craige Bevil

Nested Class Summary
(package private)  class UpdateOpticalComponentList.SQLAccessClass
          Inner class which is used to store the details of how we will use SQL to access the data asssociated with the optical components in the selectable mechanisms
 
Field Summary
private  java.sql.Connection DBConnection
          This an active connection to the ICS databas which will be used to establish the optical qualities of the optical component which is currently in the optical component wheel
(package private)  OpticalComponent[] OpticalMechanisms
          These are the names and number of slots in each of the optical components which need to maintained.
private  iParameterNoticeBoard.ParameterNoticeBoardSupplier ParameterNoticeBoard
          This is a reference to the remote proxy CORBA object which will be used to access the parameter notice board.
(package private)  java.util.Hashtable<OpticalComponentType,UpdateOpticalComponentList.SQLAccessClass> SQLAccess
          This holds the details of the how to access the data in the OCS data in order to extract details of the different selectable mechanisms
 
Fields inherited from class FourMS.SequenceSubaction
ActionCompletionListener, ActionCompletionListenerImpl, ActionState, ExpectedNoOfArgs, InstrumentName, NumberOfSubactionsInSequenceOutstanding, Orb, Poa, RootNamingServiceContext, SecondsBeforeTimeout, SequenceSubActionInitiatorCB, SequenceSubactionName, SubactionArgumentList, SubactionThread, SyslogMessageHandler, TimeOut
 
Constructor Summary
UpdateOpticalComponentList(java.lang.String SequenceSubactionName, java.lang.String InstrumentName, java.sql.Connection DBConnection, org.omg.PortableServer.POA Poa, org.omg.CORBA.ORB Orb, MessageHandler SyslogMessageHandler, org.omg.CosNaming.NamingContextExt RootNamingServiceContext, iParameterNoticeBoard.ParameterNoticeBoardSupplier ParameterNoticeBoard, OpticalComponent[] OpticalMechanisms)
          The constructor
 
Method Summary
 boolean cancelAction()
          This is part of the interface to the SubActions operations which we are bound to implement, it results in the subaction being cancelled but in effect does nothing as this action is completed immediately as it only interacts with the software controller and not the 4MS itself
 void run()
          This is the run method, we must implement this method as the subclass is extends the TimerTask class.
 boolean startAction(java.lang.String[] subactionArgs, SubActionCompletionListener subActionInitiator)
          This method starts the subaction, no arguments are expected in the subaction array.
 
Methods inherited from class FourMS.SequenceSubaction
informSubactionInitiator, informSubactionInitiator, registerSubactionInNameService, returnResult, subActionEnded, waitForActionToComplete
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SQLAccess

java.util.Hashtable<OpticalComponentType,UpdateOpticalComponentList.SQLAccessClass> SQLAccess
This holds the details of the how to access the data in the OCS data in order to extract details of the different selectable mechanisms


OpticalMechanisms

OpticalComponent[] OpticalMechanisms
These are the names and number of slots in each of the optical components which need to maintained.


DBConnection

private java.sql.Connection DBConnection
This an active connection to the ICS databas which will be used to establish the optical qualities of the optical component which is currently in the optical component wheel


ParameterNoticeBoard

private iParameterNoticeBoard.ParameterNoticeBoardSupplier ParameterNoticeBoard
This is a reference to the remote proxy CORBA object which will be used to access the parameter notice board.

Constructor Detail

UpdateOpticalComponentList

public UpdateOpticalComponentList(java.lang.String SequenceSubactionName,
                                  java.lang.String InstrumentName,
                                  java.sql.Connection DBConnection,
                                  org.omg.PortableServer.POA Poa,
                                  org.omg.CORBA.ORB Orb,
                                  MessageHandler SyslogMessageHandler,
                                  org.omg.CosNaming.NamingContextExt RootNamingServiceContext,
                                  iParameterNoticeBoard.ParameterNoticeBoardSupplier ParameterNoticeBoard,
                                  OpticalComponent[] OpticalMechanisms)
The constructor

Parameters:
SequenceSubactionName - This is the name of the subaction sequence for reporting purposes, this should correspond to the name that is given to the object in the name service
InstrumentName - This is the name of the instrument to which this subaction is associated
Poa - This is a reference to the POA to be used by this object
Orb - This is a reference to the ORB
SyslogMessageHandler - A syslog message handler which will be used for error reporting
RootNamingServiceContext - This is a reference to the root context of the naming service so that we can
OpticalMechanisms - This contains the details of the all of the mechanisms in this 4MS system which contain optical components which need to be maintained.
Method Detail

startAction

public boolean startAction(java.lang.String[] subactionArgs,
                           SubActionCompletionListener subActionInitiator)
                    throws SubActionInProgressException,
                           UnableToStartSubactionException
This method starts the subaction, no arguments are expected in the subaction array. The subaction goes through each of the mechanisms which have been specified in the OpticalMechanisms attribute and consults the database in order to establish the optical components which are in each of the slots of that mechanism. Then the details of the optical components are dropped into the noticeboard in the form instrumentName.mechanism.FILTERi where i varies by optical component slot number in the optical component mechanism.

Specified by:
startAction in interface SubActionOperations
Overrides:
startAction in class SequenceSubaction
Parameters:
subactionArgs - - This is a list of the arguments which pertain to this subaction. No arguments are expected
subActionInitiator - - This is a reference to the object that has started the subaction and must implement the iActionFinishedInterface. The subaction will rely on this interface in order to inform the initiator that the subaction has terminated.
Returns:
boolean
Throws:
SubActionInProgressException - Thrown if the subaction is already in progress when the caller attempts to initiate the action.
UnableToStartSubactionException - Thrown when there is a problem initiating the subaction

cancelAction

public boolean cancelAction()
                     throws SubActionNotInProgressException
This is part of the interface to the SubActions operations which we are bound to implement, it results in the subaction being cancelled but in effect does nothing as this action is completed immediately as it only interacts with the software controller and not the 4MS itself

Specified by:
cancelAction in interface SubActionOperations
Overrides:
cancelAction in class SequenceSubaction
Returns:
boolean
Throws:
SubActionNotInProgressException

run

public void run()
This is the run method, we must implement this method as the subclass is extends the TimerTask class. It is a null method in the case of this subaction.

Specified by:
run in interface java.lang.Runnable