lumis.portal.group
Class GroupManager

Package class diagram package GroupManager
java.lang.Object
  extended by lumis.portal.group.GroupManager
All Implemented Interfaces:
IGroupManager, IConfigDeleter

public class GroupManager
extends Object
implements IGroupManager

Class responsible for managing operations on the portal groups.

Since:
4.0.0

Field Summary
 
Fields inherited from interface lumis.portal.group.IGroupManager
FILTER_TYPE_ONLY_GROUPS, FILTER_TYPE_ONLY_USERS, FILTER_TYPE_USERS_AND_GROUPS, GROUP_ID_ALL_REGISTERED_USERS, GROUP_ID_ALL_USERS
 
Constructor Summary
GroupManager()
           
 
Method Summary
 String add(SessionConfig sessionConfig, GroupConfig groupConfig, ITransaction transaction)
          Add a group.
 void addGroupType(SessionConfig sessionConfig, GroupType groupType, ITransaction transaction)
          Adds a group type.
 void addMember(SessionConfig sessionConfig, String groupId, String memberId, ITransaction transaction)
          Add a member into the group.
 void addOrUpdate(SessionConfig sessionConfig, GroupConfig groupConfig, ITransaction transaction)
           
 void delete(SessionConfig sessionConfig, String groupId, ITransaction transaction)
          Delete a group.
 void deleteAllMembers(SessionConfig sessionConfig, String groupId, ITransaction transaction)
          Delete all member associations for the specified group.
 void deleteConfig(DeserializationContext deserializationContext, String configId)
           
 void deleteGroupType(SessionConfig sessionConfig, String groupTypeId, ITransaction transaction)
          Deletes a group type.
 void deleteMember(SessionConfig sessionConfig, String groupId, String memberId, ITransaction transaction)
          Delete a member of the group.
 String deserialize(SessionConfig sessionConfig, DeserializationConfig deserializationConfig, Node groupNode, ITransaction transaction)
           
 void deserializeMembers(SessionConfig sessionConfig, DeserializationConfig deserializationConfig, Node membersNodes, ITransaction transaction)
           
 GroupConfig get(SessionConfig sessionConfig, String groupId, ITransaction transaction)
          Returns the group with the specified identifier.
 Collection<GroupConfig> getByChannelId(SessionConfig sessionConfig, String channelId, ITransaction transaction)
          Get all local groups from the specified channel
 Collection<GroupConfig> getByOrigin(SessionConfig sessionConfig, String origin, ITransaction transaction)
          Get the local groups configuration for the specified origin.
 String getGroupConfigurationInterfaceId(SessionConfig sessionConfig, String groupTypeId, ITransaction transaction)
          Returns the interface identifier for editing membership configurations of groups of a specific group type.
 GroupType getGroupType(SessionConfig sessionConfig, String groupTypeId, ITransaction transaction)
          Returns a group type.
 String getGroupTypeConfigurationInterfaceId(SessionConfig sessionConfig, String groupTypeId, ITransaction transaction)
          Returns the interface identifier for editing membership configurations for a group type.
 Collection<String> getIds(SessionConfig sessionConfig, ITransaction transaction)
          Get all groups.
 Collection<String> getMemberGroups(SessionConfig sessionConfig, String memberId, boolean recursively, ITransaction transaction)
          VERIFICAR O NOME: getIdsByMemberId Returns an array of groups of the given member.
 Collection<String> getMembers(SessionConfig sessionConfig, String groupId, int filterType, boolean recursively, ITransaction transaction)
          Returns the immediate group members.
 void invalidateGroupMembershipProvider(SessionConfig sessionConfig, String groupTypeId, ITransaction transaction)
          Destroys a group membership provider from the storage, cluster wide.
 boolean isMember(SessionConfig sessionConfig, Collection<String> groupIds, String principalId, ITransaction transaction)
          Verifies if a principal is a member, directly or indirectly, of one of the specified groups.
 boolean isMember(SessionConfig sessionConfig, String groupId, String principalId, ITransaction transaction)
          Verifies if a principal is a member, directly or indirectly, of a group.
 void serialize(SessionConfig sessionConfig, GroupConfig groupConfig, OutputStream outputStream, ITransaction transaction)
           
 void serializeMembers(SessionConfig sessionConfig, GroupConfig groupConfig, OutputStream outputStream, ITransaction transaction)
           
 void update(SessionConfig sessionConfig, GroupConfig groupConfig, ITransaction transaction)
          Update the group configuration.
 void updateGroupType(SessionConfig sessionConfig, GroupType groupType, ITransaction transaction)
          Updates a group type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroupManager

public GroupManager()
Method Detail

addOrUpdate

public void addOrUpdate(SessionConfig sessionConfig,
                        GroupConfig groupConfig,
                        ITransaction transaction)
                 throws ManagerException,
                        PortalException
Specified by:
addOrUpdate in interface IGroupManager
Throws:
ManagerException
PortalException

add

public String add(SessionConfig sessionConfig,
                  GroupConfig groupConfig,
                  ITransaction transaction)
           throws ManagerException,
                  PortalException
Description copied from interface: IGroupManager
Add a group.

Specified by:
add in interface IGroupManager
Returns:
Returns a String.
Throws:
ManagerException
PortalException

update

public void update(SessionConfig sessionConfig,
                   GroupConfig groupConfig,
                   ITransaction transaction)
            throws ManagerException,
                   PortalException
Description copied from interface: IGroupManager
Update the group configuration.

Specified by:
update in interface IGroupManager
Throws:
ManagerException
PortalException

get

public GroupConfig get(SessionConfig sessionConfig,
                       String groupId,
                       ITransaction transaction)
                throws ManagerException,
                       PortalException
Description copied from interface: IGroupManager
Returns the group with the specified identifier.

Specified by:
get in interface IGroupManager
Parameters:
sessionConfig - the user session information.
groupId - the group identifier.
transaction - the transaction for persistence access.
Returns:
the group.
Throws:
PortalObjectNotFoundException - if no such group was found.
ManagerException
PortalException

delete

public void delete(SessionConfig sessionConfig,
                   String groupId,
                   ITransaction transaction)
            throws ManagerException,
                   PortalException
Description copied from interface: IGroupManager
Delete a group.

Specified by:
delete in interface IGroupManager
Throws:
ManagerException
PortalException

getIds

public Collection<String> getIds(SessionConfig sessionConfig,
                                 ITransaction transaction)
                          throws ManagerException,
                                 PortalException
Description copied from interface: IGroupManager
Get all groups.

Specified by:
getIds in interface IGroupManager
Returns:
Returns an array of Strings.
Throws:
ManagerException
PortalException

addMember

public void addMember(SessionConfig sessionConfig,
                      String groupId,
                      String memberId,
                      ITransaction transaction)
               throws ManagerException,
                      PortalException
Description copied from interface: IGroupManager
Add a member into the group. The members may be users or groups.

Specified by:
addMember in interface IGroupManager
Throws:
ManagerException
PortalException

deleteMember

public void deleteMember(SessionConfig sessionConfig,
                         String groupId,
                         String memberId,
                         ITransaction transaction)
                  throws ManagerException,
                         PortalException
Description copied from interface: IGroupManager
Delete a member of the group.

Specified by:
deleteMember in interface IGroupManager
Throws:
ManagerException
PortalException

getMembers

public Collection<String> getMembers(SessionConfig sessionConfig,
                                     String groupId,
                                     int filterType,
                                     boolean recursively,
                                     ITransaction transaction)
                              throws ManagerException,
                                     PortalException
Description copied from interface: IGroupManager
Returns the immediate group members. The members may be users or groups. You can specify to get direct members or all members recursively as well as the type of members that should be considered.

Specified by:
getMembers in interface IGroupManager
Parameters:
sessionConfig - the user session information.
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, IGroupManager.FILTER_TYPE_ONLY_GROUPS.
recursively - true to search for members recursively, false otherwise.
transaction - the transaction for persistence access.
Returns:
a collection of group member identifiers.
Throws:
ManagerException
PortalException

getMemberGroups

public Collection<String> getMemberGroups(SessionConfig sessionConfig,
                                          String memberId,
                                          boolean recursively,
                                          ITransaction transaction)
                                   throws ManagerException,
                                          PortalException
Description copied from interface: IGroupManager
VERIFICAR O NOME: getIdsByMemberId Returns an array of groups of the given member. The list of members must include the framework groups "all" and "registered users" if the current user is not the guest user. You can specify to get just direct groups as well as all groups recursively

Specified by:
getMemberGroups in interface IGroupManager
Returns:
Returns an array of Strings.
Throws:
ManagerException
PortalException

getByChannelId

public Collection<GroupConfig> getByChannelId(SessionConfig sessionConfig,
                                              String channelId,
                                              ITransaction transaction)
                                       throws ManagerException,
                                              PortalException
Description copied from interface: IGroupManager
Get all local groups from the specified channel

Specified by:
getByChannelId in interface IGroupManager
Returns:
Returns an array of GroupConfig.
Throws:
ManagerException
PortalException

serialize

public void serialize(SessionConfig sessionConfig,
                      GroupConfig groupConfig,
                      OutputStream outputStream,
                      ITransaction transaction)
               throws ManagerException,
                      PortalException
Specified by:
serialize in interface IGroupManager
Throws:
ManagerException
PortalException

serializeMembers

public void serializeMembers(SessionConfig sessionConfig,
                             GroupConfig groupConfig,
                             OutputStream outputStream,
                             ITransaction transaction)
                      throws ManagerException,
                             PortalException
Specified by:
serializeMembers in interface IGroupManager
Throws:
ManagerException
PortalException

deserialize

public String deserialize(SessionConfig sessionConfig,
                          DeserializationConfig deserializationConfig,
                          Node groupNode,
                          ITransaction transaction)
                   throws ManagerException,
                          PortalException
Specified by:
deserialize in interface IGroupManager
Returns:
Returns a String.
Throws:
ManagerException
PortalException

deserializeMembers

public void deserializeMembers(SessionConfig sessionConfig,
                               DeserializationConfig deserializationConfig,
                               Node membersNodes,
                               ITransaction transaction)
                        throws ManagerException,
                               PortalException
Specified by:
deserializeMembers in interface IGroupManager
Throws:
ManagerException
PortalException

deleteConfig

public void deleteConfig(DeserializationContext deserializationContext,
                         String configId)
                  throws PortalException
Specified by:
deleteConfig in interface IConfigDeleter
Throws:
PortalException

getByOrigin

public Collection<GroupConfig> getByOrigin(SessionConfig sessionConfig,
                                           String origin,
                                           ITransaction transaction)
                                    throws ManagerException,
                                           PortalException
Description copied from interface: IGroupManager
Get the local groups configuration for the specified origin.

Specified by:
getByOrigin in interface IGroupManager
origin - the origin identifier
transaction - the transaction for persistence access.
Returns:
Throws:
DaoException
PortalException
ManagerException

deleteAllMembers

public void deleteAllMembers(SessionConfig sessionConfig,
                             String groupId,
                             ITransaction transaction)
                      throws DaoException,
                             PortalException
Description copied from interface: IGroupManager
Delete all member associations for the specified group.

Specified by:
deleteAllMembers in interface IGroupManager
Parameters:
sessionConfig - the user session information.
groupId - the group id.
transaction - the transaction for persistence access.
Throws:
DaoException
PortalException

isMember

public boolean isMember(SessionConfig sessionConfig,
                        String groupId,
                        String principalId,
                        ITransaction transaction)
                 throws PortalException
Description copied from interface: IGroupManager
Verifies if a principal is a member, directly or indirectly, of a group.

Specified by:
isMember in interface IGroupManager
Parameters:
sessionConfig - the user session information.
groupId - the group identifier.
principalId - the principal identifier.
transaction - the transaction for persistence access.
Returns:
true if the specified principal is member of the group or any of its subgroups recursively, false otherwise.
Throws:
PortalException

isMember

public boolean isMember(SessionConfig sessionConfig,
                        Collection<String> groupIds,
                        String principalId,
                        ITransaction transaction)
                 throws PortalException
Description copied from interface: IGroupManager
Verifies if a principal is a member, directly or indirectly, of one of the specified groups.

Specified by:
isMember in interface IGroupManager
Parameters:
sessionConfig - the user session information.
groupIds - the group identifiers.
principalId - the principal identifier.
transaction - the transaction for persistence access.
Returns:
true if the principal is member of any of the groups or their subgroups recursively, false otherwise.
Throws:
PortalException

invalidateGroupMembershipProvider

public void invalidateGroupMembershipProvider(SessionConfig sessionConfig,
                                              String groupTypeId,
                                              ITransaction transaction)
                                       throws PortalException
Destroys a group membership provider from the storage, cluster wide.

Specified by:
invalidateGroupMembershipProvider in interface IGroupManager
Parameters:
groupTypeId - the group type identifier the group membership provider is used in.
sessionConfig - user session information.
transaction - the transaction for persistence access.
Throws:
PortalException
Since:
4.2.1

addGroupType

public void addGroupType(SessionConfig sessionConfig,
                         GroupType groupType,
                         ITransaction transaction)
                  throws PortalException
Description copied from interface: IGroupManager
Adds a group type.

Specified by:
addGroupType in interface IGroupManager
Parameters:
sessionConfig - user session information.
groupType - the group type.
transaction - transaction for persistence access.
Throws:
PortalObjectAlreadyExistsException - if a group type with the same identifier already exists.
PortalException

deleteGroupType

public void deleteGroupType(SessionConfig sessionConfig,
                            String groupTypeId,
                            ITransaction transaction)
                     throws PortalException
Description copied from interface: IGroupManager
Deletes a group type.

Specified by:
deleteGroupType in interface IGroupManager
Parameters:
sessionConfig - user session information.
groupTypeId - the group type identifier.
transaction - transaction for persistence access.
Throws:
PortalObjectNotFoundException - if no such group type was found.
PortalException

getGroupType

public GroupType getGroupType(SessionConfig sessionConfig,
                              String groupTypeId,
                              ITransaction transaction)
                       throws PortalException
Description copied from interface: IGroupManager
Returns a group type.

Specified by:
getGroupType in interface IGroupManager
Parameters:
sessionConfig - user session information.
groupTypeId - the group type identifier.
transaction - transaction for persistence access.
Returns:
the group type.
Throws:
PortalObjectNotFoundException - if no such group type was found.
PortalException

updateGroupType

public void updateGroupType(SessionConfig sessionConfig,
                            GroupType groupType,
                            ITransaction transaction)
                     throws PortalException
Description copied from interface: IGroupManager
Updates a group type.

Specified by:
updateGroupType in interface IGroupManager
Parameters:
sessionConfig - user session information.
groupType - the group type.
transaction - transaction for persistence access.
Throws:
PortalObjectNotFoundException - if no such group type was found.
PortalException

getGroupTypeConfigurationInterfaceId

public String getGroupTypeConfigurationInterfaceId(SessionConfig sessionConfig,
                                                   String groupTypeId,
                                                   ITransaction transaction)
                                            throws PortalException
Description copied from interface: IGroupManager
Returns the interface identifier for editing membership configurations for a group type.

The interface should receive the parameter groupTypeId with the identifier of the group type being configured.

Specified by:
getGroupTypeConfigurationInterfaceId in interface IGroupManager
Parameters:
sessionConfig - user session information.
groupTypeId - the group type identifier.
transaction - the transaction for persistence access.
Returns:
the interface identifier, or null if no such configuration interface exists for the specified group type.
Throws:
PortalException

getGroupConfigurationInterfaceId

public String getGroupConfigurationInterfaceId(SessionConfig sessionConfig,
                                               String groupTypeId,
                                               ITransaction transaction)
                                        throws PortalException
Description copied from interface: IGroupManager
Returns the interface identifier for editing membership configurations of groups of a specific group type.

The interface should receive the parameter groupId with the identifier of the group being configured.

Specified by:
getGroupConfigurationInterfaceId in interface IGroupManager
Parameters:
sessionConfig - user session information.
groupTypeId - the group type identifier.
transaction - the transaction for persistence access.
Returns:
the interface identifier, or null if no such configuration interface exists for the specified group type.
Throws:
PortalException


Lumisportal  6.2.0.120405 - Copyright © 2006–2012 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.