Class SlaveAddress
java.lang.Object
org.apache.derby.impl.store.replication.net.SlaveAddress
Encapsulates the host name and the port number of the slave machine.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Used as the default port number if the port number is not mentioned.private final InetAddress
Contains the IP Address of the slave to replicate to.private final int
Contains the port number at which the slave is listening for connections from the master. -
Constructor Summary
ConstructorsConstructorDescriptionSlaveAddress
(String hostName, int portNumber) Constructor initializes the host name and the port number with valid values. -
Method Summary
Modifier and TypeMethodDescriptionUsed to get the IP Address corresponding to the host name of the slave.int
Used to get the port number of the slave.
-
Field Details
-
hostAddress
Contains the IP Address of the slave to replicate to. -
portNumber
private final int portNumberContains the port number at which the slave is listening for connections from the master. -
DEFAULT_PORT_NO
public static final int DEFAULT_PORT_NOUsed 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)- See Also:
-
-
Constructor Details
-
SlaveAddress
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
- aString
that contains the host name of the slave.portNumber
- anint
that contains the port number of the slave.- Throws:
UnknownHostException
- If an exception occurs while trying to resolve the host name.
-
-
Method Details
-
getHostAddress
Used to get the IP Address corresponding to the host name of the slave.- Returns:
- an IP Address corresponding to the slave host name.
-
getPortNumber
public int getPortNumber()Used to get the port number of the slave.- Returns:
- an int representing the value of the port number of the slave.
-