Package net.ozwolf.mongo.migrations
Class MongoTrekState
- java.lang.Object
-
- net.ozwolf.mongo.migrations.MongoTrekState
-
public class MongoTrekState extends Object
Mongo Trek State
This class provides the collection of migrations and an ability to query the overall state of the process. This includes what the current version is, what the pending state is as well as a list of failed and applied migrations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMongoTrekState.PendingMigrations State - Pending State
-
Constructor Summary
Constructors Constructor Description MongoTrekState(Collection<Migration> migrations)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Migration>getApplied()Get the list of successfully applied migrationsStringgetCurrentVersion()Get the currently applied migration version.List<Migration>getFailed()Get the list of migrations that have failed.List<Migration>getMigrations()Get the full list of migrations.MongoTrekState.PendinggetPending()Return the pending migrations state.
-
-
-
Constructor Detail
-
MongoTrekState
public MongoTrekState(Collection<Migration> migrations)
-
-
Method Detail
-
getCurrentVersion
public String getCurrentVersion()
Get the currently applied migration version.- Returns:
- The currently applied version
-
getMigrations
public List<Migration> getMigrations()
Get the full list of migrations. This includes the entire history of applied migrations, even if the command source has since been removed from the project.- Returns:
- The full list of migrations, both applied history and pending commands.
-
getPending
public MongoTrekState.Pending getPending()
Return the pending migrations state.- Returns:
- The pending migration state
-
getFailed
public List<Migration> getFailed()
Get the list of migrations that have failed.- Returns:
- The failed migrations
-
-