Package com.atlassian.jira.user
Class ServiceAccountApplicationUserImpl
java.lang.Object
com.atlassian.jira.user.ServiceAccountApplicationUserImpl
- All Implemented Interfaces:
com.atlassian.crowd.embedded.api.service.ServiceAccount,WithId,WithKey,ApplicationUser,ServiceAccountApplicationUser,Serializable,Principal
public class ServiceAccountApplicationUserImpl
extends Object
implements ServiceAccountApplicationUser
- See Also:
-
Field Summary
Fields inherited from interface com.atlassian.jira.user.ServiceAccountApplicationUser
SERVICE_ACCOUNT_DUMMY_DIRECTORY_IDFields inherited from interface com.atlassian.jira.entity.WithId
ID_COMPARATOR -
Constructor Summary
ConstructorsConstructorDescriptionServiceAccountApplicationUserImpl(Long id, String key, com.atlassian.crowd.embedded.api.service.ServiceAccount serviceAccount) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanAccessResource(ResourceRestrictionEntityType resourceType, String resourceId) This decorator is used in dev mode to help discover places where directory id or directory properties are read from service account object.booleanImplementations must ensure equality based on getKey().longcom.atlassian.crowd.embedded.api.UserReturns the display name of the user.getId()getKey()Returns the key which distinguishes the ApplicationUser as unique.getName()Synonym forApplicationUser.getUsername()and implementation ofPrincipal.getName().Map<com.atlassian.crowd.embedded.api.service.ResourceType, Set<com.atlassian.crowd.embedded.api.service.Resource>> booleanhasAnyScope(String... anyScopes) inthashCode()Implementations must produce a hashcode based on getKey().booleanisActive()toString()withScopes(Set<com.atlassian.oauth2.scopes.api.Scope> allGrantedScopes) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.atlassian.jira.user.ServiceAccountApplicationUser
getType
-
Constructor Details
-
ServiceAccountApplicationUserImpl
-
-
Method Details
-
withScopes
public ServiceAccountApplicationUser withScopes(Set<com.atlassian.oauth2.scopes.api.Scope> allGrantedScopes) -
devModeDecorator
This decorator is used in dev mode to help discover places where directory id or directory properties are read from service account object. These methods shouldn't be called on service account object, as it is not a directory user. As a defensive measure, we do not throw exception in production code, but we do in dev mode. -
getKey
Description copied from interface:ApplicationUserReturns the key which distinguishes the ApplicationUser as unique. The same key is shared by allUsers with the same username (ignoring case) across all user directories.- Specified by:
getKeyin interfaceApplicationUser- Specified by:
getKeyin interfaceWithKey- Returns:
- the key which distinguishes the ApplicationUser as unique
-
getUsername
- Specified by:
getUsernamein interfaceApplicationUser- Returns:
- the username (login) of the user; must never be
null. - See Also:
-
getName
Description copied from interface:ApplicationUserSynonym forApplicationUser.getUsername()and implementation ofPrincipal.getName().- Specified by:
getNamein interfaceApplicationUser- Specified by:
getNamein interfacePrincipal- Returns:
- the username (login) of the user; must never be
null. - See Also:
-
getDirectoryId
public long getDirectoryId()- Specified by:
getDirectoryIdin interfaceApplicationUser- Returns:
- the ID of the user directory that this user comes from.
-
isActive
public boolean isActive()- Specified by:
isActivein interfaceApplicationUser- Specified by:
isActivein interfacecom.atlassian.crowd.embedded.api.service.ServiceAccount- Returns:
trueif this user is active.
-
getEmailAddress
- Specified by:
getEmailAddressin interfaceApplicationUser- Returns:
- email address of the user.
-
getDisplayName
Description copied from interface:ApplicationUserReturns the display name of the user. This is sometimes referred to as "full name".- Specified by:
getDisplayNamein interfaceApplicationUser- Specified by:
getDisplayNamein interfacecom.atlassian.crowd.embedded.api.service.ServiceAccount- Returns:
- display name of the user, must never be null.
-
getDescription
- Specified by:
getDescriptionin interfacecom.atlassian.crowd.embedded.api.service.ServiceAccount
-
getResourceRestrictions
public Map<com.atlassian.crowd.embedded.api.service.ResourceType,Set<com.atlassian.crowd.embedded.api.service.Resource>> getResourceRestrictions()- Specified by:
getResourceRestrictionsin interfacecom.atlassian.crowd.embedded.api.service.ServiceAccount
-
getDirectoryUser
public com.atlassian.crowd.embedded.api.User getDirectoryUser()- Specified by:
getDirectoryUserin interfaceApplicationUser- Returns:
- the user as seen by the particular user directory that this User is defined in.
-
getId
-
equals
Description copied from interface:ApplicationUserImplementations must ensure equality based on getKey(). -
hashCode
public int hashCode()Description copied from interface:ApplicationUserImplementations must produce a hashcode based on getKey(). -
toString
-
hasAnyScope
- Specified by:
hasAnyScopein interfaceServiceAccountApplicationUser
-
canAccessResource
- Specified by:
canAccessResourcein interfaceServiceAccountApplicationUser
-