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 newHttpLocation
instance.HttpLocation(JsonObject json)
Creates a newHttpLocation
from the given json objectHttpLocation(HttpLocation other)
Creates a newHttpLocation
instance by copying another instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getEndpoint()
String
getHost()
int
getPort()
String
getRoot()
boolean
isSsl()
HttpLocation
setEndpoint(String endpoint)
Sets the endpoint, which is the URL of the service.HttpLocation
setHost(String host)
Sets the host.HttpLocation
setPort(int port)
Sets the portHttpLocation
setRoot(String root)
Sets the path of the service (root)HttpLocation
setSsl(boolean ssl)
Sets whether or not the HTTP service is usinghttps
.JsonObject
toJson()
-
-
-
Constructor Detail
-
HttpLocation
public HttpLocation()
Creates a newHttpLocation
instance.
-
HttpLocation
public HttpLocation(HttpLocation other)
Creates a newHttpLocation
instance by copying another instance.- Parameters:
other
- the instance fo copy
-
HttpLocation
public HttpLocation(JsonObject json)
Creates a newHttpLocation
from 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
-true
to denotes that the service usehttps
- Returns:
- the current
HttpLocation
-
isSsl
public boolean isSsl()
- Returns:
true
if the location is usinghttps
,false
otherwise.
-
-