Class ServerAddress
java.lang.Object
de.iip_ecosphere.platform.support.ServerAddress
- All Implemented Interfaces:
Serializable
Represents a reusable server address.
- Author:
- Holger Eichelberger, SSE
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionServerAddress(Schema schema) Creates a newLOCALHOSTserver address instance on an ephemerial port.ServerAddress(Schema schema, int port) Creates a newLOCALHOSTserver address instance.ServerAddress(Schema schema, String host, int port) Creates a new server address instance. -
Method Summary
Modifier and TypeMethodDescriptionbooleangetHost()Returns the host name.intgetPort()Returns the port number.Returns the schema.inthashCode()static booleanisValidPort(int port) Returns whetherportis a valid port number.final StringReturns the URI representation of the server address apart from overridden extensions intoUri().toUri()Returns the URI representation of this server address.static intvalidatePort(int port)
-
Field Details
-
LOCALHOST
- See Also:
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
schema
-
host
-
port
private int port
-
-
Constructor Details
-
ServerAddress
Creates a newLOCALHOSTserver address instance on an ephemerial port.- Parameters:
schema- the schema
-
ServerAddress
Creates a newLOCALHOSTserver address instance.- Parameters:
schema- the schemaport- the port number (ignored if negative)
-
ServerAddress
Creates a new server address instance.- Parameters:
schema- the schemahost- the hostname (turned toLOCALHOSTif null or empty)port- the port number
-
-
Method Details
-
getSchema
Returns the schema.- Returns:
- the schema
-
getHost
Returns the host name.- Returns:
- the host name
-
getPort
public int getPort()Returns the port number.- Returns:
- the port number
-
toUri
Returns the URI representation of this server address. Intended to be overridden by subclasses.- Returns:
- the URI representation
-
toServerUri
Returns the URI representation of the server address apart from overridden extensions intoUri().- Returns:
- the URI representation of the server address
-
equals
-
hashCode
public int hashCode() -
validatePort
public static int validatePort(int port) - Parameters:
port- the port to validate- Returns:
- the validated port, i.e.,
portor an ephemeral port number - See Also:
-
isValidPort
public static boolean isValidPort(int port) Returns whetherportis a valid port number.- Parameters:
port- the port number- Returns:
truefor valid,falseelse
-