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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic VaultEndpointBuild the VaultURIbased on the givenpath.createUriString(String path) Build the Vault URI string based on the givenpath.booleanstatic VaultEndpointCreate aVaultEndpointgiven aURI.static VaultEndpointCreate aVaultEndpointgiven aURI.getHost()getPath()intgetPort()inthashCode()voidSets the hostname.voidvoidsetPort(int port) voidtoString()
-
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 aVaultEndpointgiven aURI.- Parameters:
uri- must contain hostname, port and scheme, must not be empty or null.- Returns:
- a new
VaultEndpoint. - Since:
- 3.1
- See Also:
-
from
Create aVaultEndpointgiven 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 VaultURIbased 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
-