Class AbstractRunCommandStatement

java.lang.Object
liquibase.statement.AbstractSqlStatement
All Implemented Interfaces:
NoSqlExecuteStatement<MongoLiquibaseDatabase>, liquibase.statement.SqlStatement
Direct Known Subclasses:
CreateCollectionStatement, CreateIndexStatement, DropCollectionStatement, DropIndexStatement, FindOneAndUpdateStatement, InsertManyStatement, ListCollectionNamesStatement, RunCommandStatement

public abstract class AbstractRunCommandStatement extends AbstractMongoStatement implements NoSqlExecuteStatement<MongoLiquibaseDatabase>
  • Field Details

  • Constructor Details

    • AbstractRunCommandStatement

      public AbstractRunCommandStatement()
  • Method Details

    • execute

      public void execute(MongoLiquibaseDatabase database)
      Specified by:
      execute in interface NoSqlExecuteStatement<MongoLiquibaseDatabase>
    • run

      public org.bson.Document run(MongoLiquibaseDatabase database)
    • run

      public org.bson.Document run(com.mongodb.client.MongoDatabase mongoDatabase)
    • checkResponse

      protected void checkResponse(org.bson.Document responseDocument) throws com.mongodb.MongoException
      Inspects response Document for any issues. For example the server responds with { "ok" : 1 } (success) even when run command fails to insert the document. The contents of the response is checked to see if the document was actually inserted For more information see the manual page
      Parameters:
      responseDocument - the response document
      Throws:
      com.mongodb.MongoException - a MongoException to be thrown
      See Also:
      • Insert Output

        Check the response and throw an appropriate exception if the command was not successful

    • getCommandName

      public String getCommandName()
      Specified by:
      getCommandName in class AbstractNoSqlStatement
    • getRunCommandName

      public abstract String getRunCommandName()
      Returns the RunCommand command name.
      Returns:
      the run command as this is not used and not required for a generic RunCommandStatement
      See Also:
    • toJs

      public String toJs()
      Overrides:
      toJs in class AbstractMongoStatement