public class ManagementTransitionMode
extends java.lang.Object
BrooklynObjectManagementMode
before and after,
and allows easy checking of various aspects of that.
This helps make code readable and keep correct logic if we expand/change the management modes.
Modifier and Type | Method and Description |
---|---|
BrooklynObjectManagementMode |
getModeAfter() |
BrooklynObjectManagementMode |
getModeBefore() |
static ManagementTransitionMode |
guessing(BrooklynObjectManagementMode modeBefore,
BrooklynObjectManagementMode modeAfter)
Deprecated.
|
boolean |
isCreating()
Object is being created:
previously did not exist (not even in persisted state);
implies that we are the active manager creating it,
i.e.
|
boolean |
isDestroying()
Object is being destroyed:
either destroyed elsewhere and we're catching up (in read-only mode),
or we've been the active manager and are destroying it
|
boolean |
isNoLongerLoaded()
This management node is now not going to be loaded here, either it is being destroyed
(not known anywhere, not even persisted) or simply forgotten here
|
boolean |
isPrimary()
This management node is now the master for the given object
|
boolean |
isReadOnly()
Object is now being loaded as read-only at this management node;
expect active management to be occurring elsewhere
|
java.lang.String |
toString() |
static ManagementTransitionMode |
transitioning(BrooklynObjectManagementMode modeBefore,
BrooklynObjectManagementMode modeAfter) |
boolean |
wasNotLoaded()
This management node was previously not loaded here,
either it did not exist (and is just being created) or it was in persisted state but
not loaded at this node.
|
boolean |
wasPrimary()
This management node was the master for the given object
|
boolean |
wasReadOnly()
Object was previously loaded as read-only at this management node;
active management was occurring elsewhere (or not at all)
|
public static ManagementTransitionMode transitioning(BrooklynObjectManagementMode modeBefore, BrooklynObjectManagementMode modeAfter)
@Deprecated public static ManagementTransitionMode guessing(BrooklynObjectManagementMode modeBefore, BrooklynObjectManagementMode modeAfter)
public BrooklynObjectManagementMode getModeBefore()
public BrooklynObjectManagementMode getModeAfter()
public boolean wasNotLoaded()
public boolean isNoLongerLoaded()
public boolean wasPrimary()
public boolean isPrimary()
public boolean wasReadOnly()
public boolean isReadOnly()
public boolean isCreating()
getModeAfter()
should indicate BrooklynObjectManagementMode.MANAGED_PRIMARY
.
(if we're read-only and the manager has just created it,
getModeBefore()
should indicate BrooklynObjectManagementMode.UNMANAGED_PERSISTED
)public boolean isDestroying()
public java.lang.String toString()
toString
in class java.lang.Object