ServerInfo

ServerInfo

Provide connection information for the client to the server node in cache.


Constructor

# new ServerInfo(name, ip, port)

initialize a instance of ServerInfo

Parameters:
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

Parameters:
Name Type Description
obj Object

The server info object to compare.

Returns:

0 if equals, -1 if lesser and 1 if greater than the comparing serverInfo

# equals(obj) → {boolean}

Compares two ServerInfo instances.

Parameters:
Name Type Description
obj Object

The server info object to compare.

Returns:

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.

Returns:

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.

Returns:

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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Returns:

The string representation of ServerInfo.

Type
String