Package io.vertx.servicediscovery.types
Class HttpLocation
- java.lang.Object
-
- io.vertx.servicediscovery.types.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 Summary
Constructors Constructor Description HttpLocation()Creates a newHttpLocationinstance.HttpLocation(JsonObject json)Creates a newHttpLocationfrom the given json objectHttpLocation(HttpLocation other)Creates a newHttpLocationinstance by copying another instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetEndpoint()StringgetHost()intgetPort()StringgetRoot()booleanisSsl()HttpLocationsetEndpoint(String endpoint)Sets the endpoint, which is the URL of the service.HttpLocationsetHost(String host)Sets the host.HttpLocationsetPort(int port)Sets the portHttpLocationsetRoot(String root)Sets the path of the service (root)HttpLocationsetSsl(boolean ssl)Sets whether or not the HTTP service is usinghttps.JsonObjecttoJson()
-
-
-
Constructor Detail
-
HttpLocation
public HttpLocation()
Creates a newHttpLocationinstance.
-
HttpLocation
public HttpLocation(HttpLocation other)
Creates a newHttpLocationinstance by copying another instance.- Parameters:
other- the instance fo copy
-
HttpLocation
public HttpLocation(JsonObject json)
Creates a newHttpLocationfrom the given json object- Parameters:
json- the json object
-
-
Method Detail
-
toJson
public JsonObject toJson()
- Returns:
- a json representation of the current
HttpLocation.
-
getHost
public String getHost()
- Returns:
- the host
-
setHost
public HttpLocation setHost(String host)
Sets the host.- Parameters:
host- the host- Returns:
- the current
HttpLocation
-
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 usinghttps.- Parameters:
ssl-trueto denotes that the service usehttps- Returns:
- the current
HttpLocation
-
isSsl
public boolean isSsl()
- Returns:
trueif the location is usinghttps,falseotherwise.
-
-