com.opensymphony.user
Class User

java.lang.Object
  extended by com.opensymphony.user.Entity
      extended by com.opensymphony.user.User
All Implemented Interfaces:
com.atlassian.crowd.embedded.api.User, Serializable, Comparable<com.atlassian.crowd.embedded.api.User>, Principal
Direct Known Subclasses:
MockOSUser

Deprecated. since 4.3 - use User instead

@Deprecated
public class User
extends Entity
implements com.atlassian.crowd.embedded.api.User

Entity to represent an actual User of the system. The user is backed by Crowd's Embedded Service.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.opensymphony.user.Entity
mutable, name
 
Constructor Summary
User(String name, ProviderAccessor providerAccessor, com.atlassian.crowd.embedded.api.CrowdService crowdService)
          Deprecated. Constructor is only called by UserManager.
User(com.atlassian.crowd.embedded.api.User crowdUser, com.atlassian.crowd.embedded.api.CrowdService crowdService)
          Deprecated.  
 
Method Summary
 boolean addToGroup(Group group)
          Deprecated. Use CrowdService.addUserToGroup(com.atlassian.crowd.embedded.api.User, com.atlassian.crowd.embedded.api.Group) instead. Since v4.4.
 boolean authenticate(String password)
          Deprecated. Use CrowdService.authenticate(String, String) instead. Since v4.4.
 int compareTo(com.atlassian.crowd.embedded.api.User other)
          Deprecated.  
 boolean equals(Object o)
          Deprecated. Compare name.
 long getDirectoryId()
          Deprecated.  
 String getDisplayName()
          Deprecated.  
 String getEmail()
          Deprecated. Use getEmailAddress() instead. Since v4.3.
 String getEmailAddress()
          Deprecated.  
 String getFullName()
          Deprecated. Use getDisplayName() instead. Since v4.3.
 List<String> getGroups()
          Deprecated. Use GroupManager.getGroupNamesForUser(String) instead. Since v4.4.
 int hashCode()
          Deprecated. Hashcode of name.
 boolean inGroup(Group group)
          Deprecated. Use GroupManager.isUserInGroup(com.atlassian.crowd.embedded.api.User, com.atlassian.crowd.embedded.api.Group) instead. Since v4.4.
 boolean inGroup(String groupName)
          Deprecated. Use GroupManager.isUserInGroup(String, String) instead. Since v4.4.
 boolean isActive()
          Deprecated.  
 void remove()
          Deprecated. Use CrowdService.removeUser(com.atlassian.crowd.embedded.api.User) instead. Since v4.4.
 boolean removeFromGroup(Group group)
          Deprecated. Use CrowdService.removeUserFromGroup(com.atlassian.crowd.embedded.api.User, com.atlassian.crowd.embedded.api.Group)} instead. Since v4.4.
 void setEmail(String email)
          Deprecated. Use CrowdService.updateUser(com.atlassian.crowd.embedded.api.User) instead. Since v4.4.
 void setFullName(String fullName)
          Deprecated. Use CrowdService.updateUser(com.atlassian.crowd.embedded.api.User) instead. Since v4.4.
 void setPassword(String password)
          Deprecated. Use CrowdService.updateUserCredential(com.atlassian.crowd.embedded.api.User, String) instead. Since v4.4.
 void store()
          Deprecated. Use CrowdService.updateUser(com.atlassian.crowd.embedded.api.User) for mutating users. Since v4.4.
protected  void update()
          Deprecated. Persists the current user in the embedded Crowd back-end.
 
Methods inherited from class com.opensymphony.user.Entity
getAccessProvider, getCredentialsProvider, getName, getProfileProvider, getPropertySet, getUserManager, isMutable, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.security.Principal
getName, toString
 

Constructor Detail

User

public User(com.atlassian.crowd.embedded.api.User crowdUser,
            com.atlassian.crowd.embedded.api.CrowdService crowdService)
Deprecated. 

User

public User(String name,
            ProviderAccessor providerAccessor,
            com.atlassian.crowd.embedded.api.CrowdService crowdService)
Deprecated. 
Constructor is only called by UserManager. If the user with the supplied name exists, then the user's attributes

Parameters:
name - username.
providerAccessor - accessors.
crowdService - service
Method Detail

setEmail

public void setEmail(String email)
Deprecated. Use CrowdService.updateUser(com.atlassian.crowd.embedded.api.User) instead. Since v4.4.

Convenience method to access property. This actually persists the new email address.

Parameters:
email - new email address.

getEmail

public String getEmail()
Deprecated. Use getEmailAddress() instead. Since v4.3.

Convenience method to access property.

Returns:
email address.

setFullName

public void setFullName(String fullName)
Deprecated. Use CrowdService.updateUser(com.atlassian.crowd.embedded.api.User) instead. Since v4.4.

Convenience method to access property. This actually persists the new full name.

Parameters:
fullName - new display name.

getFullName

public String getFullName()
Deprecated. Use getDisplayName() instead. Since v4.3.

Convenience method to access property.

Returns:
the full name.

getGroups

public List<String> getGroups()
Deprecated. Use GroupManager.getGroupNamesForUser(String) instead. Since v4.4.

List all Groups that User is a member of. Modifiying this Collection will not add or remove Groups.

Returns:
list of groups the user belongs to.

setPassword

public void setPassword(String password)
                 throws ImmutableException
Deprecated. Use CrowdService.updateUserCredential(com.atlassian.crowd.embedded.api.User, String) instead. Since v4.4.

Change the User's password.

Parameters:
password - new password.
Throws:
ImmutableException - should never be thrown as all users from this implementation are "mutable".

addToGroup

public boolean addToGroup(Group group)
Deprecated. Use CrowdService.addUserToGroup(com.atlassian.crowd.embedded.api.User, com.atlassian.crowd.embedded.api.Group) instead. Since v4.4.

Add this User as a member to supplied Group. Returns whether any modifications were made.

Parameters:
group - group to add membership.
Returns:
true if membership added successfully.

authenticate

public boolean authenticate(String password)
Deprecated. Use CrowdService.authenticate(String, String) instead. Since v4.4.

Verify that the supplied password matches the stored password for the user.

Parameters:
password - current password.
Returns:
true if the authentication was successful.

inGroup

public boolean inGroup(Group group)
Deprecated. Use GroupManager.isUserInGroup(com.atlassian.crowd.embedded.api.User, com.atlassian.crowd.embedded.api.Group) instead. Since v4.4.

Determine whether User is member of supplied Group.

Parameters:
group - group to check membership.
Returns:
true if the user is a member of the group.

inGroup

public boolean inGroup(String groupName)
Deprecated. Use GroupManager.isUserInGroup(String, String) instead. Since v4.4.

Determine whether User is member of supplied Group.

Parameters:
groupName - name of group to check membership.
Returns:
true if the user is a member of the group.

remove

public void remove()
            throws ImmutableException
Deprecated. Use CrowdService.removeUser(com.atlassian.crowd.embedded.api.User) instead. Since v4.4.

Remove User from CredentialsProvider (providing it is mutable). Note that this also removes all custom attributes (profile) of the user too by virtue of cascade on the Crowd Service.

Specified by:
remove in class Entity
Throws:
ImmutableException

removeFromGroup

public boolean removeFromGroup(Group group)
Deprecated. Use CrowdService.removeUserFromGroup(com.atlassian.crowd.embedded.api.User, com.atlassian.crowd.embedded.api.Group)} instead. Since v4.4.

Remove this User as a member from supplied Group. Returns whether any modifications were made.

Parameters:
group - group to remove membership.
Returns:
true if user successfully removed from group.

store

public void store()
           throws ImmutableException
Deprecated. Use CrowdService.updateUser(com.atlassian.crowd.embedded.api.User) for mutating users. Since v4.4.

Force update to underlying data-stores. This allows providers that do not update persistent data on the fly to store changes. If any of the providers are immutable and fields that cannot be updated have changed, ImmutableException shall be thrown.

Overrides:
store in class Entity
Throws:
ImmutableException

update

protected void update()
Deprecated. 
Persists the current user in the embedded Crowd back-end.


getDirectoryId

public long getDirectoryId()
Deprecated. 
Specified by:
getDirectoryId in interface com.atlassian.crowd.embedded.api.User

isActive

public boolean isActive()
Deprecated. 
Specified by:
isActive in interface com.atlassian.crowd.embedded.api.User

getEmailAddress

public String getEmailAddress()
Deprecated. 
Specified by:
getEmailAddress in interface com.atlassian.crowd.embedded.api.User

getDisplayName

public String getDisplayName()
Deprecated. 
Specified by:
getDisplayName in interface com.atlassian.crowd.embedded.api.User

equals

public boolean equals(Object o)
Deprecated. 
Description copied from class: Entity
Compare name.

Specified by:
equals in interface com.atlassian.crowd.embedded.api.User
Specified by:
equals in interface Principal
Overrides:
equals in class Entity

hashCode

public int hashCode()
Deprecated. 
Description copied from class: Entity
Hashcode of name.

Specified by:
hashCode in interface com.atlassian.crowd.embedded.api.User
Specified by:
hashCode in interface Principal
Overrides:
hashCode in class Entity

compareTo

public int compareTo(com.atlassian.crowd.embedded.api.User other)
Deprecated. 
Specified by:
compareTo in interface com.atlassian.crowd.embedded.api.User
Specified by:
compareTo in interface Comparable<com.atlassian.crowd.embedded.api.User>


Copyright © 2002-2011 Atlassian. All Rights Reserved.