com.sleepycat.je.rep.utilint
Class HostPortPair

java.lang.Object
  extended by com.sleepycat.je.rep.utilint.HostPortPair

public class HostPortPair
extends Object

Encapsulates the functionality around dealing with HostPort string pairs having the format: host[:port]


Field Summary
static String SEPARATOR
           
 
Constructor Summary
HostPortPair()
           
 
Method Summary
static String getHostname(String hostPortPair)
          Parses and returns the hostname string of a hostport pair
static int getPort(String hostPortPair)
          Parses and returns the port of a hostport pair
static InetSocketAddress getSocket(String hostPortPair)
          Parses a hostPort pair into the socket it represents.
static Set<InetSocketAddress> getSockets(String hostPortPairs)
          Parses hostPort pairs into sockets it represents.
static String getString(String host, int port)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEPARATOR

public static final String SEPARATOR
See Also:
Constant Field Values
Constructor Detail

HostPortPair

public HostPortPair()
Method Detail

getSocket

public static InetSocketAddress getSocket(String hostPortPair)
Parses a hostPort pair into the socket it represents.

Parameters:
hostPortPair -
Returns:
socket address for this host pair
Throws:
IllegalArgumentException - via ReplicatedEnvironment and Monitor ctors.

getSockets

public static Set<InetSocketAddress> getSockets(String hostPortPairs)
Parses hostPort pairs into sockets it represents.

Parameters:
hostPortPairs -
Returns:
a set of socket addresses for these host pairs

getString

public static String getString(String host,
                               int port)

getHostname

public static String getHostname(String hostPortPair)
Parses and returns the hostname string of a hostport pair


getPort

public static int getPort(String hostPortPair)
Parses and returns the port of a hostport pair



Copyright (c) 2004-2012 Oracle. All rights reserved.