Class DatabaseViewGroupMembershipProvider
- java.lang.Object
-
- lumis.portal.group.AbstractGroupMembershipProvider
-
- lumis.portal.group.databaseviewmembership.DatabaseViewGroupMembershipProvider
-
- All Implemented Interfaces:
IGroupMembershipProvider
public class DatabaseViewGroupMembershipProvider extends AbstractGroupMembershipProvider
Group Membership provider that allows membership configuration based on a database view data.- Since:
- 4.2.1
- Version:
- $Revision$ $Date$
-
-
Constructor Summary
Constructors Constructor Description DatabaseViewGroupMembershipProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deleteGroupMembershipData(java.lang.String groupId)
DeletesDatabaseViewGroupConfig
of the specified group.void
deleteGroupTypeMembershipData()
DeletesDatabaseViewGroupTypeConfig
of the current group type.void
destroy()
Indicates that this membership provider will no longer be used.protected DatabaseViewGroupTypeConfig
getDatabaseViewGroupTypeConfig()
java.lang.String
getGroupConfigurationInterfaceId()
Returns the interface identifier for editing configurations at a group scope.java.util.Collection<java.lang.String>
getGroups(java.lang.String principalId)
Returns the groups of a principal.java.lang.String
getGroupTypeConfigurationInterfaceId()
Returns the interface identifier for editing configurations at a group type scope.java.util.Collection<java.lang.String>
getMembers(java.lang.String groupId, int filterType)
Returns the members of a group.void
init(GroupType groupType)
Initializes this membership provider to be used for the given group type.protected java.util.Map<java.lang.String,java.lang.Object>
readMemberData(java.lang.String principalId)
Returns the data for a specific member.protected java.util.Collection<java.lang.String>
readMembers(DatabaseViewGroupConfig databaseViewGroupConfig, int filterType)
Read from persistence the identifiers of principals that match the specified criteria.-
Methods inherited from class lumis.portal.group.AbstractGroupMembershipProvider
addMember, getGroupType, removeMember
-
-
-
-
Method Detail
-
init
public void init(GroupType groupType)
Description copied from interface:IGroupMembershipProvider
Initializes this membership provider to be used for the given group type.This method is the first method called after an instance creation.
- Specified by:
init
in interfaceIGroupMembershipProvider
- Overrides:
init
in classAbstractGroupMembershipProvider
- Parameters:
groupType
- the group type.
-
getDatabaseViewGroupTypeConfig
protected DatabaseViewGroupTypeConfig getDatabaseViewGroupTypeConfig() throws javax.persistence.NoResultException
- Throws:
javax.persistence.NoResultException
-
destroy
public void destroy()
Description copied from interface:IGroupMembershipProvider
Indicates that this membership provider will no longer be used.This method may be used to clean up resources allocated in this instance. This instance is no longer used after this method is called.
- Specified by:
destroy
in interfaceIGroupMembershipProvider
- Overrides:
destroy
in classAbstractGroupMembershipProvider
-
getGroupConfigurationInterfaceId
public java.lang.String getGroupConfigurationInterfaceId()
Description copied from interface:IGroupMembershipProvider
Returns the interface identifier for editing configurations at a group scope.The interface will receive the parameter groupId with the identifier of the group being configured.
Usually
IGroupMembershipProvider.deleteGroupMembershipData(String)
will be used to delete data stored using this configuration interface.- Specified by:
getGroupConfigurationInterfaceId
in interfaceIGroupMembershipProvider
- Overrides:
getGroupConfigurationInterfaceId
in classAbstractGroupMembershipProvider
- Returns:
- the interface identifier, or null if no such configuration interface exists.
-
getGroupTypeConfigurationInterfaceId
public java.lang.String getGroupTypeConfigurationInterfaceId()
Description copied from interface:IGroupMembershipProvider
Returns the interface identifier for editing configurations at a group type scope.The interface will receive the parameter groupTypeId with the identifier of the group type being configured.
Usually
IGroupMembershipProvider.deleteGroupTypeMembershipData()
will be used to delete data stored using this configuration interface.- Specified by:
getGroupTypeConfigurationInterfaceId
in interfaceIGroupMembershipProvider
- Overrides:
getGroupTypeConfigurationInterfaceId
in classAbstractGroupMembershipProvider
- Returns:
- the interface identifier, or null if no such configuration interface exists.
-
getGroups
public java.util.Collection<java.lang.String> getGroups(java.lang.String principalId) throws PortalException
Description copied from interface:IGroupMembershipProvider
Returns the groups of a principal. Only the direct groups, belonging to the group type this provider is serving, are to be returned.- Parameters:
principalId
- the principal identifier.- Returns:
- the groups identifiers.
- Throws:
PortalException
-
getMembers
public java.util.Collection<java.lang.String> getMembers(java.lang.String groupId, int filterType) throws PortalException
Description copied from interface:IGroupMembershipProvider
Returns the members of a group. Only the direct members are returned.- Parameters:
groupId
- the group identifier.filterType
- defines how the result will be filtered. This may be one ofIGroupManager.FILTER_TYPE_USERS_AND_GROUPS
,IGroupManager.FILTER_TYPE_ONLY_USERS
orIGroupManager.FILTER_TYPE_ONLY_GROUPS
.- Returns:
- a collection of group's member principals identifiers, obeying the specified filter type.
- Throws:
PortalException
-
readMemberData
protected java.util.Map<java.lang.String,java.lang.Object> readMemberData(java.lang.String principalId) throws PortalException, javax.persistence.NoResultException
Returns the data for a specific member.- Parameters:
principalId
- the member's identifier.- Returns:
- a Map, where key is the
DatabaseViewField.getColumnName()
, and the value is the corresponding value read from the database - Throws:
javax.persistence.NoResultException
- if no entry was found for the given principalShortId.PortalException
- Since:
- 4.2.1
-
readMembers
protected java.util.Collection<java.lang.String> readMembers(DatabaseViewGroupConfig databaseViewGroupConfig, int filterType) throws PortalException
Read from persistence the identifiers of principals that match the specified criteria.- Parameters:
databaseViewGroupConfig
- the configuration for the group membership.filterType
- the type of members (IGroupManager.FILTER_TYPE_* constants).- Returns:
- the matched principal identifiers.
- Throws:
PortalException
- Since:
- 4.2.1
-
deleteGroupMembershipData
public void deleteGroupMembershipData(java.lang.String groupId) throws PortalException
DeletesDatabaseViewGroupConfig
of the specified group.- Specified by:
deleteGroupMembershipData
in interfaceIGroupMembershipProvider
- Overrides:
deleteGroupMembershipData
in classAbstractGroupMembershipProvider
- Parameters:
groupId
- the group identifier.- Throws:
PortalException
- Since:
- 4.2.1
-
deleteGroupTypeMembershipData
public void deleteGroupTypeMembershipData() throws PortalException
DeletesDatabaseViewGroupTypeConfig
of the current group type.- Specified by:
deleteGroupTypeMembershipData
in interfaceIGroupMembershipProvider
- Overrides:
deleteGroupTypeMembershipData
in classAbstractGroupMembershipProvider
- Throws:
PortalException
- Since:
- 4.2.1
-
-