public class CredHubCredentialTemplate extends Object implements CredHubCredentialOperations
| Constructor and Description |
|---|
CredHubCredentialTemplate(CredHubOperations credHubOperations)
Create a new
CredHubCredentialTemplate. |
| Modifier and Type | Method and Description |
|---|---|
void |
deleteByName(CredentialName name)
Delete a credential by its full name.
|
List<CredentialSummary> |
findByName(CredentialName name)
Find a credential using a full or partial name.
|
List<CredentialSummary> |
findByPath(String path)
Find a credential using a path.
|
<T,P> CredentialDetails<T> |
generate(ParametersRequest<P> parametersRequest)
Generate a new credential in CredHub, or overwrite an existing credential with a
new generated value.
|
List<CredentialPath> |
getAllPaths()
Deprecated.
|
<T> CredentialDetails<T> |
getById(String id,
Class<T> credentialType)
Retrieve a credential using its ID, as returned in a write request.
|
<T> CredentialDetails<T> |
getByName(CredentialName name,
Class<T> credentialType)
Retrieve a credential using its name, as passed to a write request.
|
<T> List<CredentialDetails<T>> |
getByNameWithHistory(CredentialName name,
Class<T> credentialType)
Retrieve a credential using its name, as passed to a write request.
|
<T> List<CredentialDetails<T>> |
getByNameWithHistory(CredentialName name,
int versions,
Class<T> credentialType)
Retrieve a credential using its name, as passed to a write request.
|
<T> CredentialDetails<T> |
regenerate(CredentialName name,
Class<T> credentialType)
Regenerate a credential in CredHub.
|
<T> CredentialDetails<T> |
write(CredentialRequest<T> credentialRequest)
Write a new credential to CredHub, or overwrite an existing credential with a new
value.
|
public CredHubCredentialTemplate(CredHubOperations credHubOperations)
CredHubCredentialTemplate.credHubOperations - the CredHubOperations to use for interactions with
CredHubpublic <T> CredentialDetails<T> write(CredentialRequest<T> credentialRequest)
CredHubCredentialOperationswrite in interface CredHubCredentialOperationsT - the credential implementation typecredentialRequest - the credential to write to CredHub; must not be
nullpublic <T,P> CredentialDetails<T> generate(ParametersRequest<P> parametersRequest)
CredHubCredentialOperationsgenerate in interface CredHubCredentialOperationsT - the credential implementation typeP - the credential parameter implementation typeparametersRequest - the parameters of the new credential to generate in
CredHub; must not be nullpublic <T> CredentialDetails<T> regenerate(CredentialName name, Class<T> credentialType)
CredHubCredentialOperationsregenerate in interface CredHubCredentialOperationsT - the credential implementation typename - the name of the credential; must not be nullcredentialType - the type of the credential to be regenerated; must not be
nullpublic <T> CredentialDetails<T> getById(String id, Class<T> credentialType)
CredHubCredentialOperationsgetById in interface CredHubCredentialOperationsT - the credential implementation typeid - the ID of the credential; must not be nullcredentialType - the type of the credential to be retrieved; must not be
nullpublic <T> CredentialDetails<T> getByName(CredentialName name, Class<T> credentialType)
CredHubCredentialOperationsgetByName in interface CredHubCredentialOperationsT - the credential implementation typename - the name of the credential; must not be nullcredentialType - the type of credential expected to be returnedpublic <T> List<CredentialDetails<T>> getByNameWithHistory(CredentialName name, Class<T> credentialType)
CredHubCredentialOperationsgetByNameWithHistory in interface CredHubCredentialOperationsT - the credential implementation typename - the name of the credential; must not be nullcredentialType - the type of credential expected to be returnedpublic <T> List<CredentialDetails<T>> getByNameWithHistory(CredentialName name, int versions, Class<T> credentialType)
CredHubCredentialOperationsgetByNameWithHistory in interface CredHubCredentialOperationsT - the credential implementation typename - the name of the credential; must not be nullversions - the number of historical versions to retrievecredentialType - the type of credential expected to be returnedpublic List<CredentialSummary> findByName(CredentialName name)
CredHubCredentialOperationsfindByName in interface CredHubCredentialOperationsname - the name of the credential; must not be nullpublic List<CredentialSummary> findByPath(String path)
CredHubCredentialOperationsfindByPath in interface CredHubCredentialOperationspath - the path to the credential; must not be null@Deprecated public List<CredentialPath> getAllPaths()
CredHubCredentialOperationsgetAllPaths in interface CredHubCredentialOperationspublic void deleteByName(CredentialName name)
CredHubCredentialOperationsdeleteByName in interface CredHubCredentialOperationsname - the name of the credential; must not be null