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 ServerAddress
Implements a reusable server endpoint.
Author:
Holger Eichelberger, SSE
See Also:
  • Field Details

  • Constructor Details

    • Endpoint

      public Endpoint(Schema schema, String endpoint)
      Creates a new localhost endpoint instance on an ephemerial port.
      Parameters:
      schema - the schema
      endpoint - the endpoint path on the server (if it does not start with a "/", a leading "/" will be added)
    • Endpoint

      public Endpoint(Schema schema, int port, String endpoint)
      Creates a new localhost endpoint instance.
      Parameters:
      schema - the schema
      port - 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(Schema schema, String host, int port, String endpoint)
      Creates a new endpoint instance.
      Parameters:
      schema - the schema
      host - the hostname (turned to "localhost" if null or empty)
      port - the port number
      endpoint - the endpoint path on the server (if it does not start with a "/", a leading "/" will be added)
    • Endpoint

      public Endpoint(ServerAddress server, String endpoint)
      Creates a new endpoint based on a given server address.
      Parameters:
      server - the server address
      endpoint - the endpoint path on the server (if it does not start with a "/", a leading "/" will be added)
  • Method Details

    • getEndpoint

      public String getEndpoint()
      Returns the endpoint.
      Returns:
      the endpoint with leading "/"
    • toUri

      public String toUri()
      Returns the URI representation of this endpoint.
      Overrides:
      toUri in class ServerAddress
      Returns:
      the URI representation
    • checkEndpoint

      public static String checkEndpoint(String endpoint)
      Checks/fixes an endpoint path.
      Parameters:
      endpoint - the endpoint path
      Returns:
      the (fixed) endpoint path
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class ServerAddress
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class ServerAddress
    • valueOf

      public static Endpoint valueOf(String uri)
      Turns an URI into an endpoint.
      Parameters:
      uri - the URI
      Returns:
      the endpoint, may be null if not valid