generator2
Class OracleReporter

java.lang.Object
  |
  +--generator2.Reporter
        |
        +--generator2.OracleReporter

public class OracleReporter
extends Reporter

Class for reporting the computed moving objects into an Oracle database. Requires classes111.zip or classes12.zip in the classpath.


Field Summary
protected  java.sql.Connection con
          Database connection.
protected  java.lang.String dbExternalObjectTableName
          Name of the table storing the external objects.
protected  java.lang.String dbMovingObjectTableName
          Name of the table storing the moving objects.
protected  java.sql.PreparedStatement prepExtObjStmt
          Prepared database statement for storing external objects.
protected  java.sql.PreparedStatement prepMovObjStmt
          Prepared database statement for storing moving objects.
 
Fields inherited from class generator2.Reporter
DEL_OBJECT, MOVE_OBJECT, NEW_OBJECT, numOfEdges, numOfPoints, objects, properties, random, SYMBOLLAYER, visualize, VIZ
 
Constructor Summary
OracleReporter(java.util.Properties properties, DrawableObjects objects)
          Constructor of the Oracle reporter.
 
Method Summary
 void close()
          Closes the reporter.
static java.sql.Connection getConnection(java.util.Properties properties)
          Returns the connection to the database.
 void removeReportedObjects()
          Removes all reported objects.
 void reportDisappearingExternalObject(int time, long id, int repNum, int objClass, java.awt.Rectangle rect)
          Reports a disappearing external object.
 void reportDisappearingObject(int time, long id, int repNum, int objClass, int x, int y, double doneDist, int reportProbability)
          Reports the characteristic properties of a dispappering object at a time stamp
 void reportMovingExternalObject(int time, long id, int repNum, int objClass, java.awt.Rectangle rect)
          Reports a moved external object.
 int reportMovingObject(int time, long id, int repNum, int objClass, double x, double y, double speed, double doneDist, int nextNodeX, int nextNodeY, int reportProbability)
          Reports the characteristic properties of a moving object at a time stamp according to its report probability.
 void reportNewExternalObject(int time, long id, int objClass, java.awt.Rectangle rect)
          Reports a new external object.
 int reportNewMovingObject(int time, long id, int objClass, int x, int y, double speed, int nextNodeX, int nextNodeY, int reportProbability)
          Reports an new moving object if its report probability > 0.
 
Methods inherited from class generator2.Reporter
getNumberOfReportedEdges, getNumberOfReportedPoints, reportDisappearingObject, reportDouble, reportEdge, reportInt, visualizeExternalObject, visualizeMovingObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

con

protected java.sql.Connection con
Database connection.


dbExternalObjectTableName

protected java.lang.String dbExternalObjectTableName
Name of the table storing the external objects.


dbMovingObjectTableName

protected java.lang.String dbMovingObjectTableName
Name of the table storing the moving objects.


prepExtObjStmt

protected java.sql.PreparedStatement prepExtObjStmt
Prepared database statement for storing external objects.


prepMovObjStmt

protected java.sql.PreparedStatement prepMovObjStmt
Prepared database statement for storing moving objects.

Constructor Detail

OracleReporter

public OracleReporter(java.util.Properties properties,
                      DrawableObjects objects)
Constructor of the Oracle reporter.

Parameters:
properties - properties of the generator
objects - container of drawable objects
Method Detail

close

public void close()
Closes the reporter.

Overrides:
close in class Reporter

getConnection

public static java.sql.Connection getConnection(java.util.Properties properties)
                                         throws java.sql.SQLException,
                                                java.lang.ClassNotFoundException
Returns the connection to the database.

Parameters:
properties - properties of the generator
java.sql.SQLException
java.lang.ClassNotFoundException

removeReportedObjects

public void removeReportedObjects()
Removes all reported objects.

Overrides:
removeReportedObjects in class Reporter

reportDisappearingExternalObject

public void reportDisappearingExternalObject(int time,
                                             long id,
                                             int repNum,
                                             int objClass,
                                             java.awt.Rectangle rect)
Reports a disappearing external object.

Overrides:
reportDisappearingExternalObject in class Reporter
Parameters:
time - time stamp
id - object id
repNum - report number
objClass - object class
rect - the area

reportDisappearingObject

public void reportDisappearingObject(int time,
                                     long id,
                                     int repNum,
                                     int objClass,
                                     int x,
                                     int y,
                                     double doneDist,
                                     int reportProbability)
Reports the characteristic properties of a dispappering object at a time stamp

Parameters:
time - time stamp
id - object id
repNum - report number
objClass - object class
x - x-coordinate
y - y-coordinate
doneDist - the distance since the last reporting
reportProbability - value between (0..1000)

reportMovingExternalObject

public void reportMovingExternalObject(int time,
                                       long id,
                                       int repNum,
                                       int objClass,
                                       java.awt.Rectangle rect)
Reports a moved external object.

Overrides:
reportMovingExternalObject in class Reporter
Parameters:
time - time stamp
id - object id
repNum - report number
objClass - object class
rect - the area

reportMovingObject

public int reportMovingObject(int time,
                              long id,
                              int repNum,
                              int objClass,
                              double x,
                              double y,
                              double speed,
                              double doneDist,
                              int nextNodeX,
                              int nextNodeY,
                              int reportProbability)
Reports the characteristic properties of a moving object at a time stamp according to its report probability.

Overrides:
reportMovingObject in class Reporter
Parameters:
time - time stamp
id - object id
repNum - report number
objClass - object class
x - x-coordinate
y - y-coordinate
speed - current speed
doneDist - the distance since the last reporting
nextNodeX - x-coordinate of the next node
nextNodeY - y-coordinate of the next node
reportProbability - value between (0..1000)
Returns:
new report number

reportNewExternalObject

public void reportNewExternalObject(int time,
                                    long id,
                                    int objClass,
                                    java.awt.Rectangle rect)
Reports a new external object.

Overrides:
reportNewExternalObject in class Reporter
Parameters:
time - time stamp
id - object id
objClass - object class
rect - the area

reportNewMovingObject

public int reportNewMovingObject(int time,
                                 long id,
                                 int objClass,
                                 int x,
                                 int y,
                                 double speed,
                                 int nextNodeX,
                                 int nextNodeY,
                                 int reportProbability)
Reports an new moving object if its report probability > 0.

Overrides:
reportNewMovingObject in class Reporter
Parameters:
time - time stamp
id - object id
objClass - object class
x - x-coordinate of start
y - y-coordinate of start
speed - current speed
nextNodeX - x-coordinate of the next node
nextNodeY - y-coordinate of the next node
reportProbability - value between (0..1000)