public class CredentialsManagerImpl extends Object implements CredentialsManager
CredentialsAccessor.IsCredentialsOfType| Constructor and Description |
|---|
CredentialsManagerImpl() |
| Modifier and Type | Method and Description |
|---|---|
CredentialsData |
createCredentials(CredentialTypeModuleDescriptor credentialDescriptor,
String credentialsName,
Map<String,String> credentialsConfig)
Creates Credentials from the configuration map and stores them in the database.
|
CredentialsData |
createOrUpdateCredentials(CredentialsData credentials)
Creates credentials based on the object representation.
|
void |
deleteCredentials(long id)
Deletes credentials based on Id
|
CredentialsData |
editCredentials(long credentialsId,
String credentialsName,
Map<String,String> credentialsConfig)
Updates Credentials with values in the configuration map.
|
Iterable<CredentialsData> |
getAllCredentials() |
Iterable<CredentialsData> |
getAllCredentials(String pluginKey) |
CredentialsData |
getCredentials(long id)
Gets the Shared Credentials by id
|
CredentialsData |
getCredentialsByName(String name)
Find shared credentials by name
|
CredentialsData |
getCredentialsByOid(BambooEntityOid oid)
Find shared credentials by
BambooEntityOid |
CredentialTypeModuleDescriptor |
getCredentialTypeDescriptor(String pluginKey) |
List<CredentialTypeModuleDescriptor> |
getCredentialTypeDescriptors() |
boolean |
hasAnyCredentials(String pluginKey) |
CredentialsData |
mergeImportedEntity(CredentialsData importedEntity)
Merges the state of the given imported entity into the database.
|
CredentialTypeExporter |
retrieveCredentialTypeExporter(String pluginKey)
Find credential type exporter for given plugin key.
|
CredentialsData |
updateCredentialsName(long id,
String name)
Updates shared credentials name
|
void |
validate(CredentialsData importedEntity)
Validate entity before saving it in database.
|
@NotNull public List<CredentialTypeModuleDescriptor> getCredentialTypeDescriptors()
getCredentialTypeDescriptors in interface CredentialsManager@Nullable public CredentialTypeModuleDescriptor getCredentialTypeDescriptor(@Nullable String pluginKey)
getCredentialTypeDescriptor in interface CredentialsManager@NotNull public CredentialsData updateCredentialsName(long id, @NotNull String name) throws WebValidationException
CredentialsManagerupdateCredentialsName in interface CredentialsManagerid - The id of the object to updatename - The new name to identify the credentialsWebValidationException@NotNull public CredentialsData createOrUpdateCredentials(@NotNull CredentialsData credentials)
CredentialsManagerThis method encrypts the values of the credentials, for example for ssh encrypts the ssh key and ssh passphrase.
createOrUpdateCredentials in interface CredentialsManagercredentials - The object representation with the data to save.@NotNull public CredentialsData createCredentials(@NotNull CredentialTypeModuleDescriptor credentialDescriptor, @NotNull String credentialsName, @NotNull Map<String,String> credentialsConfig)
CredentialsManagerThis method encrypts the values of the credentials, for example for ssh encrypts the ssh key and ssh passphrase.
createCredentials in interface CredentialsManagercredentialDescriptor - The plugin module descriptor for the credential type being created.credentialsName - The name for the credentials.credentialsConfig - The configuration map containing the credential values as defined by the plugin for
this credential type.@NotNull public CredentialsData editCredentials(long credentialsId, @NotNull String credentialsName, @NotNull Map<String,String> credentialsConfig)
CredentialsManagerThis method encrypts the values of the credentials, for example for ssh encrypts the ssh key and ssh passphrase.
editCredentials in interface CredentialsManagercredentialsId - The ID of the credentials to update.credentialsName - The name for the credentials.credentialsConfig - The configuration map containing the credential values as defined by the plugin for this
credential type.public CredentialsData getCredentials(long id)
CredentialsAccessorgetCredentials in interface CredentialsAccessorpublic CredentialsData getCredentialsByOid(BambooEntityOid oid)
CredentialsAccessorBambooEntityOidgetCredentialsByOid in interface CredentialsAccessorpublic CredentialsData getCredentialsByName(String name)
CredentialsAccessorgetCredentialsByName in interface CredentialsAccessor@NotNull public Iterable<CredentialsData> getAllCredentials()
getAllCredentials in interface CredentialsAccessor@NotNull public Iterable<CredentialsData> getAllCredentials(@NotNull String pluginKey)
getAllCredentials in interface CredentialsAccessorpublic boolean hasAnyCredentials(@NotNull
String pluginKey)
hasAnyCredentials in interface CredentialsAccessorpublic void deleteCredentials(long id)
CredentialsManagerdeleteCredentials in interface CredentialsManagerid - id of the object to deletepublic void validate(@NotNull
CredentialsData importedEntity)
throws com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException
CredentialsManagervalidate in interface CredentialsManagerimportedEntity - imported entitycom.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException@NotNull public CredentialTypeExporter retrieveCredentialTypeExporter(@Nullable String pluginKey)
CredentialsManagerretrieveCredentialTypeExporter in interface CredentialsManager@NotNull public CredentialsData mergeImportedEntity(@NotNull CredentialsData importedEntity)
CredentialsManagerThis service will attempt to merge the entity based on ImmutableEntityWithOid.getOid(), and if there's no
match, based on CredentialsData.getName(). If an existing entity is found, then it will be updated.
Otherwise, a new database entity will be created.
It's assumed that this method is used in specs import only as it's sending analytic event.
mergeImportedEntity in interface CredentialsManagerimportedEntity - imported entityCopyright © 2017 Atlassian Software Systems Pty Ltd. All rights reserved.