org.jasig.portal.groups
Class RDBMEntityGroupStore

java.lang.Object
  extended by org.jasig.portal.groups.RDBMEntityGroupStore
All Implemented Interfaces:
IEntityGroupStore, IGroupConstants

public class RDBMEntityGroupStore
extends Object
implements IEntityGroupStore, IGroupConstants

Store for EntityGroupImpl.

Version:
$Revision: 21106 $
Author:
Dan Ellentuck

Field Summary
 
Fields inherited from interface org.jasig.portal.groups.IGroupConstants
CHANNEL_CATEGORIES, CONTAINS, ENDS_WITH, EVERYONE, IS, NODE_SEPARATOR, PORTAL_ADMINISTRATORS, STARTS_WITH
 
Constructor Summary
RDBMEntityGroupStore()
          RDBMEntityGroupStore constructor.
 
Method Summary
protected static void commit(Connection conn)
           
 boolean contains(IEntityGroup group, IGroupMember member)
          Answers if IGroupMember member is a member of group.
 boolean containsGroupNamed(IEntityGroup containingGroup, String memberName)
           
 void delete(IEntityGroup group)
          If this entity exists, delete it.
 IEntityGroup find(String groupID)
          Find and return an instance of the group.
 Iterator findContainingGroups(IEntity ent)
          Find the groups that this entity belongs to.
 Iterator findContainingGroups(IEntityGroup group)
          Find the groups that this group belongs to.
 Iterator findContainingGroups(IGroupMember gm)
          Find the groups that this group member belongs to.
 Iterator findEntitiesForGroup(IEntityGroup group)
          Find the IEntities that are members of the IEntityGroup.
 Iterator findGroupsByCreator(String creatorID)
          Find the groups with this creatorID.
 ILockableEntityGroup findLockable(String groupID)
          Find and return an instance of the group.
 String[] findMemberGroupKeys(IEntityGroup group)
          Find the keys of groups that are members of group.
 Iterator findMemberGroups(IEntityGroup group)
          Find the IUserGroups that are members of the group.
protected static void logNoTransactionWarning()
           
 IEntity newEntity(Class type, String key)
           
 IEntityGroup newInstance(Class type)
           
protected static void rollback(Connection conn)
           
 EntityIdentifier[] searchForGroups(String query, int method, Class leaftype)
          Find EntityIdentifiers for groups whose name matches the query string according to the specified method and matches the provided leaf type
protected static void setAutoCommit(Connection conn, boolean newValue)
           
static RDBMEntityGroupStore singleton()
           
 void update(IEntityGroup group)
          Commit this entity AND ITS MEMBERSHIPS to the underlying store.
 void updateMembers(IEntityGroup eg)
          Insert and delete group membership rows inside a transaction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RDBMEntityGroupStore

public RDBMEntityGroupStore()
RDBMEntityGroupStore constructor.

Method Detail

commit

protected static void commit(Connection conn)
                      throws SQLException
Parameters:
conn - java.sql.Connection
Throws:
SQLException

contains

public boolean contains(IEntityGroup group,
                        IGroupMember member)
                 throws GroupsException
Answers if IGroupMember member is a member of group.

Specified by:
contains in interface IEntityGroupStore
Parameters:
group - org.jasig.portal.groups.IEntityGroup
member - org.jasig.portal.groups.IGroupMember
Returns:
boolean
Throws:
GroupsException

containsGroupNamed

public boolean containsGroupNamed(IEntityGroup containingGroup,
                                  String memberName)
                           throws GroupsException
Throws:
GroupsException

delete

public void delete(IEntityGroup group)
            throws GroupsException
If this entity exists, delete it.

Specified by:
delete in interface IEntityGroupStore
Parameters:
group - org.jasig.portal.groups.IEntityGroup
Throws:
GroupsException

find

public IEntityGroup find(String groupID)
                  throws GroupsException
Find and return an instance of the group.

Specified by:
find in interface IEntityGroupStore
Parameters:
groupID - the group ID
Returns:
org.jasig.portal.groups.IEntityGroup
Throws:
GroupsException

findContainingGroups

public Iterator findContainingGroups(IEntity ent)
                              throws GroupsException
Find the groups that this entity belongs to.

Parameters:
ent - the entity in question
Returns:
java.util.Iterator
Throws:
GroupsException

findContainingGroups

public Iterator findContainingGroups(IEntityGroup group)
                              throws GroupsException
Find the groups that this group belongs to.

Parameters:
group - org.jasig.portal.groups.IEntityGroup
Returns:
java.util.Iterator
Throws:
GroupsException

findContainingGroups

public Iterator findContainingGroups(IGroupMember gm)
                              throws GroupsException
Find the groups that this group member belongs to.

Specified by:
findContainingGroups in interface IEntityGroupStore
Parameters:
gm - the group member in question
Returns:
java.util.Iterator
Throws:
GroupsException

findEntitiesForGroup

public Iterator findEntitiesForGroup(IEntityGroup group)
                              throws GroupsException
Find the IEntities that are members of the IEntityGroup.

Specified by:
findEntitiesForGroup in interface IEntityGroupStore
Parameters:
group - the entity group in question
Returns:
java.util.Iterator
Throws:
GroupsException

findGroupsByCreator

public Iterator findGroupsByCreator(String creatorID)
                             throws GroupsException
Find the groups with this creatorID.

Parameters:
creatorID -
Returns:
java.util.Iterator
Throws:
GroupsException

findLockable

public ILockableEntityGroup findLockable(String groupID)
                                  throws GroupsException
Find and return an instance of the group.

Specified by:
findLockable in interface IEntityGroupStore
Parameters:
groupID - the group ID
Returns:
org.jasig.portal.groups.ILockableEntityGroup
Throws:
GroupsException

findMemberGroupKeys

public String[] findMemberGroupKeys(IEntityGroup group)
                             throws GroupsException
Find the keys of groups that are members of group.

Specified by:
findMemberGroupKeys in interface IEntityGroupStore
Parameters:
group - the org.jasig.portal.groups.IEntityGroup
Returns:
String[]
Throws:
GroupsException

findMemberGroups

public Iterator findMemberGroups(IEntityGroup group)
                          throws GroupsException
Find the IUserGroups that are members of the group.

Specified by:
findMemberGroups in interface IEntityGroupStore
Parameters:
group - org.jasig.portal.groups.IEntityGroup
Returns:
java.util.Iterator
Throws:
GroupsException

logNoTransactionWarning

protected static void logNoTransactionWarning()

newEntity

public IEntity newEntity(Class type,
                         String key)
                  throws GroupsException
Returns:
org.jasig.portal.groups.IEntity
Throws:
GroupsException

newInstance

public IEntityGroup newInstance(Class type)
                         throws GroupsException
Specified by:
newInstance in interface IEntityGroupStore
Returns:
org.jasig.portal.groups.IEntityGroup
Throws:
GroupsException

rollback

protected static void rollback(Connection conn)
                        throws SQLException
Parameters:
conn - java.sql.Connection
Throws:
SQLException

searchForGroups

public EntityIdentifier[] searchForGroups(String query,
                                          int method,
                                          Class leaftype)
                                   throws GroupsException
Description copied from interface: IEntityGroupStore
Find EntityIdentifiers for groups whose name matches the query string according to the specified method and matches the provided leaf type

Specified by:
searchForGroups in interface IEntityGroupStore
Throws:
GroupsException

setAutoCommit

protected static void setAutoCommit(Connection conn,
                                    boolean newValue)
                             throws SQLException
Parameters:
conn - java.sql.Connection
newValue - boolean
Throws:
SQLException - The exception description.

singleton

public static RDBMEntityGroupStore singleton()
                                      throws GroupsException
Returns:
org.jasig.portal.groups.RDBMEntityGroupStore
Throws:
GroupsException

update

public void update(IEntityGroup group)
            throws GroupsException
Commit this entity AND ITS MEMBERSHIPS to the underlying store.

Specified by:
update in interface IEntityGroupStore
Parameters:
group - org.jasig.portal.groups.IEntityGroup
Throws:
GroupsException

updateMembers

public void updateMembers(IEntityGroup eg)
                   throws GroupsException
Insert and delete group membership rows inside a transaction.

Specified by:
updateMembers in interface IEntityGroupStore
Parameters:
eg - org.jasig.portal.groups.IEntityGroup
Throws:
GroupsException


Copyright © 2010 Jasig. All Rights Reserved.