saaps.dbt
Class DatabaseRMIImpl

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--saaps.dbt.DatabaseRMIImpl

public class DatabaseRMIImpl
extends java.rmi.server.UnicastRemoteObject
implements DatabaseRMI

Provides a RMI server for Database access. Through the use of the DatabaseRMI interface it's possible to:

get information of available databases,

get MetaData for a specific databse,

get different types of data from the database.

See Also:
Serialized Form

Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
DatabaseRMIImpl()
          Runs the constructor of the superclass UnicastRemoteObject.
 
Method Summary
 java.util.Vector getData(java.lang.String theDb, java.util.Date sd, java.util.Date ed)
          Gets a Vector of Database objects.
 java.util.Vector getDatabaseList()
          Gets a list of available Databases.
 MetaData getMetaData(java.lang.String theDb)
          Gets the MetaData for this Database.
 NetworkParam getNetworkParam(java.lang.String netParam)
          Gets the parameters for the neural network.
 NormParam getNormParam(java.lang.String normParam, int nof)
          Gets the normalization parameters needed for the preprocessing of a TimeSeries object before it is input to a network.
 TimeSeries getTimeSeries(java.lang.String theDb, java.util.Date sd, java.util.Date ed)
          Gets a TimeSeries object.
static void main(java.lang.String[] args)
          The main for the RMI server.
 TimeSeries retrieveElFluence()
           
 TimeSeries retrieveElFluence(java.util.Date d)
           
 ObjectTimeSeries retrieveOTS(java.lang.String theDB, java.util.Date sd, java.util.Date ed, boolean before)
          Gets an ObjectTimeSeries containing data between the dates.
 TimeSeries retrieveSEA(java.lang.String theDB, int fieldIndex, java.util.Date[] events, long start, long end, boolean withAdditionalInfo)
          Retrieves a TimeSeries object containing the averaged data for the input event list.
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
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
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DatabaseRMIImpl

public DatabaseRMIImpl()
                throws java.rmi.RemoteException
Runs the constructor of the superclass UnicastRemoteObject.
Throws:
java.rmi.RemoteException - network/io problem
Method Detail

getDatabaseList

public java.util.Vector getDatabaseList()
Gets a list of available Databases.
Specified by:
getDatabaseList in interface DatabaseRMI
Returns:
Vector of Database names

getMetaData

public MetaData getMetaData(java.lang.String theDb)
Gets the MetaData for this Database.
Specified by:
getMetaData in interface DatabaseRMI
Parameters:
theDb - Database name
Returns:
MetaData for this Database

getData

public java.util.Vector getData(java.lang.String theDb,
                                java.util.Date sd,
                                java.util.Date ed)
                         throws java.io.IOException
Gets a Vector of Database objects.
Specified by:
getData in interface DatabaseRMI
Parameters:
theDb - Database name
sd - start date/time
ed - end date/time
Throws:
java.io.IOException - when io problem or no data for this time

getTimeSeries

public TimeSeries getTimeSeries(java.lang.String theDb,
                                java.util.Date sd,
                                java.util.Date ed)
                         throws java.io.IOException
Gets a TimeSeries object.
Specified by:
getTimeSeries in interface DatabaseRMI
Parameters:
theDb - Database name
sd - start date/time
ed - end date/time
Returns:
TimeSeries
Throws:
java.io.IOException - when io problem or no data for this time

retrieveOTS

public ObjectTimeSeries retrieveOTS(java.lang.String theDB,
                                    java.util.Date sd,
                                    java.util.Date ed,
                                    boolean before)
                             throws java.io.IOException,
                                    IllegalTimeSeriesException
Gets an ObjectTimeSeries containing data between the dates.
Specified by:
retrieveOTS in interface DatabaseRMI
Parameters:
theDB - SAAPS database name
sd - start date for search
ed - end date for search
before - if true then the first object returned is before the start search date.
Returns:
the ObjectTimeSeries

retrieveSEA

public TimeSeries retrieveSEA(java.lang.String theDB,
                              int fieldIndex,
                              java.util.Date[] events,
                              long start,
                              long end,
                              boolean withAdditionalInfo)
                       throws java.io.IOException,
                              TimeSeriesIndexException,
                              IllegalTimeSeriesException
Retrieves a TimeSeries object containing the averaged data for the input event list. See also Database.retrieveSEA(int, Date[], long, long, boolean ).
Specified by:
retrieveSEA in interface DatabaseRMI
Parameters:
theDB - name of the SAAPS Database
fieldIndex - index of the data field
events - array of event times
start - event window starts here (normally negative [milliseconds])
end - event window ends here (normally positiv [milliseconds])
withAdditionalInfo - if true get also the number of data points and the standard deviation from the average.
Returns:
TimeSeries object with fieldName data for start to end time for every event
Throws:
TimeSeriesIndexException - when fieldIndex is out of bounds
java.io.IOException - when data for any of the event times are missing

getNetworkParam

public NetworkParam getNetworkParam(java.lang.String netParam)
Gets the parameters for the neural network.
Specified by:
getNetworkParam in interface DatabaseRMI
Parameters:
netParam - network parameter name
Returns:
NetworkParam

getNormParam

public NormParam getNormParam(java.lang.String normParam,
                              int nof)
Gets the normalization parameters needed for the preprocessing of a TimeSeries object before it is input to a network.
Specified by:
getNormParam in interface DatabaseRMI
Parameters:
normParam - normalization parameter name
nof - number of fields
Returns:
NormParam

main

public static void main(java.lang.String[] args)
The main for the RMI server. Creates an instance of the default security manager and binds the DatabaseRMIImpl to the registry.

retrieveElFluence

public TimeSeries retrieveElFluence()
                             throws java.rmi.RemoteException
Specified by:
retrieveElFluence in interface DatabaseRMI

retrieveElFluence

public TimeSeries retrieveElFluence(java.util.Date d)
                             throws java.rmi.RemoteException
Specified by:
retrieveElFluence in interface DatabaseRMI