Package de.svenkubiak.embeddedmongodb
Class EmbeddedMongoDB
java.lang.Object
de.svenkubiak.embeddedmongodb.EmbeddedMongoDB
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic EmbeddedMongoDB
create()
Creates a new EmbeddedMongoDB instanceEnable IPv6 for host configuration Default is falsegetHost()
int
getPort()
de.flapdoodle.embed.mongo.distribution.Version.Main
boolean
isActive()
boolean
isIPv6()
start()
Starts the EmbeddedMongoDB instancevoid
stop()
Stops the EmbeddedMongoDB instanceSets the host for the EmbeddedMongoDB instance Default is localhostwithPort
(int port) Sets the port for the EmbeddedMongoDB instance Default is 29019withVersion
(de.flapdoodle.embed.mongo.distribution.Version.Main version) Sets the version for the EmbeddedMongoDB instance Default is Version.Main.V6_0
-
Constructor Details
-
EmbeddedMongoDB
public EmbeddedMongoDB()
-
-
Method Details
-
create
Creates a new EmbeddedMongoDB instance- Returns:
- EmbeddedMongoDB instance
-
withPort
Sets the port for the EmbeddedMongoDB instance Default is 29019- Parameters:
port
- The port to set- Returns:
- EmbeddedMongoDB instance
-
withHost
Sets the host for the EmbeddedMongoDB instance Default is localhost- Parameters:
host
- The host to set- Returns:
- EmbeddedMongoDB instance
-
enableIPv6
Enable IPv6 for host configuration Default is false- Returns:
- EmbeddedMongoDB instance
-
withVersion
Sets the version for the EmbeddedMongoDB instance Default is Version.Main.V6_0- Parameters:
version
- The version to set- Returns:
- EmbeddedMongoDB instance
-
start
Starts the EmbeddedMongoDB instance- Returns:
- EmbeddedMongoDB instance
-
stop
public void stop()Stops the EmbeddedMongoDB instance -
getHost
- Returns:
- The configured host name
-
getVersion
public de.flapdoodle.embed.mongo.distribution.Version.Main getVersion()- Returns:
- The mongod version in use
-
getPort
public int getPort()- Returns:
- The configured port
-
isActive
public boolean isActive()- Returns:
- True if embedded database is up and running, false otherwise
-
isIPv6
public boolean isIPv6()- Returns:
- True if IPv6 is enabled, false otherwise
-