Class AdoptionResult
- java.lang.Object
-
- com.opencloud.rhino.facilities.sessionownership.AdoptionResult
-
public final class AdoptionResult extends Object
Result of an adoption operation. Every
AdoptionResult
has a non-nullAdoptionResultType
.
-
-
Constructor Summary
Constructors Constructor Description AdoptionResult(AdoptionResultType type)
Create anAdoptionResult
with only a type and no other information.AdoptionResult(AdoptionResultType type, int clusterID, String nodeID)
Create anAdoptionResult
with a type, cluster ID, and node ID.AdoptionResult(AdoptionResultType type, Exception exception)
Create anAdoptionResult
with a type and cause exception.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getClusterID()
Get the cluster ID returned by the operation, if any.Exception
getException()
Get the exception that occurred during operation execution, if any.int
getNodeID()
Get the node ID returned by the operation, if any.String
getRhinoNodeID()
Get the node ID returned by the operation, if any.AdoptionResultType
getType()
Get the type of thisAdoptionResult
.boolean
hasClusterID()
Determine if theAdoptionResult
has an optional cluster ID parameter.boolean
hasException()
Determine if theAdoptionResult
has an optional cause exception.boolean
hasNodeID()
Determine if theAdoptionResult
has an optional node ID parameter.String
toString()
-
-
-
Constructor Detail
-
AdoptionResult
public AdoptionResult(AdoptionResultType type)
Create an
AdoptionResult
with only a type and no other information.
-
AdoptionResult
public AdoptionResult(AdoptionResultType type, int clusterID, String nodeID)
Create an
AdoptionResult
with 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
AdoptionResult
with 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
AdoptionResult
has an optional cluster ID parameter.- Returns:
true
if a cluster ID parameter is present,false
otherwise.
-
hasNodeID
public boolean hasNodeID()
Determine if the
AdoptionResult
has an optional node ID parameter.- Returns:
true
if a node ID parameter is present,false
otherwise.
-
hasException
public boolean hasException()
Determine if the
AdoptionResult
has an optional cause exception.- Returns:
true
if an exception parameter is present,false
otherwise.
-
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
0
if none was reported.
-
getNodeID
public int getNodeID()
Get the node ID returned by the operation, if any.
- Returns:
- the node ID, or
0
if none was reported.
-
getRhinoNodeID
public String getRhinoNodeID()
Get the node ID returned by the operation, if any.
- Returns:
- the node ID, or
null
if none was reported. - Since:
- Rhino 3.2
-
getException
public Exception getException()
Get the exception that occurred during operation execution, if any.
- Returns:
- the exception,
null
if there was none.
-
-