org.sakaiproject.component.legacy.alias
Class BaseAliasService.BaseAliasEdit

java.lang.Object
  extended byorg.sakaiproject.component.legacy.alias.BaseAliasService.BaseAliasEdit
All Implemented Interfaces:
Alias, AliasEdit, Comparable, Edit, Entity, EventListener, SessionBindingListener
Enclosing class:
BaseAliasService

public class BaseAliasService.BaseAliasEdit
extends Object
implements AliasEdit, SessionBindingListener

BaseAlias is an implementation of the CHEF Alias object.

Author:
University of Michigan, CHEF Software Development Team

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_event
          The event code for this edit.
protected  String m_id
          The alias id.
protected  Time m_lastModifiedTime
          The time last modified.
protected  String m_lastModifiedUserId
          The last modified user id.
protected  ResourcePropertiesEdit m_properties
          The properties.
protected  String m_target
          The alias target.
 
Fields inherited from interface org.sakaiproject.service.legacy.entity.Entity
SEPARATOR
 
Constructor Summary
BaseAliasService.BaseAliasEdit(BaseAliasService.BaseAliasEdit alias)
          Construct from another Alias object.
BaseAliasService.BaseAliasEdit(Element el)
          Construct from information in XML.
BaseAliasService.BaseAliasEdit(String id)
          Construct.
BaseAliasService.BaseAliasEdit(String id, String target, String createdBy, Time createdOn, String modifiedBy, Time modifiedOn)
          ReConstruct.
 
Method Summary
protected  void activate()
          Enable editing.
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 getDescription()
           
protected  String getEvent()
          Access the event code for this edit.
 String getId()
          Access the alias id.
 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 getTarget()
          Access the alias target.
 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  void setAll(BaseAliasService.BaseAliasEdit alias)
          Take all values from this object.
protected  void setEvent(String event)
          Set the event code for this edit.
 void setTarget(String target)
          Set the alias target.
 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_id

protected String m_id
The alias id.


m_target

protected String m_target
The alias target.


m_properties

protected ResourcePropertiesEdit m_properties
The properties.


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.


m_event

protected String m_event
The event code for this edit.


m_active

protected boolean m_active
Active flag.

Constructor Detail

BaseAliasService.BaseAliasEdit

public BaseAliasService.BaseAliasEdit(String id)
Construct.

Parameters:
id - The id.

BaseAliasService.BaseAliasEdit

public BaseAliasService.BaseAliasEdit(String id,
                                      String target,
                                      String createdBy,
                                      Time createdOn,
                                      String modifiedBy,
                                      Time modifiedOn)
ReConstruct.

Parameters:
id - The id.
target - The target.
createdBy - The createdBy property.
createdOn - The createdOn property.
modifiedBy - The modified by property.
modifiedOn - The modified on property.

BaseAliasService.BaseAliasEdit

public BaseAliasService.BaseAliasEdit(BaseAliasService.BaseAliasEdit alias)
Construct from another Alias object.

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

BaseAliasService.BaseAliasEdit

public BaseAliasService.BaseAliasEdit(Element el)
Construct from information in XML.

Parameters:
el - The XML DOM Element definining the alias.
Method Detail

finalize

protected void finalize()
Clean up.


setAll

protected void setAll(BaseAliasService.BaseAliasEdit alias)
Take all values from this object.

Parameters:
alias - The alias 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 alias id.

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

getCreatedBy

public User getCreatedBy()

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

getModifiedBy

public User getModifiedBy()

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

getCreatedTime

public Time getCreatedTime()

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

getModifiedTime

public Time getModifiedTime()

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

getTarget

public String getTarget()
Access the alias target.

Specified by:
getTarget in interface Alias
Returns:
The alias target.

setTarget

public void setTarget(String target)
Set the alias target.

Specified by:
setTarget in interface AliasEdit
Parameters:
target - The alias target.

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.

equals

public boolean equals(Object obj)
Are these objects equal? If they are both Alias 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.

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.


getDescription

public String getDescription()
Specified by:
getDescription in interface Alias
Returns:
a description of the item this alias's target applies to.

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