Interface MTRevisionOperation


public interface MTRevisionOperation
Used when making changes to revisions, such as locking a revision of a model or creating a new revision of a model.
Since:
3.3
  • Method Details

    • getOperationType

      Returns the type of operation.
      Returns:
      The type of operation.
      Since:
      3.3
    • hasLocks

      boolean hasLocks()
      Returns true if locks were successfully obtained on all models and symbols that will be affected by the operation. If not, calling performOperation will cause an exception.
      Returns:
      true if locks were obtained successfully.
      Since:
      3.3
    • getModels

      Collection<MTModel> getModels()
      Returns the models being affected by the operation. If called before performOperation() it will return the old revisions in case of a "new revision" operation, otherwise it will return the new revisions.
      Returns:
      The models affected by the operation.
      Since:
      3.3
    • getSymbols

      Collection<MTSymbol> getSymbols()
      Returns the symbols being affected by the operation. If called before performOperation() it will return the old revisions in case of a "new revision" operation, otherwise it will return the new revisions.
      Returns:
      The symbols affected by the operation.
      Since:
      3.3
    • performOperation

      void performOperation(String logMessage) throws MTRemoteChangeException
      Performs the operation against storage. Make sure that hasLocks() returns true before calling this method. Calling this method more than once will have no effect.
      Parameters:
      logMessage - A message to store in the revision log.
      Throws:
      IllegalStateException - if !hasLocks().
      MTRemoteChangeException
      Since:
      3.3
    • performOperation

      void performOperation(String logMessage, Consumer<Runnable> eventRunnable) throws MTRemoteChangeException
      performs operation exactly as performOperation(String logMessage) does but without firing events when operation finishes. In this implementation it is up to the caller to run the events. This is done because if multiple performOperation() are called back to back the UI, that listens to the events, will try to
      Parameters:
      logMessage - A message to store in the revision log.
      eventRunnable - Consumer with an even that should be fired after performOperation is called
      Throws:
      IllegalStateException - if !hasLocks().
      MTRemoteChangeException