Class AdoptionResult
- java.lang.Object
-
- com.opencloud.rhino.facilities.sessionownership.AdoptionResult
-
public final class AdoptionResult extends Object
Result of an adoption operation. Every
AdoptionResulthas a non-nullAdoptionResultType.
-
-
Constructor Summary
Constructors Constructor Description AdoptionResult(AdoptionResultType type)Create anAdoptionResultwith only a type and no other information.AdoptionResult(AdoptionResultType type, int clusterID, String nodeID)Create anAdoptionResultwith a type, cluster ID, and node ID.AdoptionResult(AdoptionResultType type, Exception exception)Create anAdoptionResultwith a type and cause exception.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetClusterID()Get the cluster ID returned by the operation, if any.ExceptiongetException()Get the exception that occurred during operation execution, if any.intgetNodeID()Get the node ID returned by the operation, if any.StringgetRhinoNodeID()Get the node ID returned by the operation, if any.AdoptionResultTypegetType()Get the type of thisAdoptionResult.booleanhasClusterID()Determine if theAdoptionResulthas an optional cluster ID parameter.booleanhasException()Determine if theAdoptionResulthas an optional cause exception.booleanhasNodeID()Determine if theAdoptionResulthas an optional node ID parameter.StringtoString()
-
-
-
Constructor Detail
-
AdoptionResult
public AdoptionResult(AdoptionResultType type)
Create an
AdoptionResultwith only a type and no other information.
-
AdoptionResult
public AdoptionResult(AdoptionResultType type, int clusterID, String nodeID)
Create an
AdoptionResultwith a type, cluster ID, and node ID.- Parameters:
type- the type of the AdoptionResult.clusterID- the cluster ID of the owning node.nodeID- the node ID of the owning node.
-
AdoptionResult
public AdoptionResult(AdoptionResultType type, Exception exception)
Create an
AdoptionResultwith a type and cause exception.- Parameters:
type- the type of the AdoptionResult.exception- any exception that occurred during operation execution.
-
-
Method Detail
-
hasClusterID
public boolean hasClusterID()
Determine if the
AdoptionResulthas an optional cluster ID parameter.- Returns:
trueif a cluster ID parameter is present,falseotherwise.
-
hasNodeID
public boolean hasNodeID()
Determine if the
AdoptionResulthas an optional node ID parameter.- Returns:
trueif a node ID parameter is present,falseotherwise.
-
hasException
public boolean hasException()
Determine if the
AdoptionResulthas an optional cause exception.- Returns:
trueif an exception parameter is present,falseotherwise.
-
getType
public AdoptionResultType getType()
Get the type of this
AdoptionResult.- Returns:
- the adoption result type.
-
getClusterID
public int getClusterID()
Get the cluster ID returned by the operation, if any.
- Returns:
- the cluster ID, or
0if none was reported.
-
getNodeID
public int getNodeID()
Get the node ID returned by the operation, if any.
- Returns:
- the node ID, or
0if none was reported.
-
getRhinoNodeID
public String getRhinoNodeID()
Get the node ID returned by the operation, if any.
- Returns:
- the node ID, or
nullif none was reported. - Since:
- Rhino 3.2
-
getException
public Exception getException()
Get the exception that occurred during operation execution, if any.
- Returns:
- the exception,
nullif there was none.
-
-