Package com.iizix.test.client
Class DestinationServer
java.lang.Object
com.iizix.test.client.DestinationServer
The destination server to contact. This class is not thread safe.
- Author:
- Christopher Mindus
Constructor Summary
ConstructorDescriptionDestinationServer
(String hostName, int port, boolean isSecure, boolean isRedirectionAllowed) Constructor.Method Summary
Modifier and TypeMethodDescriptionboolean
Checks if two destination server object are equal.Gets the server host name.int
getPort()
Gets the port of the server.int
hashCode()
Returns the hashCode.boolean
Checks if it's the default port.boolean
Returns whether redirection to another server is allowed.boolean
isSecure()
Gets if SSL is used or not.toString()
Creates a string representation of the instance.
Constructor Details
DestinationServer
Constructor.- Parameters:
hostName
- The server host name.port
- Port number, -1 for default (80 for non-secure, 443 for secure).isSecure
- Flag for server secure.isRedirectionAllowed
- Flag for redirection allowed.- Throws:
NullPointerException
- IfhostName
is null.IllegalArgumentException
- If port is not -1 or in range of 1-65535.
Method Details
getHostName
Gets the server host name.- Returns:
- The host name.
isDefaultPort
public boolean isDefaultPort()Checks if it's the default port.- Returns:
- true if port is -1 or port is 80 and it's not secure, or 443 and it's secure, false otherwise.
getPort
public int getPort()Gets the port of the server.- Returns:
- The port, where the value -1 for default is changed to 80 for non-secure, or 443 for secure.
isSecure
public boolean isSecure()Gets if SSL is used or not.- Returns:
- The isSecure flag.
isRedirectionAllowed
public boolean isRedirectionAllowed()Returns whether redirection to another server is allowed.- Returns:
- The isRedirectionAllowed flag.
toString
Creates a string representation of the instance.hashCode
public int hashCode()Returns the hashCode.equals
Checks if two destination server object are equal.