Class MongoDBExporter
-
- All Implemented Interfaces:
-
it.unibo.alchemist.boundary.Exporter
public final class MongoDBExporter<T extends Object, P extends Position<P>> extends AbstractExporter<T, P>
Exports data to a MongoDB instance.
-
-
Constructor Summary
Constructors Constructor Description MongoDBExporter(String uri, String dbName, Double interval, Boolean appendTime)
MongoDBExporter(String uri, String dbName, Double interval)
MongoDBExporter(String uri, String dbName)
MongoDBExporter(String uri)
-
Method Summary
Modifier and Type Method Description final String
getCollectionName()
The name of the collection related to the current simulation in execution. final String
getUri()
final String
getDbName()
final Double
getInterval()
Unit
setup(Environment<T, P> environment)
Prepare the export environment. Unit
exportData(Environment<T, P> environment, Actionable<T> reaction, Time time, Long step)
Delegates the concrete implementation of this method to his subclasses. Unit
close(Environment<T, P> environment, Time time, Long step)
Close the export environment. -
-
Constructor Detail
-
MongoDBExporter
MongoDBExporter(String uri, String dbName, Double interval, Boolean appendTime)
- Parameters:
uri
- the connection URI of the database instance.dbName
- the name the database to export data to.interval
- the sampling time, defaults to AbstractExporter.DEFAULT_INTERVAL.appendTime
- if true it will always generate a new Mongo document, false to overwrite.
-
MongoDBExporter
MongoDBExporter(String uri, String dbName, Double interval)
- Parameters:
uri
- the connection URI of the database instance.dbName
- the name the database to export data to.interval
- the sampling time, defaults to AbstractExporter.DEFAULT_INTERVAL.
-
MongoDBExporter
MongoDBExporter(String uri, String dbName)
- Parameters:
uri
- the connection URI of the database instance.dbName
- the name the database to export data to.
-
MongoDBExporter
MongoDBExporter(String uri)
- Parameters:
uri
- the connection URI of the database instance.
-
-
Method Detail
-
getCollectionName
final String getCollectionName()
The name of the collection related to the current simulation in execution.
-
getInterval
final Double getInterval()
-
setup
Unit setup(Environment<T, P> environment)
Prepare the export environment. This method is called only once upon simulation initialization.
-
exportData
Unit exportData(Environment<T, P> environment, Actionable<T> reaction, Time time, Long step)
Delegates the concrete implementation of this method to his subclasses.
-
-
-
-