Class Node
- java.lang.Object
-
- org.opensearch.client.transport.httpclient5.internal.Node
-
public class Node extends java.lang.ObjectMetadata about anHttpHostrunning OpenSearch.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNode.RolesRole information about an OpenSearch process.
-
Constructor Summary
Constructors Constructor Description Node(org.apache.hc.core5.http.HttpHost host)Create a Node without any metadata.Node(org.apache.hc.core5.http.HttpHost host, java.util.Set<org.apache.hc.core5.http.HttpHost> boundHosts, java.lang.String name, java.lang.String version, Node.Roles roles, java.util.Map<java.lang.String,java.util.List<java.lang.String>> attributes)Create a Node with metadata.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Compare two nodes for equalityjava.util.Map<java.lang.String,java.util.List<java.lang.String>>getAttributes()Attributes declared on the node.java.util.Set<org.apache.hc.core5.http.HttpHost>getBoundHosts()Addresses on which the host is listening.org.apache.hc.core5.http.HttpHostgetHost()Contact information for the host.java.lang.StringgetName()Thenode.nameof the node.Node.RolesgetRoles()Roles that the OpenSearch process on the host has ornullif we don't know what roles the node has.java.lang.StringgetVersion()Version of OpenSearch that the node is running ornullif we don't know the version.inthashCode()Calculate the hash code of the nodejava.lang.StringtoString()Convert node to string representation
-
-
-
Constructor Detail
-
Node
public Node(org.apache.hc.core5.http.HttpHost host, java.util.Set<org.apache.hc.core5.http.HttpHost> boundHosts, java.lang.String name, java.lang.String version, Node.Roles roles, java.util.Map<java.lang.String,java.util.List<java.lang.String>> attributes)Create a Node with metadata. All parameters excepthostare nullable and implementations ofNodeSelectorneed to decide what to do in their absence.- Parameters:
host- primary host addressboundHosts- addresses on which the host is listeningname- name of the nodeversion- version of OpenSearchroles- roles that the OpenSearch process has on the hostattributes- attributes declared on the node
-
Node
public Node(org.apache.hc.core5.http.HttpHost host)
Create a Node without any metadata.- Parameters:
host- primary host address
-
-
Method Detail
-
getHost
public org.apache.hc.core5.http.HttpHost getHost()
Contact information for the host.
-
getBoundHosts
public java.util.Set<org.apache.hc.core5.http.HttpHost> getBoundHosts()
Addresses on which the host is listening. These are useful to have around because they allow you to find a host based on any address it is listening on.
-
getName
public java.lang.String getName()
Thenode.nameof the node.
-
getVersion
public java.lang.String getVersion()
Version of OpenSearch that the node is running ornullif we don't know the version.
-
getRoles
public Node.Roles getRoles()
Roles that the OpenSearch process on the host has ornullif we don't know what roles the node has.
-
getAttributes
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getAttributes()
Attributes declared on the node.
-
toString
public java.lang.String toString()
Convert node to string representation- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
Compare two nodes for equality- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- node instance to compare with
-
hashCode
public int hashCode()
Calculate the hash code of the node- Overrides:
hashCodein classjava.lang.Object
-
-