Package se.conciliate.extensions.store
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
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionReturns the models being affected by the operation.Returns the type of operation.Returns the symbols being affected by the operation.boolean
hasLocks()
Returnstrue
if locks were successfully obtained on all models and symbols that will be affected by the operation.void
performOperation
(String logMessage) Performs the operation against storage.void
performOperation
(String logMessage, Consumer<Runnable> eventRunnable) performs operation exactly as performOperation(String logMessage) does but without firing events when operation finishes.
-
Method Details
-
getOperationType
MTRevisionOperation.OperationType getOperationType()Returns the type of operation.- Returns:
- The type of operation.
- Since:
- 3.3
-
hasLocks
boolean hasLocks()Returnstrue
if locks were successfully obtained on all models and symbols that will be affected by the operation. If not, callingperformOperation
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 beforeperformOperation()
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 beforeperformOperation()
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
Performs the operation against storage. Make sure thathasLocks()
returnstrue
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
-