Class SharedCredentials<B extends SharedCredentials<B,C>,C extends SharedCredentialsProperties>
- java.lang.Object
-
- com.atlassian.bamboo.specs.api.builders.EntityPropertiesBuilder<T>
-
- com.atlassian.bamboo.specs.api.builders.RootEntityPropertiesBuilder<C>
-
- com.atlassian.bamboo.specs.api.builders.credentials.SharedCredentials<B,C>
-
- Direct Known Subclasses:
AnySharedCredentials,SshCredentials,UsernamePasswordCredentials
public abstract class SharedCredentials<B extends SharedCredentials<B,C>,C extends SharedCredentialsProperties> extends RootEntityPropertiesBuilder<C>
Represents a shared credentials data. Global shared credentials can be used by any plan. Project shared credentials can be used only by plans in Project.This class contains common data only. In order to define a specific type of credentials one should use the specialised implementation or, if such is not available,
AnySharedCredentialsclass.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Stringnameprotected BambooOidPropertiesoidprotected ProjectPropertiesprojectstatic java.lang.StringTYPE
-
Constructor Summary
Constructors Modifier Constructor Description protectedSharedCredentials()protectedSharedCredentials(@NotNull java.lang.String name)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Cbuild()java.lang.StringhumanReadableId()Entity type and id representation that is shown to human.java.lang.StringhumanReadableType()Entity type that is shown to human.Bname(@NotNull java.lang.String name)Set the name by which credentials will be identified by Bamboo.Boid(@Nullable BambooOid oid)Set the credential's oid from oid string.Boid(@Nullable java.lang.String oid)Set the credential's oid.Bproject(@NotNull Project project)Set the credential's project.
-
-
-
Field Detail
-
TYPE
public static final java.lang.String TYPE
- See Also:
- Constant Field Values
-
name
protected java.lang.String name
-
oid
protected BambooOidProperties oid
-
project
protected ProjectProperties project
-
-
Constructor Detail
-
SharedCredentials
protected SharedCredentials()
-
SharedCredentials
protected SharedCredentials(@NotNull @NotNull java.lang.String name) throws PropertiesValidationException- Throws:
PropertiesValidationException
-
-
Method Detail
-
name
public B name(@NotNull @NotNull java.lang.String name)
Set the name by which credentials will be identified by Bamboo. In the absence of oid, the name is used to identify the shared credential. If the shared credential with given name does not exist, a new one is created, otherwise existing one is updated.- See Also:
oid(BambooOid)
-
oid
public B oid(@Nullable @Nullable java.lang.String oid) throws PropertiesValidationException
Set the credential's oid.If set, it is used to identify the shared credential. If the shared credential with given oid does not exist, a new one is created, otherwise existing one is updated. Setting both oid and name may result in existing shared credential being renamed.
- Throws:
PropertiesValidationException
-
oid
public B oid(@Nullable @Nullable BambooOid oid) throws PropertiesValidationException
Set the credential's oid from oid string.If set, it is used to identify the shared credential. If the shared credential with given oid does not exist, a new one is created, otherwise existing one is updated. Setting both oid and name may result in existing shared credential being renamed.
- Throws:
PropertiesValidationException
-
project
public B project(@NotNull @NotNull Project project)
Set the credential's project.If set, it is Project shared credentials, otherwise it is Global Shared Credentials.
-
humanReadableType
public java.lang.String humanReadableType()
Description copied from class:RootEntityPropertiesBuilderEntity type that is shown to human.- Specified by:
humanReadableTypein classRootEntityPropertiesBuilder<C extends SharedCredentialsProperties>
-
humanReadableId
public java.lang.String humanReadableId()
Description copied from class:RootEntityPropertiesBuilderEntity type and id representation that is shown to human.- Specified by:
humanReadableIdin classRootEntityPropertiesBuilder<C extends SharedCredentialsProperties>
-
build
protected abstract C build()
- Specified by:
buildin classEntityPropertiesBuilder<C extends SharedCredentialsProperties>
-
-