Class BaseNodesResponse<TNodeResponse extends BaseNodeResponse>
- java.lang.Object
-
- org.elasticsearch.transport.TransportMessage
-
- org.elasticsearch.transport.TransportResponse
-
- org.elasticsearch.action.ActionResponse
-
- org.elasticsearch.action.support.nodes.BaseNodesResponse<TNodeResponse>
-
- All Implemented Interfaces:
Streamable
,Writeable
- Direct Known Subclasses:
ClusterStatsResponse
,NodesHotThreadsResponse
,NodesInfoResponse
,NodesReloadSecureSettingsResponse
,NodesStatsResponse
,NodesUsageResponse
,TransportNodesListGatewayMetaState.NodesGatewayMetaState
,TransportNodesListGatewayStartedShards.NodesGatewayStartedShards
,TransportNodesListShardStoreMetaData.NodesStoreFilesMetaData
,TransportNodesSnapshotsStatus.NodesSnapshotStatus
public abstract class BaseNodesResponse<TNodeResponse extends BaseNodeResponse> extends ActionResponse
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.elasticsearch.transport.TransportResponse
TransportResponse.Empty
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
BaseNodesResponse()
protected
BaseNodesResponse(ClusterName clusterName, java.util.List<TNodeResponse> nodes, java.util.List<FailedNodeException> failures)
-
Method Summary
Modifier and Type Method Description java.util.List<FailedNodeException>
failures()
Get the failed node exceptions.ClusterName
getClusterName()
Get theClusterName
associated with all of the nodes.java.util.List<TNodeResponse>
getNodes()
Get the successful node responses.java.util.Map<java.lang.String,TNodeResponse>
getNodesMap()
Lazily build and get a map of Node ID to node response.boolean
hasFailures()
Determine if there are any node failures infailures
.void
readFrom(StreamInput in)
Set this object's fields from a StreamInput.protected abstract java.util.List<TNodeResponse>
readNodesFrom(StreamInput in)
Read thenodes
from the stream.protected abstract void
writeNodesTo(StreamOutput out, java.util.List<TNodeResponse> nodes)
Write thenodes
to the stream.void
writeTo(StreamOutput out)
Write this object's fields to a StreamOutput.-
Methods inherited from class org.elasticsearch.transport.TransportMessage
remoteAddress, remoteAddress
-
-
-
-
Constructor Detail
-
BaseNodesResponse
protected BaseNodesResponse()
-
BaseNodesResponse
protected BaseNodesResponse(ClusterName clusterName, java.util.List<TNodeResponse> nodes, java.util.List<FailedNodeException> failures)
-
-
Method Detail
-
getClusterName
public ClusterName getClusterName()
Get theClusterName
associated with all of the nodes.- Returns:
- Never
null
.
-
failures
public java.util.List<FailedNodeException> failures()
Get the failed node exceptions.- Returns:
- Never
null
. Can be empty.
-
hasFailures
public boolean hasFailures()
Determine if there are any node failures infailures
.- Returns:
true
iffailures
contains at least 1FailedNodeException
.
-
getNodes
public java.util.List<TNodeResponse> getNodes()
Get the successful node responses.- Returns:
- Never
null
. Can be empty. - See Also:
hasFailures()
-
getNodesMap
public java.util.Map<java.lang.String,TNodeResponse> getNodesMap()
Lazily build and get a map of Node ID to node response.- Returns:
- Never
null
. Can be empty. - See Also:
getNodes()
-
readFrom
public void readFrom(StreamInput in) throws java.io.IOException
Description copied from interface:Streamable
Set this object's fields from a StreamInput.- Specified by:
readFrom
in interfaceStreamable
- Overrides:
readFrom
in classActionResponse
- Throws:
java.io.IOException
-
writeTo
public void writeTo(StreamOutput out) throws java.io.IOException
Description copied from interface:Streamable
Write this object's fields to a StreamOutput.- Specified by:
writeTo
in interfaceStreamable
- Specified by:
writeTo
in interfaceWriteable
- Overrides:
writeTo
in classActionResponse
- Throws:
java.io.IOException
-
readNodesFrom
protected abstract java.util.List<TNodeResponse> readNodesFrom(StreamInput in) throws java.io.IOException
Read thenodes
from the stream.- Returns:
- Never
null
. - Throws:
java.io.IOException
-
writeNodesTo
protected abstract void writeNodesTo(StreamOutput out, java.util.List<TNodeResponse> nodes) throws java.io.IOException
Write thenodes
to the stream.- Throws:
java.io.IOException
-
-