com.atlassian.crowd.integration.model.user
Class UserTemplate

java.lang.Object
  extended by com.atlassian.crowd.integration.model.user.UserTemplate
All Implemented Interfaces:
DirectoryEntity, User
Direct Known Subclasses:
UserTemplateWithAttributes

public class UserTemplate
extends java.lang.Object
implements User

A publicly mutable User implementation.

Used to create or update a user.


Constructor Summary
UserTemplate(java.lang.String name)
           
UserTemplate(java.lang.String username, java.lang.Long directoryId)
          Build a template for a new user.
UserTemplate(User user)
          Build a template from an existing user.
 
Method Summary
 boolean equals(java.lang.Object o)
          Implementations must ensure equality based on getDirectoryId() and case-insensitive getName().
 java.lang.Long getDirectoryId()
           
 java.lang.String getDisplayName()
           
 java.lang.String getEmailAddress()
           
 java.lang.String getFirstName()
           
 java.lang.String getIconLocation()
           
 java.lang.String getLastName()
           
 java.lang.String getName()
           
 int hashCode()
          Implementations must produce a hashcode based on getDirectoryId() and case-insensitive getName().
 boolean isActive()
           
 void setActive(boolean active)
           
 void setDirectoryId(java.lang.Long directoryId)
           
 void setDisplayName(java.lang.String displayName)
           
 void setEmailAddress(java.lang.String emailAddress)
           
 void setFirstName(java.lang.String firstName)
           
 void setIconLocation(java.lang.String iconLocation)
           
 void setLastName(java.lang.String lastName)
           
 void setName(java.lang.String name)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UserTemplate

public UserTemplate(java.lang.String username,
                    java.lang.Long directoryId)
Build a template for a new user.

Used to create a user.

Parameters:
username - username of new user.
directoryId - ID of the directory in which to store the new user.

UserTemplate

public UserTemplate(java.lang.String name)

UserTemplate

public UserTemplate(User user)
Build a template from an existing user.

Used to update a user.

Parameters:
user - user to build template from.
Method Detail

setDirectoryId

public void setDirectoryId(java.lang.Long directoryId)

setName

public void setName(java.lang.String name)

getDirectoryId

public java.lang.Long getDirectoryId()
Specified by:
getDirectoryId in interface DirectoryEntity
Returns:
id of the directory in which the DirectoryEntity is stored.

isActive

public boolean isActive()
Specified by:
isActive in interface User
Returns:
true if and only if the user is allowed to authenticate.

setActive

public void setActive(boolean active)

getName

public java.lang.String getName()
Specified by:
getName in interface DirectoryEntity
Returns:
name of the entity.

getEmailAddress

public java.lang.String getEmailAddress()
Specified by:
getEmailAddress in interface User
Returns:
primary email address of the principal.

setEmailAddress

public void setEmailAddress(java.lang.String emailAddress)

getFirstName

public java.lang.String getFirstName()
Specified by:
getFirstName in interface User
Returns:
first name of the principal.

setFirstName

public void setFirstName(java.lang.String firstName)

getLastName

public java.lang.String getLastName()
Specified by:
getLastName in interface User
Returns:
last name of the principal.

setLastName

public void setLastName(java.lang.String lastName)

getDisplayName

public java.lang.String getDisplayName()
Specified by:
getDisplayName in interface User
Returns:
display name (eg. full name) of the principal.

setDisplayName

public void setDisplayName(java.lang.String displayName)

getIconLocation

public java.lang.String getIconLocation()
Specified by:
getIconLocation in interface User
Returns:
icon location URL.

setIconLocation

public void setIconLocation(java.lang.String iconLocation)

equals

public boolean equals(java.lang.Object o)
Description copied from interface: DirectoryEntity
Implementations must ensure equality based on getDirectoryId() and case-insensitive getName().

Specified by:
equals in interface DirectoryEntity
Overrides:
equals in class java.lang.Object
Parameters:
o - object to compare to.
Returns:
true if and only if the directoryId and name.toLowerCase() of the directory entities match.

hashCode

public int hashCode()
Description copied from interface: DirectoryEntity
Implementations must produce a hashcode based on getDirectoryId() and case-insensitive getName().

Specified by:
hashCode in interface DirectoryEntity
Overrides:
hashCode in class java.lang.Object
Returns:
hashcode.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.