Class Endpoint
java.lang.Object
de.iip_ecosphere.platform.support.ServerAddress
de.iip_ecosphere.platform.support.Endpoint
- All Implemented Interfaces:
Serializable
public class Endpoint
extends de.iip_ecosphere.platform.support.ServerAddress
Implements a reusable server endpoint.
- Author:
- Holger Eichelberger, SSE
- See Also:
-
Field Summary
FieldsFields inherited from class de.iip_ecosphere.platform.support.ServerAddress
LOCALHOST -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new localhost endpoint instance.Creates a new localhost endpoint instance on an ephemerial port.Creates a new endpoint instance.Creates a new endpoint based on a given server address. -
Method Summary
Methods inherited from class de.iip_ecosphere.platform.support.ServerAddress
getHost, getPort, getSchema, isValidPort, toServerUri, validatePort
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
endpoint
-
-
Constructor Details
-
Endpoint
Creates a new localhost endpoint instance on an ephemerial port.- Parameters:
schema- the schemaendpoint- the endpoint path on the server (if it does not start with a "/", a leading "/" will be added)
-
Endpoint
Creates a new localhost endpoint instance.- Parameters:
schema- the schemaport- the port number (ignored if negative)endpoint- the endpoint path on the server (if it does not start with a "/", a leading "/" will be added)
-
Endpoint
public Endpoint(de.iip_ecosphere.platform.support.Schema schema, String host, int port, String endpoint) Creates a new endpoint instance.- Parameters:
schema- the schemahost- the hostname (turned to "localhost" if null or empty)port- the port numberendpoint- the endpoint path on the server (if it does not start with a "/", a leading "/" will be added)
-
Endpoint
Creates a new endpoint based on a given server address.- Parameters:
server- the server addressendpoint- the endpoint path on the server (if it does not start with a "/", a leading "/" will be added)
-
-
Method Details
-
getEndpoint
Returns the endpoint.- Returns:
- the endpoint with leading "/"
-
toUri
Returns the URI representation of this endpoint.- Overrides:
toUriin classde.iip_ecosphere.platform.support.ServerAddress- Returns:
- the URI representation
-
checkEndpoint
Checks/fixes an endpoint path.- Parameters:
endpoint- the endpoint path- Returns:
- the (fixed) endpoint path
-
equals
- Overrides:
equalsin classde.iip_ecosphere.platform.support.ServerAddress
-
hashCode
public int hashCode()- Overrides:
hashCodein classde.iip_ecosphere.platform.support.ServerAddress
-
valueOf
Turns an URI into an endpoint.- Parameters:
uri- the URI- Returns:
- the endpoint, may be null if not valid
-