nl.astron.lofar.odtb.mom2otdbadapter.data
Class OTDBRepository

java.lang.Object
  extended by nl.astron.lofar.odtb.mom2otdbadapter.data.OTDBRepository

public class OTDBRepository
extends java.lang.Object

Repository that stores and retrieves LofarObservation objects to the jOTDB RMI interface. It converts it to the tree structure of jOTDB and vice versa.

Author:
Bastiaan Verhoef

Field Summary
private  jOTDB.jConverterInterface converter
           
static java.lang.String DATE_TIME_FORMAT
           
private  org.apache.commons.logging.Log log
           
private  jOTDB.jOTDBinterface remoteOTDB
           
private static int TEMPLATE_ID
           
private  jOTDB.jTreeMaintenanceInterface tm
           
 
Constructor Summary
OTDBRepository(java.lang.String rmiServerName, int port)
          Constructor that makes a connection to the specified rmi server on the specified rmi port
 
Method Summary
 java.util.List getLatestChanges(java.util.Date startDate, java.util.Date endDate)
          Retrieve lates changes between start- en endtime
protected  jOTDB.jOTDBnode getNode(jOTDB.jOTDBnode parentNode, java.lang.String paramName)
          Retrieves node by parent node and parameter name
protected  boolean isStatusThatMustBeExported(java.lang.String code)
          Checkes if observation with a status must be exported to MoM
 void store(LofarObservation lofarObservation)
          Stores a lofarObservation to jOTDB
protected  void storeParam(jOTDB.jOTDBnode parentNode, java.lang.String paramName, java.lang.String paramValue)
          Stores parameter in the tree by given parent node
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private org.apache.commons.logging.Log log

remoteOTDB

private jOTDB.jOTDBinterface remoteOTDB

tm

private jOTDB.jTreeMaintenanceInterface tm

converter

private jOTDB.jConverterInterface converter

TEMPLATE_ID

private static final int TEMPLATE_ID
See Also:
Constant Field Values

DATE_TIME_FORMAT

public static final java.lang.String DATE_TIME_FORMAT
See Also:
Constant Field Values
Constructor Detail

OTDBRepository

public OTDBRepository(java.lang.String rmiServerName,
                      int port)
               throws java.rmi.RemoteException,
                      java.rmi.NotBoundException
Constructor that makes a connection to the specified rmi server on the specified rmi port

Parameters:
rmiServerName -
port -
Throws:
java.rmi.RemoteException
java.rmi.NotBoundException
Method Detail

store

public void store(LofarObservation lofarObservation)
           throws java.rmi.RemoteException
Stores a lofarObservation to jOTDB

Parameters:
lofarObservation -
Throws:
java.rmi.RemoteException

storeParam

protected void storeParam(jOTDB.jOTDBnode parentNode,
                          java.lang.String paramName,
                          java.lang.String paramValue)
                   throws java.rmi.RemoteException
Stores parameter in the tree by given parent node

Parameters:
parentNode - parent node
paramName - parameter name
paramValue - parameter value
Throws:
java.rmi.RemoteException

getNode

protected jOTDB.jOTDBnode getNode(jOTDB.jOTDBnode parentNode,
                                  java.lang.String paramName)
                           throws java.rmi.RemoteException
Retrieves node by parent node and parameter name

Parameters:
parentNode - parent node
paramName - name of the parameter
Returns:
node
Throws:
java.rmi.RemoteException

getLatestChanges

public java.util.List getLatestChanges(java.util.Date startDate,
                                       java.util.Date endDate)
                                throws java.rmi.RemoteException
Retrieve lates changes between start- en endtime

Parameters:
startDate - start time
endDate - end time
Returns:
List of lofarObservation objects
Throws:
java.rmi.RemoteException

isStatusThatMustBeExported

protected boolean isStatusThatMustBeExported(java.lang.String code)
Checkes if observation with a status must be exported to MoM

Parameters:
code -
Returns:
true, if it must be exported