Spring Data for VMware GemFire
Class ConnectionEndpoint
java.lang.Object
org.springframework.data.gemfire.support.ConnectionEndpoint
- All Implemented Interfaces:
Cloneable,Comparable<ConnectionEndpoint>
The ConnectionEndpoint class models a GemFire connection endpoint in the format of hostname[portnumber],
where hostname is the network name or IP address of the host.
- Since:
- 1.6.3
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConnectionEndpoint(String host, int port) Constructs a ConnectionEndpoint initialized with the specific host and port. -
Method Summary
Modifier and TypeMethodDescriptionprotected Objectclone()intcompareTo(ConnectionEndpoint connectionEndpoint) booleanstatic ConnectionEndpointfrom(int port) Factory method used to construct a newConnectionEndpointwith the givenportlistening on the default host.static ConnectionEndpointstatic ConnectionEndpointfrom(InetSocketAddress socketAddress) Factory method used to convert the givenInetSocketAddressinto aConnectionEndpoint.getHost()Gets the host in this ConnectionEndpoint.intgetPort()Gets the port number in this ConnectionEndpoint.inthashCode()static ConnectionEndpointParses the host and port String value into a valid ConnectionEndpoint.static ConnectionEndpointFactory method used to parse thehost and portvalue into a validConnectionEndpoint.Converts thisConnectionEndpointinto anInetSocketAddressrepresentation.toString()
-
Field Details
-
DEFAULT_PORT
protected static final int DEFAULT_PORT- See Also:
-
DEFAULT_HOST
- See Also:
-
GEMFIRE_HOST_PORT_SEPARATOR
- See Also:
-
STANDARD_HOST_PORT_SEPARATOR
- See Also:
-
-
Constructor Details
-
ConnectionEndpoint
Constructs a ConnectionEndpoint initialized with the specific host and port.- Parameters:
host- the hostname or IP address of the ConnectionEndpoint. If the host is unspecified, then ConnectionEndpoint.DEFAULT_HOST will be used.port- the (service) port number in this ConnectionEndpoint.- Throws:
IllegalArgumentException- if the port number is less than 0.- See Also:
-
-
Method Details
-
from
Factory method used to construct a newConnectionEndpointwith the givenportlistening on the default host.- Parameters:
port-portof theConnectionEndpoint.- Returns:
- a new
ConnectionEndpointwith the givenportlistening on the default host. - See Also:
-
from
- Parameters:
host-hostof theConnectionEndpoint.port-portof theConnectionEndpoint.- Returns:
- a new
ConnectionEndpointwith the givenhostandport.
-
from
Factory method used to convert the givenInetSocketAddressinto aConnectionEndpoint.- Parameters:
socketAddress-InetSocketAddressused to construct, configure and initialize theConnectionEndpoint.- Returns:
- a
ConnectionEndpointrepresenting theInetSocketAddress. - See Also:
-
parse
Parses the host and port String value into a valid ConnectionEndpoint.- Parameters:
hostPort- a String value containing the host and port formatted as 'host[port]'.- Returns:
- a valid ConnectionEndpoint initialized with the host and port, or with DEFAULT_PORT if port was unspecified.
- See Also:
-
parse
Factory method used to parse thehost and portvalue into a validConnectionEndpoint.- Parameters:
hostPort-Stringcontaining the host and port formatted as host[port] or host:port.defaultPort-Integerindicating the default port to use if the port is unspecified in thehost and portvalue.- Returns:
- a valid
ConnectionEndpointinitialized with thehost and port, or with the default port if port was unspecified. - See Also:
-
getHost
Gets the host in this ConnectionEndpoint.- Returns:
- a String value indicating the hostname or IP address in this ConnectionEndpoint.
-
getPort
public int getPort()Gets the port number in this ConnectionEndpoint.- Returns:
- an Integer value indicating the (service) port number in this ConnectionEndpoint.
-
toInetSocketAddress
Converts thisConnectionEndpointinto anInetSocketAddressrepresentation.- Returns:
- an
InetSocketAddressrepresentation of thisConnectionEndpoint. - See Also:
-
clone
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
compareTo
- Specified by:
compareToin interfaceComparable<ConnectionEndpoint>
-
equals
-
hashCode
public int hashCode() -
toString
-