public class VaultEndpoint extends Object implements Serializable
A VaultEndpoint
defines the hostname, TCP port, the protocol scheme (HTTP or
HTTPS), and the context path prefix. The path defaults to API_VERSION
.
Modifier and Type | Field and Description |
---|---|
static String |
API_VERSION |
Constructor and Description |
---|
VaultEndpoint() |
Modifier and Type | Method and Description |
---|---|
static VaultEndpoint |
create(String host,
int port)
|
URI |
createUri(String path)
Build the Vault
URI based on the given path . |
String |
createUriString(String path)
Build the Vault URI string based on the given
path . |
static VaultEndpoint |
from(URI uri)
Create a
VaultEndpoint given a URI . |
String |
getHost() |
String |
getPath() |
int |
getPort() |
String |
getScheme() |
void |
setHost(String host)
Sets the hostname.
|
void |
setPath(String path) |
void |
setPort(int port) |
void |
setScheme(String scheme) |
String |
toString() |
public static final String API_VERSION
public static VaultEndpoint create(String host, int port)
host
- must not be empty or null.port
- must be a valid port in the range of 1-65535VaultEndpoint
.public static VaultEndpoint from(URI uri)
VaultEndpoint
given a URI
.uri
- must contain hostname, port and scheme, must not be empty or
null.VaultEndpoint
.public String getHost()
public void setHost(String host)
host
- must not be empty or null.public int getPort()
public void setPort(int port)
port
- must be a valid port in the range of 1-65535public String getScheme()
public void setScheme(String scheme)
scheme
- must be http or https.public String getPath()
public void setPath(String path)
path
- context path prefix. Must not be null or empty and must not
start with a leading slash.public URI createUri(String path)
URI
based on the given path
.path
- must not be empty or null.URI
.public String createUriString(String path)
path
.path
- must not be empty or null.Copyright © 2016–2019 Pivotal Software, Inc.. All rights reserved.