Package com.atlassian.bamboo.accesstoken
Class MutableAccessTokenImpl
- java.lang.Object
-
- com.atlassian.core.bean.EntityObject
-
- com.atlassian.bamboo.hibernate.HibernateEntityObject
-
- com.atlassian.bamboo.accesstoken.MutableAccessTokenImpl
-
- All Implemented Interfaces:
AccessToken
,MutableAccessToken
,BambooIdProvider
,BambooObject
,Cloneable
@Entity public class MutableAccessTokenImpl extends HibernateEntityObject implements MutableAccessToken
-
-
Constructor Summary
Constructors Constructor Description MutableAccessTokenImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
@NotNull Date
getCreationDate()
@Nullable Integer
getDaysUntilExpiry()
@NotNull String
getHashedToken()
@NotNull String
getName()
@NotNull Set<AccessTokenPermission>
getPermissions()
int
getPermissionsMask()
Get token permissions as mask.@NotNull String
getTokenId()
@NotNull String
getUserName()
int
hashCode()
void
setCreationDate(Date creationDate)
Set creation datevoid
setDaysUntilExpiry(@Nullable Integer daysUntilExpiry)
Set number of days until the token expires since its creation datevoid
setHashedToken(@NotNull String hashedToken)
Set hashed token valuevoid
setName(@NotNull String name)
Set token namevoid
setPermissions(@NotNull Iterable<AccessTokenPermission> permissions)
Set token permissionsvoid
setPermissionsMask(int permissionsMask)
Set token permissions as mask.void
setTokenId(@NotNull String tokenId)
Set token unique idvoid
setUserName(@NotNull String userName)
Set token ownerAccessToken
toAccessToken()
-
Methods inherited from class com.atlassian.bamboo.hibernate.HibernateEntityObject
getId, setId
-
Methods inherited from class com.atlassian.core.bean.EntityObject
clone, getCurrentDate, getLastModificationDate, setClock, setLastModificationDate
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.atlassian.bamboo.core.BambooIdProvider
getId
-
Methods inherited from interface com.atlassian.bamboo.core.BambooObject
setId
-
-
-
-
Method Detail
-
getHashedToken
@NotNull public @NotNull String getHashedToken()
- Specified by:
getHashedToken
in interfaceMutableAccessToken
- Returns:
- Hashed token value
-
setHashedToken
public void setHashedToken(@NotNull @NotNull String hashedToken)
Description copied from interface:MutableAccessToken
Set hashed token value- Specified by:
setHashedToken
in interfaceMutableAccessToken
-
getTokenId
@NotNull public @NotNull String getTokenId()
- Specified by:
getTokenId
in interfaceAccessToken
- Returns:
- unique token id
-
setTokenId
public void setTokenId(@NotNull @NotNull String tokenId)
Description copied from interface:MutableAccessToken
Set token unique id- Specified by:
setTokenId
in interfaceMutableAccessToken
-
getName
@NotNull public @NotNull String getName()
- Specified by:
getName
in interfaceAccessToken
- Returns:
- name of the token
-
setName
public void setName(@NotNull @NotNull String name)
Description copied from interface:MutableAccessToken
Set token name- Specified by:
setName
in interfaceMutableAccessToken
-
getUserName
@NotNull public @NotNull String getUserName()
- Specified by:
getUserName
in interfaceAccessToken
- Returns:
- token owner user name
-
setUserName
public void setUserName(@NotNull @NotNull String userName)
Description copied from interface:MutableAccessToken
Set token owner- Specified by:
setUserName
in interfaceMutableAccessToken
-
getCreationDate
@NotNull public @NotNull Date getCreationDate()
- Specified by:
getCreationDate
in interfaceAccessToken
- Overrides:
getCreationDate
in classcom.atlassian.core.bean.EntityObject
- Returns:
- token creation date
-
setCreationDate
public void setCreationDate(Date creationDate)
Description copied from interface:MutableAccessToken
Set creation date- Specified by:
setCreationDate
in interfaceMutableAccessToken
- Overrides:
setCreationDate
in classcom.atlassian.core.bean.EntityObject
-
setPermissions
public void setPermissions(@NotNull @NotNull Iterable<AccessTokenPermission> permissions)
Description copied from interface:MutableAccessToken
Set token permissions- Specified by:
setPermissions
in interfaceMutableAccessToken
-
getPermissions
@NotNull public @NotNull Set<AccessTokenPermission> getPermissions()
- Specified by:
getPermissions
in interfaceAccessToken
- Returns:
- permissions granted to this token
-
getPermissionsMask
public int getPermissionsMask()
Description copied from interface:MutableAccessToken
Get token permissions as mask.- Specified by:
getPermissionsMask
in interfaceMutableAccessToken
-
setPermissionsMask
public void setPermissionsMask(int permissionsMask)
Description copied from interface:MutableAccessToken
Set token permissions as mask.- Specified by:
setPermissionsMask
in interfaceMutableAccessToken
-
getDaysUntilExpiry
@Nullable public @Nullable Integer getDaysUntilExpiry()
- Specified by:
getDaysUntilExpiry
in interfaceAccessToken
- Returns:
- number of days until the token expires since its creation date
-
setDaysUntilExpiry
public void setDaysUntilExpiry(@Nullable @Nullable Integer daysUntilExpiry)
Description copied from interface:MutableAccessToken
Set number of days until the token expires since its creation date- Specified by:
setDaysUntilExpiry
in interfaceMutableAccessToken
-
toAccessToken
public AccessToken toAccessToken()
- Specified by:
toAccessToken
in interfaceAccessToken
- Returns:
- safe version of access token without authentication token itself
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classcom.atlassian.core.bean.EntityObject
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classcom.atlassian.core.bean.EntityObject
-
-