ca.sqlpower.wabit.enterprise.client
Class Group

java.lang.Object
  extended by ca.sqlpower.wabit.AbstractWabitObject
      extended by ca.sqlpower.wabit.enterprise.client.Group
All Implemented Interfaces:
WabitObject, java.io.Serializable, java.lang.Comparable, org.springframework.security.GrantedAuthority

public class Group
extends AbstractWabitObject
implements org.springframework.security.GrantedAuthority

See Also:
Serialized Form

Constructor Summary
Group(java.lang.String name)
           
 
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)
           
 void addMember(GroupMember member)
           
 void addMember(GroupMember member, 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.
 int compareTo(java.lang.Object o)
           
 java.lang.String getAuthority()
           
 java.util.List<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.util.List<Grant> getGrants()
          Mutable list!! beware.
 java.util.List<GroupMember> getMembers()
           
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)
           
 boolean removeMember(GroupMember member)
           
 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

Group

public Group(java.lang.String name)
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<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

getGrants

public java.util.List<Grant> getGrants()
Mutable list!! beware.

Returns:

getMembers

public java.util.List<GroupMember> getMembers()

addGrant

public void addGrant(Grant grant)

addGrant

public void addGrant(Grant grant,
                     int index)

removeGrant

public boolean removeGrant(Grant grant)

addMember

public void addMember(GroupMember member,
                      int index)

addMember

public void addMember(GroupMember member)

removeMember

public boolean removeMember(GroupMember member)

getAuthority

public java.lang.String getAuthority()
Specified by:
getAuthority in interface org.springframework.security.GrantedAuthority

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable

toString

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

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.


Copyright © 2009. All Rights Reserved.