lumis.portal.group.databaseviewmembership
Class DatabaseViewGroupMembershipProvider

Package class diagram package DatabaseViewGroupMembershipProvider
java.lang.Object
  extended by lumis.portal.group.AbstractGroupMembershipProvider
      extended by 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

Constructor Summary
DatabaseViewGroupMembershipProvider()
           
 
Method Summary
 void deleteGroupMembershipData(String groupId)
          Deletes DatabaseViewGroupConfig of the specified group.
 void deleteGroupTypeMembershipData()
          Deletes DatabaseViewGroupTypeConfig of the current group type.
 void destroy()
          Indicates that this membership provider will no longer be used.
protected  DatabaseViewGroupTypeConfig getDatabaseViewGroupTypeConfig()
           
 String getGroupConfigurationInterfaceId()
          Returns the interface identifier for editing configurations at a group scope.
 Collection<String> getGroups(String principalId)
          Returns the groups of a principal.
 String getGroupTypeConfigurationInterfaceId()
          Returns the interface identifier for editing configurations at a group type scope.
 Collection<String> getMembers(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  Map<String,Object> readMemberData(String principalId)
          Returns the data for a specific member.
protected  Collection<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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatabaseViewGroupMembershipProvider

public DatabaseViewGroupMembershipProvider()
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 interface IGroupMembershipProvider
Overrides:
init in class AbstractGroupMembershipProvider
Parameters:
groupType - the group type.

getDatabaseViewGroupTypeConfig

protected DatabaseViewGroupTypeConfig getDatabaseViewGroupTypeConfig()
                                                              throws NoResultException
Throws:
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 interface IGroupMembershipProvider
Overrides:
destroy in class AbstractGroupMembershipProvider

getGroupConfigurationInterfaceId

public 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 interface IGroupMembershipProvider
Overrides:
getGroupConfigurationInterfaceId in class AbstractGroupMembershipProvider
Returns:
the interface identifier, or null if no such configuration interface exists.

getGroupTypeConfigurationInterfaceId

public 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 interface IGroupMembershipProvider
Overrides:
getGroupTypeConfigurationInterfaceId in class AbstractGroupMembershipProvider
Returns:
the interface identifier, or null if no such configuration interface exists.

getGroups

public Collection<String> getGroups(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 Collection<String> getMembers(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 of IGroupManager.FILTER_TYPE_USERS_AND_GROUPS, IGroupManager.FILTER_TYPE_ONLY_USERS or IGroupManager.FILTER_TYPE_ONLY_GROUPS.
Returns:
a collection of group's member principals identifiers, obeying the specified filter type.
Throws:
PortalException

readMemberData

protected Map<String,Object> readMemberData(String principalId)
                                     throws PortalException,
                                            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:
NoResultException - if no entry was found for the given principalShortId.
PortalException
Since:
4.2.1

readMembers

protected Collection<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(String groupId)
                               throws PortalException
Deletes DatabaseViewGroupConfig of the specified group.

Specified by:
deleteGroupMembershipData in interface IGroupMembershipProvider
Overrides:
deleteGroupMembershipData in class AbstractGroupMembershipProvider
Parameters:
groupId - the group identifier.
Throws:
PortalException
Since:
4.2.1

deleteGroupTypeMembershipData

public void deleteGroupTypeMembershipData()
                                   throws PortalException
Deletes DatabaseViewGroupTypeConfig of the current group type.

Specified by:
deleteGroupTypeMembershipData in interface IGroupMembershipProvider
Overrides:
deleteGroupTypeMembershipData in class AbstractGroupMembershipProvider
Throws:
PortalException
Since:
4.2.1


Lumisportal  5.5.0.091130 - Copyright © 2001-2007, Lumis. All Rights Reserved.