Top Description Fields Constructors Methods
org.apache.derby.impl.store.replication.net

public Class SlaveAddress

extends Object
Class Inheritance
Imports
java.net.InetAddress, .UnknownHostException

Encapsulates the host name and the port number of the slave machine.

Field Summary

Modifier and TypeField and Description
public static final int
DEFAULT_PORT_NO

Used as the default port number if the port number is not mentioned.

private final InetAddress
hostAddress

Contains the IP Address of the slave to replicate to.

private final int
portNumber

Contains the port number at which the slave is listening for connections from the master.

Constructor Summary

AccessConstructor and Description
public
SlaveAddress(String
a String that contains the host name of the slave.
hostName
,
int
an int that contains the port number of the slave.
portNumber
)

Constructor initializes the host name and the port number with valid values.

Method Summary

Modifier and TypeMethod and Description
public InetAddress

Returns:

an IP Address corresponding to the slave host name.
getHostAddress
()

Used to get the IP Address corresponding to the host name of the slave.

public int

Returns:

an int representing the value of the port number of the slave.
getPortNumber
()

Used to get the port number of the slave.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_PORT_NOback to summary
public static final int DEFAULT_PORT_NO

Used as the default port number if the port number is not mentioned. Port number 4851 is registered for Derby Replication at IANA (See: http://www.iana.org/assignments/port-numbers)

hostAddressback to summary
private final InetAddress hostAddress

Contains the IP Address of the slave to replicate to.

portNumberback to summary
private final int portNumber

Contains the port number at which the slave is listening for connections from the master.

Constructor Detail

SlaveAddressback to summary
public SlaveAddress(String hostName, int portNumber) throws UnknownHostException

Constructor initializes the host name and the port number with valid values. If a valid host name or port number is not provided then these are initialized to default values.

Parameters
hostName:String

a String that contains the host name of the slave.

portNumber:int

an int that contains the port number of the slave.

Exceptions
UnknownHostException:
If an exception occurs while trying to resolve the host name.

Method Detail

getHostAddressback to summary
public InetAddress getHostAddress()

Used to get the IP Address corresponding to the host name of the slave.

Returns:InetAddress

an IP Address corresponding to the slave host name.

getPortNumberback to summary
public int getPortNumber()

Used to get the port number of the slave.

Returns:int

an int representing the value of the port number of the slave.