|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectyass.database.Event
yass.database.NodePositionChangeEvent
public class NodePositionChangeEvent
A node location change event which occurs in the simulator to be stored for later analysis. Events of this type encapsulate changes in node identity, position or status, that do not relate directly to network activity.
Field Summary | |
---|---|
private static java.sql.PreparedStatement |
insertionPreparedStatement
A database prepared statement with which to insert node location transition events into the database |
private static org.apache.log4j.Logger |
log
The logger |
private Node |
node
The node which underwent transition |
private Position |
position
The new position of the node |
Fields inherited from class yass.database.Event |
---|
INSERT_ATTEMPT_MAX |
Constructor Summary | |
---|---|
NodePositionChangeEvent(Node node,
Position position)
Creates a new instance of NodePositionChangeEvent |
Method Summary | |
---|---|
private static java.sql.PreparedStatement |
createInsertionPreparedStatement(Database database)
Creates a database prepared statement with which to insert node location transition events into the database |
static java.lang.String |
getInsertSql(DatabaseType type)
Obtains SQL code to insert an instance of this event type into the relevant table |
Node |
getNode()
Obtains the node |
Position |
getPosition()
Obtains the node position |
static java.lang.String[] |
getPurgeSimulationSql(DatabaseType type)
Obtains SQL code to all instances of this event type from the relevant table related to a specified simulation |
static java.lang.String[] |
getRemoveRowSql(DatabaseType type)
Obtains SQL code to remove instances of this event type from the relevant table |
static java.lang.String[] |
getTableBuildSql(DatabaseType type)
Obtains SQL code to build the database table used to store events of this type |
static java.lang.String[] |
getTableDropSql(DatabaseType type)
Obtains SQL code to drop the database table used to store events of this type |
static java.lang.String |
getTableName()
Obtains the name of the database table used to store events of this type |
protected void |
performInsert(Database database,
double timestamp)
Inserts the node location transition event into the supplied database with the specified timestamp |
Methods inherited from class yass.database.Event |
---|
insertIntoDatabase, setDoubleColumn, setDoubleColumnSanitiseMissing, setIntegerColumn, setIntegerColumnSanitiseMissing, setShortColumn, setShortColumnSanitiseMissing, shutdown |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static java.sql.PreparedStatement insertionPreparedStatement
private static org.apache.log4j.Logger log
private Node node
private Position position
Constructor Detail |
---|
public NodePositionChangeEvent(Node node, Position position)
NodePositionChangeEvent
node
- the node whose new position is to be recordedposition
- the new positionMethod Detail |
---|
protected void performInsert(Database database, double timestamp) throws java.sql.SQLException
performInsert
in class Event
database
- the simulation event databasetimestamp
- the time at which the event occured
java.sql.SQLException
- if the event cannot be inserted into the databaseprivate static java.sql.PreparedStatement createInsertionPreparedStatement(Database database) throws java.sql.SQLException
database
- the simulation event database
java.sql.SQLException
public Position getPosition()
public Node getNode()
public static java.lang.String getTableName()
public static java.lang.String[] getTableBuildSql(DatabaseType type)
type
- the database type
public static java.lang.String getInsertSql(DatabaseType type)
type
- the database type
public static java.lang.String[] getTableDropSql(DatabaseType type)
type
- the database type
public static java.lang.String[] getRemoveRowSql(DatabaseType type)
type
- the database type
public static java.lang.String[] getPurgeSimulationSql(DatabaseType type)
type
- the database type
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |