|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jasig.portal.groups.RDBMEntityGroupStore
public class RDBMEntityGroupStore
Store for EntityGroupImpl
.
Field Summary | |
---|---|
private static java.lang.String |
allGroupColumns
|
private static java.lang.String |
allGroupColumnsWithTableAlias
|
private static java.lang.String |
allMemberColumns
|
private static java.lang.String |
countAMemberEntitySql
|
private static java.lang.String |
countAMemberGroupSql
|
private static java.lang.String |
countMemberGroupsNamedSql
|
private static java.lang.String |
deleteMemberEntitySql
|
private static java.lang.String |
deleteMemberGroupSql
|
private static java.lang.String |
deleteMembersInGroupSql
|
private static java.lang.String |
EQ
|
private static java.lang.String |
EQUALS_PARAM
|
private static java.lang.String |
findContainingGroupsForEntitySql
|
private static java.lang.String |
findContainingGroupsForGroupSql
|
private static java.lang.String |
findGroupsByCreatorSql
|
private static java.lang.String |
findGroupSql
|
private static java.lang.String |
findMemberGroupKeysSql
|
private static java.lang.String |
findMemberGroupSql
|
private static java.lang.String |
findMemberGroupsSql
|
private static java.lang.String |
GROUP_CREATOR_COLUMN
|
private static java.lang.String |
GROUP_DESCRIPTION_COLUMN
|
private static java.lang.String |
GROUP_ID_COLUMN
|
private static java.lang.String |
GROUP_NAME_COLUMN
|
private static java.lang.String |
GROUP_NODE_SEPARATOR
|
private static java.lang.String |
GROUP_TABLE
|
private static java.lang.String |
GROUP_TABLE_ALIAS
|
private static java.lang.String |
GROUP_TABLE_WITH_ALIAS
|
private static java.lang.String |
GROUP_TYPE_COLUMN
|
private IGroupService |
groupService
|
private static java.lang.String |
insertGroupSql
|
private static java.lang.String |
insertMemberSql
|
private static org.apache.commons.logging.Log |
log
|
private static java.lang.String |
MEMBER_GROUP_ID_COLUMN
|
private static java.lang.String |
MEMBER_IS_ENTITY
|
private static java.lang.String |
MEMBER_IS_GROUP
|
private static java.lang.String |
MEMBER_IS_GROUP_COLUMN
|
private static java.lang.String |
MEMBER_MEMBER_KEY_COLUMN
|
private static java.lang.String |
MEMBER_MEMBER_SERVICE_COLUMN
|
private static java.lang.String |
MEMBER_TABLE
|
private static java.lang.String |
MEMBER_TABLE_ALIAS
|
private static java.lang.String |
MEMBER_TABLE_WITH_ALIAS
|
private static java.lang.String |
QUOTE
|
private static java.lang.String |
searchGroups
|
private static java.lang.String |
searchGroupsPartial
|
private static RDBMEntityGroupStore |
singleton
|
private static java.lang.String |
updateGroupSql
|
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(java.sql.Connection conn)
|
boolean |
contains(IEntityGroup group,
IGroupMember member)
Answers if IGroupMember member is a member of group . |
private boolean |
containsEntity(IEntityGroup group,
IGroupMember member)
|
private boolean |
containsGroup(IEntityGroup group,
IEntityGroup member)
|
boolean |
containsGroupNamed(IEntityGroup containingGroup,
java.lang.String memberName)
|
void |
delete(IEntityGroup group)
If this entity exists, delete it. |
private boolean |
existsInDatabase(IEntityGroup group)
Answer if the IEntityGroup entity exists in the database. |
IEntityGroup |
find(java.lang.String groupID)
Find and return an instance of the group. |
java.util.Iterator |
findContainingGroups(IEntity ent)
Find the groups that this entity belongs to. |
java.util.Iterator |
findContainingGroups(IEntityGroup group)
Find the groups that this group belongs to. |
java.util.Iterator |
findContainingGroups(IGroupMember gm)
Find the groups that this group member belongs to. |
private java.util.Iterator |
findContainingGroupsForEntity(java.lang.String memberKey,
int type)
Find the groups associated with this member key. |
private java.util.Iterator |
findContainingGroupsForGroup(java.lang.String serviceName,
java.lang.String memberKey,
int type)
Find the groups associated with this member key. |
java.util.Iterator |
findEntitiesForGroup(IEntityGroup group)
Find the IEntities that are members of the IEntityGroup . |
java.util.Iterator |
findGroupsByCreator(java.lang.String creatorID)
Find the groups with this creatorID. |
ILockableEntityGroup |
findLockable(java.lang.String groupID)
Find and return an instance of the group. |
java.lang.String[] |
findMemberGroupKeys(IEntityGroup group)
Find the keys of groups that are members of group. |
java.util.Iterator |
findMemberGroups(IEntityGroup group)
Find the IUserGroups that are members of the group. |
private static java.lang.String |
getAllGroupColumns()
|
private static java.lang.String |
getAllGroupColumnsWithTableAlias()
|
private static java.lang.String |
getAllMemberColumns()
|
private static java.lang.String |
getCountAMemberEntitySql()
|
private static java.lang.String |
getCountAMemberGroupSql()
|
private static java.lang.String |
getCountMemberGroupsNamedSql()
|
private static java.lang.String |
getDeleteGroupSql(IEntityGroup group)
|
private static java.lang.String |
getDeleteMemberEntitySql()
|
private static java.lang.String |
getDeleteMemberGroupSql()
|
private static java.lang.String |
getDeleteMembersInGroupSql()
|
private static java.lang.String |
getDeleteMembersInGroupSql(IEntityGroup group)
|
private static java.lang.String |
getFindContainingGroupsForEntitySql()
|
private static java.lang.String |
getFindContainingGroupsForGroupSql()
|
private static java.lang.String |
getFindGroupsByCreatorSql()
|
private static java.lang.String |
getFindGroupSql()
|
private static java.lang.String |
getFindMemberGroupKeysSql()
|
private static java.lang.String |
getFindMemberGroupsSql()
|
IGroupService |
getGroupService()
|
private static java.lang.String |
getInsertGroupSql()
|
private static java.lang.String |
getInsertMemberSql()
|
private java.lang.String |
getNextKey()
|
private static java.lang.String |
getUpdateGroupSql()
|
private static java.lang.String |
groupAlias(java.lang.String column)
|
private void |
initialize()
Get the node separator character from the GroupServiceConfiguration. |
private IEntityGroup |
instanceFromResultSet(java.sql.ResultSet rs)
Find and return an instance of the group. |
private ILockableEntityGroup |
lockableInstanceFromResultSet(java.sql.ResultSet rs)
Find and return an instance of the group. |
protected static void |
logNoTransactionWarning()
|
private static java.lang.String |
memberAlias(java.lang.String column)
|
IEntity |
newEntity(java.lang.Class type,
java.lang.String key)
|
IEntityGroup |
newInstance(java.lang.Class type)
|
private IEntityGroup |
newInstance(java.lang.String newKey,
java.lang.Class newType,
java.lang.String newCreatorID,
java.lang.String newName,
java.lang.String newDescription)
|
private ILockableEntityGroup |
newLockableInstance(java.lang.String newKey,
java.lang.Class newType,
java.lang.String newCreatorID,
java.lang.String newName,
java.lang.String newDescription)
|
private void |
primAdd(IEntityGroup group,
java.sql.Connection conn)
Insert the entity into the database. |
private void |
primDelete(IEntityGroup group)
Delete this entity from the database after first deleting its memberships. |
private IEntityGroup |
primFind(java.lang.String groupID,
boolean lockable)
Find and return an instance of the group. |
private void |
primUpdate(IEntityGroup group,
java.sql.Connection conn)
Update the entity in the database. |
private void |
primUpdateMembers(EntityGroupImpl egi,
java.sql.Connection conn)
Insert and delete group membership rows. |
protected static void |
rollback(java.sql.Connection conn)
|
EntityIdentifier[] |
searchForGroups(java.lang.String query,
int method,
java.lang.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(java.sql.Connection conn,
boolean newValue)
|
void |
setGroupService(IGroupService newGroupService)
|
static RDBMEntityGroupStore |
singleton()
|
private static java.lang.String |
sqlQuote(java.lang.Object o)
|
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 |
Field Detail |
---|
private static final org.apache.commons.logging.Log log
private static RDBMEntityGroupStore singleton
private static java.lang.String EQ
private static java.lang.String QUOTE
private static java.lang.String EQUALS_PARAM
private static java.lang.String GROUP_TABLE
private static java.lang.String GROUP_TABLE_ALIAS
private static java.lang.String GROUP_TABLE_WITH_ALIAS
private static java.lang.String GROUP_ID_COLUMN
private static java.lang.String GROUP_CREATOR_COLUMN
private static java.lang.String GROUP_TYPE_COLUMN
private static java.lang.String GROUP_NAME_COLUMN
private static java.lang.String GROUP_DESCRIPTION_COLUMN
private static java.lang.String allGroupColumns
private static java.lang.String allGroupColumnsWithTableAlias
private static java.lang.String countAMemberGroupSql
private static java.lang.String countMemberGroupsNamedSql
private static java.lang.String countAMemberEntitySql
private static java.lang.String findContainingGroupsForEntitySql
private static java.lang.String findContainingGroupsForGroupSql
private static java.lang.String findGroupSql
private static java.lang.String findGroupsByCreatorSql
private static java.lang.String findMemberGroupKeysSql
private static java.lang.String findMemberGroupSql
private static java.lang.String findMemberGroupsSql
private static java.lang.String insertGroupSql
private static java.lang.String updateGroupSql
private static java.lang.String MEMBER_TABLE
private static java.lang.String MEMBER_TABLE_ALIAS
private static java.lang.String MEMBER_TABLE_WITH_ALIAS
private static java.lang.String MEMBER_GROUP_ID_COLUMN
private static java.lang.String MEMBER_MEMBER_SERVICE_COLUMN
private static java.lang.String MEMBER_MEMBER_KEY_COLUMN
private static java.lang.String MEMBER_IS_GROUP_COLUMN
private static java.lang.String MEMBER_IS_ENTITY
private static java.lang.String MEMBER_IS_GROUP
private static java.lang.String GROUP_NODE_SEPARATOR
private static java.lang.String allMemberColumns
private static java.lang.String deleteMembersInGroupSql
private static java.lang.String deleteMemberGroupSql
private static java.lang.String deleteMemberEntitySql
private static java.lang.String insertMemberSql
private static java.lang.String searchGroupsPartial
private static java.lang.String searchGroups
private IGroupService groupService
Constructor Detail |
---|
public RDBMEntityGroupStore()
Method Detail |
---|
private void initialize()
protected static void commit(java.sql.Connection conn) throws java.sql.SQLException
conn
- java.sql.Connection
java.sql.SQLException
public boolean contains(IEntityGroup group, IGroupMember member) throws GroupsException
IGroupMember
member is a member of group
.
contains
in interface IEntityGroupStore
group
- org.jasig.portal.groups.IEntityGroupmember
- org.jasig.portal.groups.IGroupMember
GroupsException
private boolean containsEntity(IEntityGroup group, IGroupMember member) throws GroupsException
GroupsException
private boolean containsGroup(IEntityGroup group, IEntityGroup member) throws GroupsException
GroupsException
public boolean containsGroupNamed(IEntityGroup containingGroup, java.lang.String memberName) throws GroupsException
GroupsException
public void delete(IEntityGroup group) throws GroupsException
delete
in interface IEntityGroupStore
group
- org.jasig.portal.groups.IEntityGroup
GroupsException
private boolean existsInDatabase(IEntityGroup group) throws GroupsException
group
- IEntityGroup
GroupsException
public IEntityGroup find(java.lang.String groupID) throws GroupsException
find
in interface IEntityGroupStore
groupID
- the group ID
GroupsException
public java.util.Iterator findContainingGroups(IEntity ent) throws GroupsException
ent
- the entity in question
GroupsException
public java.util.Iterator findContainingGroups(IEntityGroup group) throws GroupsException
group
- org.jasig.portal.groups.IEntityGroup
GroupsException
public java.util.Iterator findContainingGroups(IGroupMember gm) throws GroupsException
findContainingGroups
in interface IEntityGroupStore
gm
- the group member in question
GroupsException
private java.util.Iterator findContainingGroupsForEntity(java.lang.String memberKey, int type) throws GroupsException
memberKey
- type
-
GroupsException
private java.util.Iterator findContainingGroupsForGroup(java.lang.String serviceName, java.lang.String memberKey, int type) throws GroupsException
serviceName
- memberKey
- type
-
GroupsException
public java.util.Iterator findEntitiesForGroup(IEntityGroup group) throws GroupsException
IEntities
that are members of the IEntityGroup
.
findEntitiesForGroup
in interface IEntityGroupStore
group
- the entity group in question
GroupsException
public java.util.Iterator findGroupsByCreator(java.lang.String creatorID) throws GroupsException
creatorID
-
GroupsException
public ILockableEntityGroup findLockable(java.lang.String groupID) throws GroupsException
findLockable
in interface IEntityGroupStore
groupID
- the group ID
GroupsException
public java.lang.String[] findMemberGroupKeys(IEntityGroup group) throws GroupsException
findMemberGroupKeys
in interface IEntityGroupStore
group
- the org.jasig.portal.groups.IEntityGroup
GroupsException
public java.util.Iterator findMemberGroups(IEntityGroup group) throws GroupsException
findMemberGroups
in interface IEntityGroupStore
group
- org.jasig.portal.groups.IEntityGroup
GroupsException
private static java.lang.String getAllGroupColumns()
private static java.lang.String getAllGroupColumnsWithTableAlias()
private static java.lang.String getAllMemberColumns()
private static java.lang.String getCountAMemberEntitySql()
private static java.lang.String getCountAMemberGroupSql()
private static java.lang.String getCountMemberGroupsNamedSql()
private static java.lang.String getDeleteGroupSql(IEntityGroup group)
private static java.lang.String getDeleteMemberEntitySql()
private static java.lang.String getDeleteMemberGroupSql()
private static java.lang.String getDeleteMembersInGroupSql()
private static java.lang.String getDeleteMembersInGroupSql(IEntityGroup group)
private static java.lang.String getFindContainingGroupsForEntitySql()
private static java.lang.String getFindContainingGroupsForGroupSql()
private static java.lang.String getFindGroupsByCreatorSql()
private static java.lang.String getFindGroupSql()
private static java.lang.String getFindMemberGroupKeysSql()
private static java.lang.String getFindMemberGroupsSql()
public IGroupService getGroupService()
private static java.lang.String getInsertGroupSql()
private static java.lang.String getInsertMemberSql()
private java.lang.String getNextKey() throws java.lang.Exception
java.lang.Exception
private static java.lang.String getUpdateGroupSql()
private IEntityGroup instanceFromResultSet(java.sql.ResultSet rs) throws java.sql.SQLException, GroupsException
rs
- the SQL result set
java.sql.SQLException
GroupsException
private ILockableEntityGroup lockableInstanceFromResultSet(java.sql.ResultSet rs) throws java.sql.SQLException, GroupsException
rs
- the SQL result set
java.sql.SQLException
GroupsException
protected static void logNoTransactionWarning()
public IEntity newEntity(java.lang.Class type, java.lang.String key) throws GroupsException
GroupsException
public IEntityGroup newInstance(java.lang.Class type) throws GroupsException
newInstance
in interface IEntityGroupStore
GroupsException
private IEntityGroup newInstance(java.lang.String newKey, java.lang.Class newType, java.lang.String newCreatorID, java.lang.String newName, java.lang.String newDescription) throws GroupsException
GroupsException
private ILockableEntityGroup newLockableInstance(java.lang.String newKey, java.lang.Class newType, java.lang.String newCreatorID, java.lang.String newName, java.lang.String newDescription) throws GroupsException
GroupsException
private static java.lang.String groupAlias(java.lang.String column)
private static java.lang.String memberAlias(java.lang.String column)
private void primAdd(IEntityGroup group, java.sql.Connection conn) throws java.sql.SQLException, GroupsException
group
- org.jasig.portal.groups.IEntityGroupconn
- the database connection
java.sql.SQLException
GroupsException
private void primDelete(IEntityGroup group) throws java.sql.SQLException
group
- org.jasig.portal.groups.IEntityGroup
java.sql.SQLException
private IEntityGroup primFind(java.lang.String groupID, boolean lockable) throws GroupsException
groupID
- the group IDlockable
- boolean
GroupsException
private void primUpdate(IEntityGroup group, java.sql.Connection conn) throws java.sql.SQLException, GroupsException
group
- org.jasig.portal.groups.IEntityGroupconn
- the database connection
java.sql.SQLException
GroupsException
private void primUpdateMembers(EntityGroupImpl egi, java.sql.Connection conn) throws java.sql.SQLException
egi
- org.jasig.portal.groups.EntityGroupImplconn
- the database connection
java.sql.SQLException
protected static void rollback(java.sql.Connection conn) throws java.sql.SQLException
conn
- java.sql.Connection
java.sql.SQLException
public EntityIdentifier[] searchForGroups(java.lang.String query, int method, java.lang.Class leaftype) throws GroupsException
IEntityGroupStore
searchForGroups
in interface IEntityGroupStore
GroupsException
protected static void setAutoCommit(java.sql.Connection conn, boolean newValue) throws java.sql.SQLException
conn
- java.sql.ConnectionnewValue
- boolean
java.sql.SQLException
- The exception description.public void setGroupService(IGroupService newGroupService)
newGroupService
- org.jasig.portal.groups.IGroupServicepublic static RDBMEntityGroupStore singleton() throws GroupsException
GroupsException
private static java.lang.String sqlQuote(java.lang.Object o)
public void update(IEntityGroup group) throws GroupsException
update
in interface IEntityGroupStore
group
- org.jasig.portal.groups.IEntityGroup
GroupsException
public void updateMembers(IEntityGroup eg) throws GroupsException
updateMembers
in interface IEntityGroupStore
eg
- org.jasig.portal.groups.IEntityGroup
GroupsException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |