jpl.mipl.cassini.CDRS.servers
Class CDRSSubControl_Impl

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.activation.Activatable
              extended by jpl.mipl.cassini.CDRS.servers.CDRSServerBase_Impl
                  extended by jpl.mipl.cassini.CDRS.servers.CDRSMonitorableServerBase_Impl
                      extended by jpl.mipl.cassini.CDRS.servers.CDRSSubControl_Impl
All Implemented Interfaces:
Serializable, Remote, CDRSMonitorableServerBase, CDRSServerBase, CDRSSubControl

public class CDRSSubControl_Impl
extends CDRSMonitorableServerBase_Impl
implements CDRSSubControl

Purpose: CDRS SubControl is responsible for running tasks. Upon receiving a request for job execution, the sub control creates the upf file and passes it to the tasks object. The task object then looks into the rules table to find out those tasks that it should run and starts running tasks from correct tasks (skipping those that may have been ran before).

  <b>
       Copyright 2002, California Institute of Technology.
       ALL RIGHTS RESERVED.
       U.S. Government Sponsorship acknowledge.2002.
  
       CASSINI Downlink and Reconciliation Subsystem
   </b>
   ============================================================================
   <b>Modification History :</b>
   --------------------
  
   <b>Date        Who        What</b>
   ----------------------------------------------------------------------------
   05/04/2002     Alice      Initial Release
   06/20/2002     Raj        Made modifications to make code clean.
   09/04/2002     Raj        Bug fixes to createUPF: = between LOG_DIR and
                             value. Removed VIMS_/ISS_SOFTWARE_VERION key.
   09/04/2002     Raj        Added new fei file types keyword to the UPF.
   04/04/2003     Raj        Removed use of ldap filter from upf as per DAR
                             CDRS_REMOVED_LDAP_FILTER
   05/13/2003     Raj        Modifed to only specify INSTRUMENT, STREAM_NAME
                             and INSTRUMENT_ID once in UPF. Also,
                             the DB_USER_NAME was using dbName's value from
                             jobConfig instread of userName.
   11/25/2003     Raj        Modified to specify BOT and EOT into the UPF to
                             be used by SWAt.
   ============================================================================
 

Version:
09.12.2002-D29.0.2
Author:
Alice Stanboli (ays@mipl.jpl.nasa.gov), Raj Patel (rrp@mipl.jpl.nasa.gov)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class jpl.mipl.cassini.CDRS.servers.CDRSMonitorableServerBase_Impl
logger_
 
Fields inherited from class jpl.mipl.cassini.CDRS.servers.CDRSServerBase_Impl
dbConnection_, dbConnectionRequest_, serverId_, serverName_, startUpData_, stateSeparator_
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Fields inherited from interface jpl.mipl.cassini.CDRS.servers.CDRSServerBase
CDRSControlId, CDRSFirstServerId, CDRSGapReportServerId, CDRSInvalidServerId, CDRSLastServerId, CDRSLoggerId, CDRSPrimaryMonitorId, CDRSPRPId, CDRSRequestAnalyzerId, CDRSSchedulerId, CDRSSecondaryMonitorId, CDRSServerNames, CDRSSubControlId
 
Constructor Summary
CDRSSubControl_Impl(ActivationID activationid, MarshalledObject marshalledobject)
           
 
Method Summary
 void doPeriodicWork()
          Called to do periodic work like checking database for work.
 void doWorkOnGroup(int groupId)
           
 int getCurrentLoad()
           
 short getSCID()
           
 String[] getState()
          To be used by GUI for displaying server's state.
 String[] getStateLabels()
          This method returns the label values corresponding to the values returned by getState() method.
 boolean handlesJobType(String jobType)
           
 boolean isAssigned(CDRSReqJobElement r)
          Return true if job is currently assigned to this subcontrol.
 void reassignTask(CDRSTask task)
          Reassign task.
 void refresh()
          Used to refresh object references or other related things that need to be obtained from database or naming service when stating up.
 void release(CDRSTask t, CDRSReqJobElement e)
          Remove a task from list.
protected  void restoreStateFromDB()
          This methods obtains the : separated state stored in initialData field of the processConfig table, parses it and passes the retrived fields as string to setState() method.
 boolean runJob(Properties jobRecord)
           
protected  void setState(String[] state)
          For restoring state from data base.
 boolean shutdown(boolean forceIt)
          Shutdown the thread that calls doPeriodicWork regularly.
protected  void storeStateInDB()
          Writes server state, as : separated string in the initialData field of the subControlConfig table.
 
Methods inherited from class jpl.mipl.cassini.CDRS.servers.CDRSMonitorableServerBase_Impl
getPingFrequency, setPingFrequency, shutDownThreads, startup, wakeUp
 
Methods inherited from class jpl.mipl.cassini.CDRS.servers.CDRSServerBase_Impl
closeDBCondConn, closeDBConnection, finalize, openDBCondConn, openDBConnection, updateState
 
Methods inherited from class java.rmi.activation.Activatable
exportObject, exportObject, exportObject, exportObject, getID, inactive, register, unexportObject, unregister
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jpl.mipl.cassini.CDRS.servers.CDRSMonitorableServerBase
getPingFrequency, setPingFrequency, wakeUp
 
Methods inherited from interface jpl.mipl.cassini.CDRS.servers.CDRSServerBase
startup, updateState
 

Constructor Detail

CDRSSubControl_Impl

public CDRSSubControl_Impl(ActivationID activationid,
                           MarshalledObject marshalledobject)
                    throws RemoteException,
                           ActivationException,
                           SQLException,
                           NamingException,
                           ClassNotFoundException
Throws:
RemoteException
ActivationException
SQLException
NamingException
ClassNotFoundException
Method Detail

getStateLabels

public String[] getStateLabels()
                        throws RemoteException
Description copied from interface: CDRSServerBase
This method returns the label values corresponding to the values returned by getState() method.

Specified by:
getStateLabels in interface CDRSServerBase
Throws:
RemoteException

refresh

public void refresh()
             throws RemoteException
Description copied from interface: CDRSMonitorableServerBase
Used to refresh object references or other related things that need to be obtained from database or naming service when stating up.

Specified by:
refresh in interface CDRSMonitorableServerBase
Overrides:
refresh in class CDRSMonitorableServerBase_Impl
Throws:
RemoteException

getSCID

public short getSCID()
              throws RemoteException
Specified by:
getSCID in interface CDRSSubControl
Throws:
RemoteException

runJob

public boolean runJob(Properties jobRecord)
               throws RemoteException
Specified by:
runJob in interface CDRSSubControl
Throws:
RemoteException

doPeriodicWork

public void doPeriodicWork()
                    throws RemoteException
Description copied from interface: CDRSMonitorableServerBase
Called to do periodic work like checking database for work.

Specified by:
doPeriodicWork in interface CDRSMonitorableServerBase
Throws:
RemoteException

doWorkOnGroup

public void doWorkOnGroup(int groupId)
                   throws Exception
Throws:
Exception

reassignTask

public void reassignTask(CDRSTask task)
                  throws RemoteException
Reassign task.

Specified by:
reassignTask in interface CDRSSubControl
Throws:
RemoteException

shutdown

public boolean shutdown(boolean forceIt)
                 throws RemoteException
Description copied from class: CDRSMonitorableServerBase_Impl
Shutdown the thread that calls doPeriodicWork regularly. Call this method after you have performed all other shutdown.

Specified by:
shutdown in interface CDRSServerBase
Overrides:
shutdown in class CDRSMonitorableServerBase_Impl
Returns:
boolean True if server is unexported from rmi runtime and unregistered with rmid. False otherwise. False means the server is running normally.
Throws:
RemoteException

storeStateInDB

protected void storeStateInDB()
                       throws Exception
Writes server state, as : separated string in the initialData field of the subControlConfig table.

Overrides:
storeStateInDB in class CDRSServerBase_Impl
Throws:
Exception

restoreStateFromDB

protected void restoreStateFromDB()
                           throws SQLException,
                                  ClassNotFoundException
This methods obtains the : separated state stored in initialData field of the processConfig table, parses it and passes the retrived fields as string to setState() method.

Overrides:
restoreStateFromDB in class CDRSServerBase_Impl
Throws:
SQLException
ClassNotFoundException

getState

public String[] getState()
                  throws RemoteException
Description copied from interface: CDRSServerBase
To be used by GUI for displaying server's state. For obtaining the state of a server. Each value is to be passed as a sting in the return string array.

Specified by:
getState in interface CDRSServerBase
Throws:
RemoteException

setState

protected void setState(String[] state)
                 throws SQLException
For restoring state from data base.

Specified by:
setState in class CDRSServerBase_Impl
Throws:
SQLException

isAssigned

public boolean isAssigned(CDRSReqJobElement r)
                   throws RemoteException
Return true if job is currently assigned to this subcontrol.

Specified by:
isAssigned in interface CDRSSubControl
Throws:
RemoteException

getCurrentLoad

public int getCurrentLoad()
                   throws RemoteException
Specified by:
getCurrentLoad in interface CDRSSubControl
Throws:
RemoteException

release

public void release(CDRSTask t,
                    CDRSReqJobElement e)
Remove a task from list.


handlesJobType

public boolean handlesJobType(String jobType)
                       throws RemoteException
Specified by:
handlesJobType in interface CDRSSubControl
Throws:
RemoteException