Class HttpLocation


  • public class HttpLocation
    extends Object
    Represents the location of a HTTP endpoint. This object (its json representation) will be used as "location" in a service record.
    Author:
    Clement Escoffier
    • Constructor Detail

      • HttpLocation

        public HttpLocation()
        Creates a new HttpLocation instance.
      • HttpLocation

        public HttpLocation​(HttpLocation other)
        Creates a new HttpLocation instance by copying another instance.
        Parameters:
        other - the instance fo copy
      • HttpLocation

        public HttpLocation​(JsonObject json)
        Creates a new HttpLocation from the given json object
        Parameters:
        json - the json object
    • Method Detail

      • getHost

        public String getHost()
        Returns:
        the host
      • setEndpoint

        public HttpLocation setEndpoint​(String endpoint)
        Sets the endpoint, which is the URL of the service. The endpoint is automatically computed when you use the other `setX` method.
        Parameters:
        endpoint - the endpoint
        Returns:
        the current HttpLocation
      • getEndpoint

        public String getEndpoint()
        Returns:
        the URL of the service
      • getPort

        public int getPort()
        Returns:
        the port.
      • setPort

        public HttpLocation setPort​(int port)
        Sets the port
        Parameters:
        port - the port
        Returns:
        the current HttpLocation
      • getRoot

        public String getRoot()
        Returns:
        the path of the service (root)
      • setRoot

        public HttpLocation setRoot​(String root)
        Sets the path of the service (root)
        Parameters:
        root - the root
        Returns:
        the current HttpLocation
      • setSsl

        public HttpLocation setSsl​(boolean ssl)
        Sets whether or not the HTTP service is using https.
        Parameters:
        ssl - true to denotes that the service use https
        Returns:
        the current HttpLocation
      • isSsl

        public boolean isSsl()
        Returns:
        true if the location is using https, false otherwise.