public class GroupManager extends Object implements IGroupManagerSPI
FILTER_TYPE_ONLY_GROUPS, FILTER_TYPE_ONLY_USERS, FILTER_TYPE_USERS_AND_GROUPS, GROUP_ID_ALL_REGISTERED_USERS, GROUP_ID_ALL_USERS
Constructor and Description |
---|
GroupManager() |
Modifier and Type | Method and Description |
---|---|
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) |
protected Collection<CacheItem<GroupConfig>> |
bulkLoadGroups()
Reads all groups from data base.
|
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,
boolean useSessionCache,
ITransaction transaction)
Returns an array of groups of the given member.
|
Collection<String> |
getMemberGroups(SessionConfig sessionConfig,
String memberId,
boolean recursively,
ITransaction transaction)
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.
|
protected Collection<CacheItem<GroupConfig>> bulkLoadGroups() throws DaoException, PortalException
DaoException
PortalException
public void addOrUpdate(SessionConfig sessionConfig, GroupConfig groupConfig, ITransaction transaction) throws ManagerException, PortalException
addOrUpdate
in interface IGroupManager
ManagerException
PortalException
public String add(SessionConfig sessionConfig, GroupConfig groupConfig, ITransaction transaction) throws ManagerException, PortalException
IGroupManager
add
in interface IGroupManager
ManagerException
PortalException
public void update(SessionConfig sessionConfig, GroupConfig groupConfig, ITransaction transaction) throws ManagerException, PortalException
IGroupManager
update
in interface IGroupManager
ManagerException
PortalException
public GroupConfig get(SessionConfig sessionConfig, String groupId, ITransaction transaction) throws ManagerException, PortalException
IGroupManager
get
in interface IGroupManager
sessionConfig
- the user session information.groupId
- the group identifier.transaction
- the transaction for persistence access.PortalObjectNotFoundException
- if no such group was found.ManagerException
PortalException
public void delete(SessionConfig sessionConfig, String groupId, ITransaction transaction) throws ManagerException, PortalException
IGroupManager
delete
in interface IGroupManager
ManagerException
PortalException
public Collection<String> getIds(SessionConfig sessionConfig, ITransaction transaction) throws ManagerException, PortalException
IGroupManager
getIds
in interface IGroupManager
ManagerException
PortalException
public void addMember(SessionConfig sessionConfig, String groupId, String memberId, ITransaction transaction) throws ManagerException, PortalException
IGroupManager
addMember
in interface IGroupManager
ManagerException
PortalException
public void deleteMember(SessionConfig sessionConfig, String groupId, String memberId, ITransaction transaction) throws ManagerException, PortalException
IGroupManager
deleteMember
in interface IGroupManager
ManagerException
PortalException
public Collection<String> getMembers(SessionConfig sessionConfig, String groupId, int filterType, boolean recursively, ITransaction transaction) throws ManagerException, PortalException
IGroupManager
getMembers
in interface IGroupManager
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.ManagerException
PortalException
public Collection<String> getMemberGroups(SessionConfig sessionConfig, String memberId, boolean recursively, ITransaction transaction) throws ManagerException, PortalException
IGroupManager
getMemberGroups
in interface IGroupManager
ManagerException
PortalException
public Collection<String> getMemberGroups(SessionConfig sessionConfig, String memberId, boolean recursively, boolean useSessionCache, ITransaction transaction) throws ManagerException, PortalException
IGroupManagerSPI
getMemberGroups
in interface IGroupManagerSPI
ManagerException
PortalException
public Collection<GroupConfig> getByChannelId(SessionConfig sessionConfig, String channelId, ITransaction transaction) throws ManagerException, PortalException
IGroupManager
getByChannelId
in interface IGroupManager
ManagerException
PortalException
public void serialize(SessionConfig sessionConfig, GroupConfig groupConfig, OutputStream outputStream, ITransaction transaction) throws ManagerException, PortalException
serialize
in interface IGroupManager
ManagerException
PortalException
public void serializeMembers(SessionConfig sessionConfig, GroupConfig groupConfig, OutputStream outputStream, ITransaction transaction) throws ManagerException, PortalException
serializeMembers
in interface IGroupManager
ManagerException
PortalException
public String deserialize(SessionConfig sessionConfig, DeserializationConfig deserializationConfig, Node groupNode, ITransaction transaction) throws ManagerException, PortalException
deserialize
in interface IGroupManager
ManagerException
PortalException
public void deserializeMembers(SessionConfig sessionConfig, DeserializationConfig deserializationConfig, Node membersNodes, ITransaction transaction) throws ManagerException, PortalException
deserializeMembers
in interface IGroupManager
ManagerException
PortalException
public void deleteConfig(DeserializationContext deserializationContext, String configId) throws PortalException
deleteConfig
in interface IConfigDeleter
PortalException
public Collection<GroupConfig> getByOrigin(SessionConfig sessionConfig, String origin, ITransaction transaction) throws ManagerException, PortalException
IGroupManager
getByOrigin
in interface IGroupManager
origin
- the origin identifiertransaction
- the transaction for persistence access.DaoException
PortalException
ManagerException
public void deleteAllMembers(SessionConfig sessionConfig, String groupId, ITransaction transaction) throws DaoException, PortalException
IGroupManager
deleteAllMembers
in interface IGroupManager
sessionConfig
- the user session information.groupId
- the group id.transaction
- the transaction for persistence access.DaoException
PortalException
public boolean isMember(SessionConfig sessionConfig, String groupId, String principalId, ITransaction transaction) throws PortalException
IGroupManager
isMember
in interface IGroupManager
sessionConfig
- the user session information.groupId
- the group identifier.principalId
- the principal identifier.transaction
- the transaction for persistence access.PortalException
public boolean isMember(SessionConfig sessionConfig, Collection<String> groupIds, String principalId, ITransaction transaction) throws PortalException
IGroupManager
isMember
in interface IGroupManager
sessionConfig
- the user session information.groupIds
- the group identifiers.principalId
- the principal identifier.transaction
- the transaction for persistence access.PortalException
public void invalidateGroupMembershipProvider(SessionConfig sessionConfig, String groupTypeId, ITransaction transaction) throws PortalException
invalidateGroupMembershipProvider
in interface IGroupManager
groupTypeId
- the group type identifier the group membership provider
is used in.sessionConfig
- user session information.transaction
- the transaction for persistence access.PortalException
public void addGroupType(SessionConfig sessionConfig, GroupType groupType, ITransaction transaction) throws PortalException
IGroupManager
addGroupType
in interface IGroupManager
sessionConfig
- user session information.groupType
- the group type.transaction
- transaction for persistence access.PortalObjectAlreadyExistsException
- if a group type with the
same identifier already exists.PortalException
public void deleteGroupType(SessionConfig sessionConfig, String groupTypeId, ITransaction transaction) throws PortalException
IGroupManager
deleteGroupType
in interface IGroupManager
sessionConfig
- user session information.groupTypeId
- the group type identifier.transaction
- transaction for persistence access.PortalObjectNotFoundException
- if no such group type was found.PortalException
public GroupType getGroupType(SessionConfig sessionConfig, String groupTypeId, ITransaction transaction) throws PortalException
IGroupManager
getGroupType
in interface IGroupManager
sessionConfig
- user session information.groupTypeId
- the group type identifier.transaction
- transaction for persistence access.PortalObjectNotFoundException
- if no such group type was found.PortalException
public void updateGroupType(SessionConfig sessionConfig, GroupType groupType, ITransaction transaction) throws PortalException
IGroupManager
updateGroupType
in interface IGroupManager
sessionConfig
- user session information.groupType
- the group type.transaction
- transaction for persistence access.PortalObjectNotFoundException
- if no such group type was found.PortalException
public String getGroupTypeConfigurationInterfaceId(SessionConfig sessionConfig, String groupTypeId, ITransaction transaction) throws PortalException
IGroupManager
The interface should receive the parameter groupTypeId with the identifier of the group type being configured.
getGroupTypeConfigurationInterfaceId
in interface IGroupManager
sessionConfig
- user session information.groupTypeId
- the group type identifier.transaction
- the transaction for persistence access.PortalException
public String getGroupConfigurationInterfaceId(SessionConfig sessionConfig, String groupTypeId, ITransaction transaction) throws PortalException
IGroupManager
The interface should receive the parameter groupId with the identifier of the group being configured.
getGroupConfigurationInterfaceId
in interface IGroupManager
sessionConfig
- user session information.groupTypeId
- the group type identifier.transaction
- the transaction for persistence access.PortalException
LumisXP 12.4.0.200625 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.