com.almworks.jira.structure.api.forest
Interface ForestTransaction<T>

Type Parameters:
T - type of the operation result, use Void or Object when no result needed

public interface ForestTransaction<T>

Implement this interface to define a single transaction on the forests.

It is very important to implement ForestTransaction correctly. The transaction may be executed under one or more write locks, preventing other transactions from changing the forests concurrently (readers still have access) - so the amount of code should be minimal and the execution time should be predictable and small.

See Also:
StructureManager.updateForest(com.atlassian.crowd.embedded.api.User, boolean, com.almworks.jira.structure.api.forest.ForestTransaction)

Method Summary
 T transaction(ForestAccessor accessor)
          Perform an operation on the forests in the structure database.
 

Method Detail

transaction

T transaction(@NotNull
              ForestAccessor accessor)
              throws StructureException

Perform an operation on the forests in the structure database.

If this method throws any exception, the whole transaction will be considered failed and changes will be rolled back.

Parameters:
accessor - accessor that is used to read forest and execute updates
Returns:
optional result that will be passed to the calling code as the result of StructureManager.updateForest(com.atlassian.crowd.embedded.api.User, boolean, com.almworks.jira.structure.api.forest.ForestTransaction).
Throws:
StructureException - when operation fails


Copyright © 2013 ALMWorks. All Rights Reserved.