ca.sqlpower.wabit.enterprise.client
Class User

java.lang.Object
  extended by ca.sqlpower.wabit.AbstractWabitObject
      extended by ca.sqlpower.wabit.enterprise.client.User
All Implemented Interfaces:
WabitObject, java.io.Serializable, org.springframework.security.userdetails.UserDetails

public class User
extends AbstractWabitObject
implements org.springframework.security.userdetails.UserDetails

See Also:
Serialized Form

Constructor Summary
User(java.lang.String username, java.lang.String password)
           
 
Method Summary
protected  void addChildImpl(WabitObject child, int index)
          This is the object specific implementation of #addChild(WabitObject).
 void addGrant(Grant grant)
           
 void addGrant(Grant grant, int index)
           
 boolean allowsChildren()
          Returns true if this object may contain children.
 int childPositionOffset(java.lang.Class<? extends WabitObject> childType)
          Returns the position in the list that would be returned by getChildren() that the first object of type childClass is, or where it would be if there were any children of that type.
 org.springframework.security.GrantedAuthority[] getAuthorities()
           
 java.util.List<? extends WabitObject> getChildren()
          Returns an unmodifiable list of the children in this WabitObject.
 java.util.List<WabitObject> getDependencies()
          Returns a list of all WabitObjects that this Wabit object is dependent on.
 java.lang.String getEmail()
           
 java.lang.String getFullName()
           
 java.util.List<Grant> getGrants()
          The returned list is mutable.
 java.lang.String getPassword()
           
 java.lang.String getUsername()
           
 boolean isAccountNonExpired()
           
 boolean isAccountNonLocked()
           
 boolean isCredentialsNonExpired()
           
 boolean isEnabled()
           
protected  boolean removeChildImpl(WabitObject child)
          This is the object specific implementation of removeChild.
 void removeDependency(WabitObject dependency)
          Removes the given object as a dependency of this object.
 boolean removeGrant(Grant grant)
           
 void setAuthorities(org.springframework.security.GrantedAuthority[] authorities)
           
 void setEmail(java.lang.String email)
           
 void setFullName(java.lang.String fullName)
           
 void setPassword(java.lang.String password)
           
 java.lang.String toString()
           
 
Methods inherited from class ca.sqlpower.wabit.AbstractWabitObject
addChild, addWabitListener, begin, beginTransaction, cleanup, commit, commitTransaction, equals, fireChildAdded, fireChildRemoved, firePropertyChange, firePropertyChange, firePropertyChange, fireTransactionEnded, fireTransactionRollback, fireTransactionStarted, generateNewUUID, getChildren, getName, getParent, getSession, getUUID, isForegroundThread, removeChild, removeWabitListener, rollback, rollbackTransaction, runInBackground, runInForeground, setName, setParent, setUUID
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

User

public User(java.lang.String username,
            java.lang.String password)
Method Detail

removeChildImpl

protected boolean removeChildImpl(WabitObject child)
Description copied from class: AbstractWabitObject
This is the object specific implementation of removeChild. There are checks in the removeChild method to ensure the child being removed has no dependencies and is a child of this object.

Specified by:
removeChildImpl in class AbstractWabitObject
See Also:
AbstractWabitObject.removeChild(WabitObject)

allowsChildren

public boolean allowsChildren()
Description copied from interface: WabitObject
Returns true if this object may contain children. Not all types of WabitObjects can be a child to any WabitObject.

Specified by:
allowsChildren in interface WabitObject
See Also:
WabitObject.childPositionOffset(Class)

childPositionOffset

public int childPositionOffset(java.lang.Class<? extends WabitObject> childType)
Description copied from interface: WabitObject
Returns the position in the list that would be returned by getChildren() that the first object of type childClass is, or where it would be if there were any children of that type.

Specified by:
childPositionOffset in interface WabitObject

getChildren

public java.util.List<? extends WabitObject> getChildren()
Description copied from interface: WabitObject
Returns an unmodifiable list of the children in this WabitObject. If there are no children in this WabitObject an empty list should be returned.

Specified by:
getChildren in interface WabitObject

getDependencies

public java.util.List<WabitObject> getDependencies()
Description copied from interface: WabitObject
Returns a list of all WabitObjects that this Wabit object is dependent on. Children of a WabitObject are not dependencies and will not be returned in this list. If there are no objects this Wabit object is dependent on an empty list should be returned. These are only the immediate dependencies of this object. If you want to find the dependencies of this object's dependencies as well it may be useful to look at WorkspaceGraphModel to make a full graph of all of the dependencies.

Specified by:
getDependencies in interface WabitObject

removeDependency

public void removeDependency(WabitObject dependency)
Description copied from interface: WabitObject
Removes the given object as a dependency of this object. For this object to no longer be dependent on the given dependency all of its children must also not be dependent on the given dependency when this method returns. This may remove this object from its parent if necessary.

Specified by:
removeDependency in interface WabitObject

getPassword

public java.lang.String getPassword()
Specified by:
getPassword in interface org.springframework.security.userdetails.UserDetails

setPassword

public void setPassword(java.lang.String password)

addGrant

public void addGrant(Grant grant)

addGrant

public void addGrant(Grant grant,
                     int index)

removeGrant

public boolean removeGrant(Grant grant)

addChildImpl

protected void addChildImpl(WabitObject child,
                            int index)
Description copied from class: AbstractWabitObject
This is the object specific implementation of #addChild(WabitObject). There are checks in the #addChild(WabitObject) method to ensure that the object given here is a valid child type of this object.

This method should be overwritten if children are allowed.

Overrides:
addChildImpl in class AbstractWabitObject
Parameters:
child - The child to add to this object.
index - The index to add the child at.

getFullName

public java.lang.String getFullName()

setFullName

public void setFullName(java.lang.String fullName)

getEmail

public java.lang.String getEmail()

setEmail

public void setEmail(java.lang.String email)

getGrants

public java.util.List<Grant> getGrants()
The returned list is mutable. Beware.


getAuthorities

public org.springframework.security.GrantedAuthority[] getAuthorities()
Specified by:
getAuthorities in interface org.springframework.security.userdetails.UserDetails

setAuthorities

public void setAuthorities(org.springframework.security.GrantedAuthority[] authorities)

getUsername

public java.lang.String getUsername()
Specified by:
getUsername in interface org.springframework.security.userdetails.UserDetails

isAccountNonExpired

public boolean isAccountNonExpired()
Specified by:
isAccountNonExpired in interface org.springframework.security.userdetails.UserDetails

isAccountNonLocked

public boolean isAccountNonLocked()
Specified by:
isAccountNonLocked in interface org.springframework.security.userdetails.UserDetails

isCredentialsNonExpired

public boolean isCredentialsNonExpired()
Specified by:
isCredentialsNonExpired in interface org.springframework.security.userdetails.UserDetails

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface org.springframework.security.userdetails.UserDetails

toString

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


Copyright © 2009. All Rights Reserved.