Package org.springframework.vault.client
Class VaultEndpoint
java.lang.Object
org.springframework.vault.client.VaultEndpoint
- All Implemented Interfaces:
Serializable
Value object that defines Vault connection coordinates.
A VaultEndpoint
defines the hostname, TCP port, the protocol scheme (HTTP or
HTTPS), and the context path prefix. The path defaults to API_VERSION
.
- Author:
- Mark Paluch
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic VaultEndpoint
Build the VaultURI
based on the givenpath
.createUriString
(String path) Build the Vault URI string based on the givenpath
.boolean
static VaultEndpoint
Create aVaultEndpoint
given aURI
.getHost()
getPath()
int
getPort()
int
hashCode()
void
Sets the hostname.void
void
setPort
(int port) void
toString()
-
Field Details
-
API_VERSION
- See Also:
-
-
Constructor Details
-
VaultEndpoint
public VaultEndpoint()
-
-
Method Details
-
create
- Parameters:
host
- must not be empty or null.port
- must be a valid port in the range of 1-65535- Returns:
- a new
VaultEndpoint
.
-
from
Create aVaultEndpoint
given aURI
.- Parameters:
uri
- must contain hostname, port and scheme, must not be empty or null.- Returns:
- a new
VaultEndpoint
.
-
getHost
- Returns:
- the hostname.
-
setHost
Sets the hostname.- Parameters:
host
- must not be empty or null.
-
getPort
public int getPort()- Returns:
- the port.
-
setPort
public void setPort(int port) - Parameters:
port
- must be a valid port in the range of 1-65535
-
getScheme
- Returns:
- the protocol scheme.
-
setScheme
- Parameters:
scheme
- must be http or https.
-
getPath
- Returns:
- the context path prefix.
- Since:
- 2.1
-
setPath
- Parameters:
path
- context path prefix. Must not be null or empty and must not start with a leading slash.- Since:
- 2.1
-
createUri
Build the VaultURI
based on the givenpath
.- Parameters:
path
- must not be empty or null.- Returns:
- constructed
URI
.
-
createUriString
Build the Vault URI string based on the givenpath
.- Parameters:
path
- must not be empty or null.- Returns:
- constructed URI String.
-
equals
-
hashCode
public int hashCode() -
toString
-