Constructor
# new ServerInfo(name, ip, port)
initialize a instance of ServerInfo
Name | Type | Default | Description |
---|---|---|---|
name |
String | null | Specifies name of the server node where cache is running. |
ip |
InetAddress | null | Specifies InetAddress of the server node where cache is running. |
port |
number | 9800 | Specifies port for client to connect to the server node. |
Methods
# compareTo(obj)
Compares the ServerInfo on the basis of priority
Name | Type | Description |
---|---|---|
obj |
Object | The server info object to compare. |
0 if equals, -1 if lesser and 1 if greater than the comparing serverInfo
# equals(obj) → {boolean}
Compares two ServerInfo instances.
Name | Type | Description |
---|---|---|
obj |
Object | The server info object to compare. |
True if specified object is equal to this object otherwise false.
- Type
- boolean
# getIP() → {InetAddress}
Gets the IPAddress of the server node where cache is running.
IPAddress of the server node where cache is running.
- Type
- InetAddress
# getName()
Gets the name of the server node where cache is running.
# getPort() → {Number}
Gets the port for client to connect to the server node.
The port for client to connect to the server node.
- Type
- Number
# setIP(value)
Sets the IPAddress of the server node where cache is running.
Name | Type | Description |
---|---|---|
value |
String | The IPAddress of the server node where cache is running in form of a string. |
# setName(value)
Sets the name of the server node where cache is running.
Name | Type | Description |
---|---|---|
value |
string | The name of the server node where cache is running. |
# setPort(value)
Sets the port for client to connect to the server node.
Name | Type | Description |
---|---|---|
value |
Number | The port for client to connect to the server node. |
# toString() → {String}
Converts the value of this instance to its equivalent string representation.
The string representation of ServerInfo.
- Type
- String