Class HttpLocation
java.lang.Object
io.vertx.servicediscovery.types.HttpLocation
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
ConstructorsConstructorDescriptionCreates a newHttpLocationinstance.HttpLocation(JsonObject json) Creates a newHttpLocationfrom the given json objectHttpLocation(HttpLocation other) Creates a newHttpLocationinstance by copying another instance. -
Method Summary
Modifier and TypeMethodDescriptiongetHost()intgetPort()getRoot()booleanisSsl()setEndpoint(String endpoint) Sets the endpoint, which is the URL of the service.Sets the host.setPort(int port) Sets the portSets the path of the service (root)setSsl(boolean ssl) Sets whether or not the HTTP service is usinghttps.toJson()
-
Constructor Details
-
HttpLocation
public HttpLocation()Creates a newHttpLocationinstance. -
HttpLocation
Creates a newHttpLocationinstance by copying another instance.- Parameters:
other- the instance fo copy
-
HttpLocation
Creates a newHttpLocationfrom the given json object- Parameters:
json- the json object
-
-
Method Details
-
toJson
- Returns:
- a json representation of the current
HttpLocation.
-
getHost
- Returns:
- the host
-
setHost
Sets the host.- Parameters:
host- the host- Returns:
- the current
HttpLocation
-
setEndpoint
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
- Returns:
- the URL of the service
-
getPort
public int getPort()- Returns:
- the port.
-
setPort
Sets the port- Parameters:
port- the port- Returns:
- the current
HttpLocation
-
getRoot
- Returns:
- the path of the service (root)
-
setRoot
Sets the path of the service (root)- Parameters:
root- the root- Returns:
- the current
HttpLocation
-
setSsl
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.
-