org.sakaiproject.component.legacy.user
Class BaseUserDirectoryService.BaseUserEdit

java.lang.Object
  extended byorg.sakaiproject.component.legacy.user.BaseUserDirectoryService.BaseUserEdit
All Implemented Interfaces:
Comparable, Edit, Entity, EventListener, SessionBindingListener, User, UserEdit
Enclosing class:
BaseUserDirectoryService

public class BaseUserDirectoryService.BaseUserEdit
extends Object
implements UserEdit, SessionBindingListener

BaseUserEdit is an implementation of the CHEF UserEdit object.


Field Summary
protected  boolean m_active
          Active flag.
protected  Time m_createdTime
          The time created.
protected  String m_createdUserId
          The created user id.
protected  String m_email
          The user email address.
protected  String m_event
          The event code for this edit.
protected  String m_firstName
          The user first name.
protected  String m_id
          The user id.
protected  Time m_lastModifiedTime
          The time last modified.
protected  String m_lastModifiedUserId
          The last modified user id.
protected  String m_lastName
          The user last name.
protected  ResourcePropertiesEdit m_properties
          The properties.
protected  String m_pw
          The user password.
protected  String m_type
          The user type.
 
Fields inherited from interface org.sakaiproject.service.legacy.entity.Entity
SEPARATOR
 
Constructor Summary
BaseUserDirectoryService.BaseUserEdit(Element el)
          Construct from information in XML.
BaseUserDirectoryService.BaseUserEdit(String id)
          Construct.
BaseUserDirectoryService.BaseUserEdit(String id, String email, String firstName, String lastName, String type, String pw, String createdBy, Time createdOn, String modifiedBy, Time modifiedOn)
          ReConstruct.
BaseUserDirectoryService.BaseUserEdit(User user)
          Construct from another User object.
 
Method Summary
protected  void activate()
          Enable editing.
 boolean checkPassword(String pw)
          Check if this is the user's password.
protected  void closeEdit()
          Close the edit object - it cannot be used after this.
 int compareTo(Object obj)
          Compare this object with the specified object for order.
 boolean equals(Object obj)
          Are these objects equal?
protected  void finalize()
          Clean up.
 User getCreatedBy()
          
 Time getCreatedTime()
          
 String getDisplayName()
          Access the user's name for display purposes.
 String getEid()
          Access the user's enterprise id; the id they and the enterprise know as belonging to them.
 String getEmail()
          Access the email address.
protected  String getEvent()
          Access the event code for this edit.
 String getFirstName()
          Access the user's first name.
 String getId()
          Access the user id.
 String getLastName()
          Access the user's last name.
 User getModifiedBy()
          
 Time getModifiedTime()
          
 ResourceProperties getProperties()
          Access the resources's properties.
 ResourcePropertiesEdit getPropertiesEdit()
          Access the resource's properties for modification
 String getReference()
          Access the internal reference which can be used to access the resource from within the system.
 String getReference(String rootProperty)
          Access the alternate internal reference which can be used to access the entity from within the system.
 String getSortName()
          Access the user's name for sorting purposes.
 String getType()
          Access the user type.
 String getUrl()
          Access the URL which can be used to access the resource.
 String getUrl(String rootProperty)
          Access the alternate URL which can be used to access the entity.
 int hashCode()
          Make a hash code that reflects the equals() logic as well.
 boolean isActiveEdit()
          Check to see if the edit is still active, or has already been closed.
protected  boolean selectedBy(String criteria)
          Check this User object to see if it is selected by the criteria.
protected  void set(User user)
          Take all values from this object.
protected  void setAll(User user)
          Take all values from this object.
 void setEid(String eid)
          Set the user's enterprise id.
 void setEmail(String email)
          Set the email address.
protected  void setEvent(String event)
          Set the event code for this edit.
 void setFirstName(String name)
          Set the user's first name.
 void setId(String id)
          Set the user's id.
 void setLastName(String name)
          Set the user's last name.
 void setPassword(String pw)
          Set the user's password
 void setType(String type)
          Set the user type.
 Element toXml(Document doc, Stack stack)
          Serialize the resource into XML, adding an element to the doc under the top of the stack element.
 void valueBound(SessionBindingEvent event)
          SessionBindingListener implementation
 void valueUnbound(SessionBindingEvent event)
          Notifies the object that it is being unbound from a session.
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_event

protected String m_event
The event code for this edit.


m_active

protected boolean m_active
Active flag.


m_id

protected String m_id
The user id.


m_firstName

protected String m_firstName
The user first name.


m_lastName

protected String m_lastName
The user last name.


m_email

protected String m_email
The user email address.


m_pw

protected String m_pw
The user password.


m_properties

protected ResourcePropertiesEdit m_properties
The properties.


m_type

protected String m_type
The user type.


m_createdUserId

protected String m_createdUserId
The created user id.


m_lastModifiedUserId

protected String m_lastModifiedUserId
The last modified user id.


m_createdTime

protected Time m_createdTime
The time created.


m_lastModifiedTime

protected Time m_lastModifiedTime
The time last modified.

Constructor Detail

BaseUserDirectoryService.BaseUserEdit

public BaseUserDirectoryService.BaseUserEdit(String id)
Construct.

Parameters:
id - The user id.

BaseUserDirectoryService.BaseUserEdit

public BaseUserDirectoryService.BaseUserEdit(User user)
Construct from another User object.

Parameters:
user - The user object to use for values.

BaseUserDirectoryService.BaseUserEdit

public BaseUserDirectoryService.BaseUserEdit(Element el)
Construct from information in XML.

Parameters:
el - The XML DOM Element definining the user.

BaseUserDirectoryService.BaseUserEdit

public BaseUserDirectoryService.BaseUserEdit(String id,
                                             String email,
                                             String firstName,
                                             String lastName,
                                             String type,
                                             String pw,
                                             String createdBy,
                                             Time createdOn,
                                             String modifiedBy,
                                             Time modifiedOn)
ReConstruct.

Parameters:
id - The id.
email - The email.
firstName - The first name.
lastName - The last name.
type - The type.
pw - The password.
createdBy - The createdBy property.
createdOn - The createdOn property.
modifiedBy - The modified by property.
modifiedOn - The modified on property.
Method Detail

setAll

protected void setAll(User user)
Take all values from this object.

Parameters:
user - The user object to take values from.

toXml

public Element toXml(Document doc,
                     Stack stack)
Serialize the resource into XML, adding an element to the doc under the top of the stack element.

Specified by:
toXml in interface Entity
Parameters:
doc - The DOM doc to contain the XML (or null for a string return).
stack - The DOM elements, the top of which is the containing element of the new "resource" element.
Returns:
The newly added element.

getId

public String getId()
Access the user id.

Specified by:
getId in interface Entity
Returns:
The user id string.

getEid

public String getEid()
Description copied from interface: User
Access the user's enterprise id; the id they and the enterprise know as belonging to them.
The Enterprise id, like the User id, is unique among all defined users.
The EID may be used by the user to login, and will be used when communicating with the user directory provider.

Specified by:
getEid in interface User
Returns:
The user's enterprise id.

getUrl

public String getUrl()
Access the URL which can be used to access the resource.

Specified by:
getUrl in interface Entity
Returns:
The URL which can be used to access the resource.

getReference

public String getReference()
Access the internal reference which can be used to access the resource from within the system.

Specified by:
getReference in interface Entity
Returns:
The the internal reference which can be used to access the resource from within the system.

getReference

public String getReference(String rootProperty)
Description copied from interface: Entity
Access the alternate internal reference which can be used to access the entity from within the system.

Specified by:
getReference in interface Entity
Parameters:
rootProperty - The name of the entity property whose value controls which alternate reference is requested. If null, the native 'raw' reference is requested.
Returns:
The the alternate internal reference which can be used to access the entity from within the system.

getUrl

public String getUrl(String rootProperty)
Description copied from interface: Entity
Access the alternate URL which can be used to access the entity.

Specified by:
getUrl in interface Entity
Parameters:
rootProperty - The name of the entity property whose value controls which alternate reference URL is requested. If null, the native 'raw' URL is requested.
Returns:
The alternate URL which can be used to access the entity.

getProperties

public ResourceProperties getProperties()
Access the resources's properties.

Specified by:
getProperties in interface Entity
Returns:
The resources's properties.

getCreatedBy

public User getCreatedBy()

Specified by:
getCreatedBy in interface User
Returns:
the user who created this.

getModifiedBy

public User getModifiedBy()

Specified by:
getModifiedBy in interface User
Returns:
the user who last modified this.

getCreatedTime

public Time getCreatedTime()

Specified by:
getCreatedTime in interface User
Returns:
the time created.

getModifiedTime

public Time getModifiedTime()

Specified by:
getModifiedTime in interface User
Returns:
the time last modified.

getDisplayName

public String getDisplayName()
Access the user's name for display purposes.

Specified by:
getDisplayName in interface User
Returns:
The user's name for display purposes.

getFirstName

public String getFirstName()
Access the user's first name.

Specified by:
getFirstName in interface User
Returns:
The user's first name.

getLastName

public String getLastName()
Access the user's last name.

Specified by:
getLastName in interface User
Returns:
The user's last name.

getSortName

public String getSortName()
Access the user's name for sorting purposes.

Specified by:
getSortName in interface User
Returns:
The user's name for sorting purposes.

getEmail

public String getEmail()
Access the email address.

Specified by:
getEmail in interface User
Returns:
The email address string.

getType

public String getType()
Access the user type.

Specified by:
getType in interface User
Returns:
The user type.

checkPassword

public boolean checkPassword(String pw)
Check if this is the user's password.

Specified by:
checkPassword in interface User
Parameters:
pw - The clear text password to check.
Returns:
true if the password matches, false if not.

equals

public boolean equals(Object obj)
Are these objects equal? If they are both User objects, and they have matching id's, they are.

Returns:
true if they are equal, false if not.

hashCode

public int hashCode()
Make a hash code that reflects the equals() logic as well. We want two objects, even if different instances, if they have the same id to hash the same.


compareTo

public int compareTo(Object obj)
Compare this object with the specified object for order.

Specified by:
compareTo in interface Comparable
Returns:
A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

finalize

protected void finalize()
Clean up.


setId

public void setId(String id)
Set the user's id. Note: this is a special purpose routine that is used only to establish the id field, when the id is null, and cannot be used to change a user's id.

Specified by:
setId in interface UserEdit

setEid

public void setEid(String eid)
Description copied from interface: UserEdit
Set the user's enterprise id. Must be unique among all users.

Specified by:
setEid in interface UserEdit
Parameters:
eid - The new eid value.

setFirstName

public void setFirstName(String name)
Set the user's first name.

Specified by:
setFirstName in interface UserEdit
Parameters:
name - The user's first name.

setLastName

public void setLastName(String name)
Set the user's last name.

Specified by:
setLastName in interface UserEdit
Parameters:
name - The user's last name.

setEmail

public void setEmail(String email)
Set the email address.

Specified by:
setEmail in interface UserEdit
Parameters:
email - The email address string.

setPassword

public void setPassword(String pw)
Set the user's password

Specified by:
setPassword in interface UserEdit
Parameters:
pw - The user's new password.

setType

public void setType(String type)
Set the user type.

Specified by:
setType in interface UserEdit
Parameters:
type - The user type.

set

protected void set(User user)
Take all values from this object.

Parameters:
user - The user object to take values from.

getEvent

protected String getEvent()
Access the event code for this edit.

Returns:
The event code for this edit.

setEvent

protected void setEvent(String event)
Set the event code for this edit.

Parameters:
event - The event code for this edit.

getPropertiesEdit

public ResourcePropertiesEdit getPropertiesEdit()
Access the resource's properties for modification

Specified by:
getPropertiesEdit in interface Edit
Returns:
The resource's properties.

activate

protected void activate()
Enable editing.


isActiveEdit

public boolean isActiveEdit()
Check to see if the edit is still active, or has already been closed.

Specified by:
isActiveEdit in interface Edit
Returns:
true if the edit is active, false if it's been closed.

closeEdit

protected void closeEdit()
Close the edit object - it cannot be used after this.


selectedBy

protected boolean selectedBy(String criteria)
Check this User object to see if it is selected by the criteria.

Parameters:
criteria - The critera.
Returns:
True if the User object is selected by the criteria, false if not.

valueBound

public void valueBound(SessionBindingEvent event)
SessionBindingListener implementation

Specified by:
valueBound in interface SessionBindingListener
Parameters:
event - the event that identifies the session

valueUnbound

public void valueUnbound(SessionBindingEvent event)
Description copied from interface: SessionBindingListener
Notifies the object that it is being unbound from a session.

Specified by:
valueUnbound in interface SessionBindingListener
Parameters:
event - the event that identifies the session