Blue Mind
Release 1.0

net.bluemind.core.client.group
Class GroupClient

java.lang.Object
  extended by net.bluemind.core.client.impl.AbstractClientImpl
      extended by net.bluemind.core.client.group.GroupClient
All Implemented Interfaces:
IGroup, ISyncClient

public class GroupClient
extends AbstractClientImpl
implements IGroup


Field Summary
 
Fields inherited from class net.bluemind.core.client.impl.AbstractClientImpl
logger
 
Constructor Summary
GroupClient(java.lang.String syncServicesUrl)
           
 
Method Summary
 void addGroupsMembers(AccessToken token, Group group, java.util.List<Group> groups)
          Add groups members to a group
 void addMember(AccessToken token, Group group, Group childGroup)
          Add group member to a group
 void addMember(AccessToken token, Group group, User user)
          Add user member to a group
 void addUsersMembers(AccessToken token, Group group, java.util.List<User> users)
          Add users members to a group
 Group create(AccessToken token, Group group)
          Create a new group
 Group createWithMembers(AccessToken token, Group g, java.util.Collection<DirectoryEntry> members)
          Create group and add members
 java.lang.String deleteGroup(AccessToken token, java.lang.Integer id)
          Delete group ID id
 ResultList<Group> find(AccessToken token, GroupQuery gq)
          Find group matching group query gq
 java.util.Set<java.lang.String> getDomainGroupsExtId(AccessToken at, int domainId)
          Get ext ID list of not archived domain groups
 Group getGroupFromId(AccessToken token, java.lang.Integer id)
          Get group from ID ID
 java.util.List<Group> getGroups(AccessToken token, GroupQuery groupQuery)
          Get groups group members
 ResultList<DirectoryEntry> getMembers(AccessToken token, GroupQuery groupQuery)
          Return user & public group members.
 ResultList<User> getUsers(AccessToken token, GroupQuery groupQuery)
          Get users group members
 boolean isMember(AccessToken token, Group group, Group childGroup)
          Check if childGroup is member of group
 boolean isMember(AccessToken token, Group group, User user)
          Check if user is member of group
 AccessToken login(java.lang.String login, java.lang.String password, java.lang.String origin)
           
 void logout(AccessToken at)
           
 void removeGroupsMembers(AccessToken token, Group group, java.util.List<Group> groups)
          Remove groups members from a group
 void removeMember(AccessToken token, Group group, Group childGroup)
          Remove group member from a group
 void removeMember(AccessToken token, Group group, User user)
          Remove user member from a group
 void removeMembers(AccessToken at, int groupId)
          Remove all members from group
 void removeUsersMembers(AccessToken token, Group group, java.util.List<User> users)
          Remove users members from a group
 Group update(AccessToken token, Group group)
          Update group
 void updateMembers(AccessToken at, Group g, java.util.Collection<DirectoryEntry> toAdd, java.util.Collection<DirectoryEntry> toRemove)
          Add & Remove a set of members from a group.
 
Methods inherited from class net.bluemind.core.client.impl.AbstractClientImpl
checkServerError, execute, executeStream, executeVoid, initParams, setToken, sudo, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroupClient

public GroupClient(java.lang.String syncServicesUrl)
Method Detail

create

public Group create(AccessToken token,
                    Group group)
             throws AuthFault,
                    ServerFault
Description copied from interface: IGroup
Create a new group

Specified by:
create in interface IGroup
Parameters:
token - bm-core token
group - group to create
Returns:
created group
Throws:
AuthFault
ServerFault

update

public Group update(AccessToken token,
                    Group group)
             throws AuthFault,
                    ServerFault
Description copied from interface: IGroup
Update group

Specified by:
update in interface IGroup
Parameters:
token - bm-core token
group - updated group
Returns:
updated group
Throws:
AuthFault
ServerFault

deleteGroup

public java.lang.String deleteGroup(AccessToken token,
                                    java.lang.Integer id)
                             throws AuthFault,
                                    ServerFault
Description copied from interface: IGroup
Delete group ID id

Specified by:
deleteGroup in interface IGroup
Parameters:
token - bm-core token
id - group ID to delete
Returns:
String deleted
Throws:
AuthFault
ServerFault

login

public AccessToken login(java.lang.String login,
                         java.lang.String password,
                         java.lang.String origin)
Specified by:
login in interface ISyncClient
Overrides:
login in class AbstractClientImpl

logout

public void logout(AccessToken at)
Specified by:
logout in interface ISyncClient
Overrides:
logout in class AbstractClientImpl

getGroupFromId

public Group getGroupFromId(AccessToken token,
                            java.lang.Integer id)
                     throws AuthFault,
                            ServerFault
Description copied from interface: IGroup
Get group from ID ID

Specified by:
getGroupFromId in interface IGroup
Parameters:
token - bm-core token
id - group ID
Returns:
Group with ID id
Throws:
AuthFault
ServerFault

find

public ResultList<Group> find(AccessToken token,
                              GroupQuery gq)
                       throws AuthFault,
                              ServerFault
Description copied from interface: IGroup
Find group matching group query gq

Specified by:
find in interface IGroup
Parameters:
token - bm-core token
gq - group query
Returns:
list of groups matching query
Throws:
AuthFault
ServerFault

getUsers

public ResultList<User> getUsers(AccessToken token,
                                 GroupQuery groupQuery)
                          throws AuthFault,
                                 ServerFault
Description copied from interface: IGroup
Get users group members

Specified by:
getUsers in interface IGroup
Parameters:
token - bm-core token
groupQuery - group query
Returns:
users members list
Throws:
AuthFault
ServerFault

getGroups

public java.util.List<Group> getGroups(AccessToken token,
                                       GroupQuery groupQuery)
                                throws AuthFault,
                                       ServerFault
Description copied from interface: IGroup
Get groups group members

Specified by:
getGroups in interface IGroup
Parameters:
token - bm-core token
groupQuery - group query
Returns:
groups members list
Throws:
AuthFault
ServerFault

getMembers

public ResultList<DirectoryEntry> getMembers(AccessToken token,
                                             GroupQuery groupQuery)
                                      throws AuthFault,
                                             ServerFault
Description copied from interface: IGroup
Return user & public group members. Pagination is (not yet) supported. ExpandMembers is not supported.

Specified by:
getMembers in interface IGroup
Parameters:
token - bm-core token
groupQuery - group query
Returns:
members list
Throws:
AuthFault
ServerFault

addMember

public void addMember(AccessToken token,
                      Group group,
                      User user)
               throws AuthFault,
                      ServerFault
Description copied from interface: IGroup
Add user member to a group

Specified by:
addMember in interface IGroup
Parameters:
token - bm-core token
group - group to manage
user - user to add as group member
Throws:
AuthFault
ServerFault

addUsersMembers

public void addUsersMembers(AccessToken token,
                            Group group,
                            java.util.List<User> users)
                     throws AuthFault,
                            ServerFault
Description copied from interface: IGroup
Add users members to a group

Specified by:
addUsersMembers in interface IGroup
Parameters:
token - bm-core token
group - group to manage
Throws:
AuthFault
ServerFault

addMember

public void addMember(AccessToken token,
                      Group group,
                      Group childGroup)
               throws AuthFault,
                      ServerFault
Description copied from interface: IGroup
Add group member to a group

Specified by:
addMember in interface IGroup
Parameters:
token - bm-core token
group - group to manage
Throws:
AuthFault
ServerFault

addGroupsMembers

public void addGroupsMembers(AccessToken token,
                             Group group,
                             java.util.List<Group> groups)
                      throws AuthFault,
                             ServerFault
Description copied from interface: IGroup
Add groups members to a group

Specified by:
addGroupsMembers in interface IGroup
Parameters:
token - bm-core token
group - group to manage
groups - groups to add as group members
Throws:
AuthFault
ServerFault

removeMember

public void removeMember(AccessToken token,
                         Group group,
                         User user)
                  throws AuthFault,
                         ServerFault
Description copied from interface: IGroup
Remove user member from a group

Specified by:
removeMember in interface IGroup
Parameters:
token - bm-core token
group - group to manage
user - user to remove from members list
Throws:
AuthFault
ServerFault

removeUsersMembers

public void removeUsersMembers(AccessToken token,
                               Group group,
                               java.util.List<User> users)
                        throws AuthFault,
                               ServerFault
Description copied from interface: IGroup
Remove users members from a group

Specified by:
removeUsersMembers in interface IGroup
Parameters:
token - bm-core token
group - group to manage
Throws:
AuthFault
ServerFault

removeMember

public void removeMember(AccessToken token,
                         Group group,
                         Group childGroup)
                  throws AuthFault,
                         ServerFault
Description copied from interface: IGroup
Remove group member from a group

Specified by:
removeMember in interface IGroup
Parameters:
token - bm-core token
group - group to manage
Throws:
AuthFault
ServerFault

removeGroupsMembers

public void removeGroupsMembers(AccessToken token,
                                Group group,
                                java.util.List<Group> groups)
                         throws AuthFault,
                                ServerFault
Description copied from interface: IGroup
Remove groups members from a group

Specified by:
removeGroupsMembers in interface IGroup
Parameters:
token - bm-core token
group - group to manage
groups - groups to remove from members list
Throws:
AuthFault
ServerFault

isMember

public boolean isMember(AccessToken token,
                        Group group,
                        User user)
                 throws AuthFault,
                        ServerFault
Description copied from interface: IGroup
Check if user is member of group

Specified by:
isMember in interface IGroup
Parameters:
token - bm-core token
group - group to query
user - user to check
Returns:
True if user is member of group, false otherwise
Throws:
AuthFault
ServerFault

isMember

public boolean isMember(AccessToken token,
                        Group group,
                        Group childGroup)
                 throws AuthFault,
                        ServerFault
Description copied from interface: IGroup
Check if childGroup is member of group

Specified by:
isMember in interface IGroup
Parameters:
token - bm-core token
group - group to query
childGroup - group to check
Returns:
True if childGroup is member of group, false otherwise
Throws:
AuthFault
ServerFault

createWithMembers

public Group createWithMembers(AccessToken token,
                               Group g,
                               java.util.Collection<DirectoryEntry> members)
                        throws ServerFault,
                               AuthFault
Description copied from interface: IGroup
Create group and add members

Specified by:
createWithMembers in interface IGroup
Parameters:
token - bm-core token
g - group to create
members - members list
Returns:
created group
Throws:
ServerFault
AuthFault

updateMembers

public void updateMembers(AccessToken at,
                          Group g,
                          java.util.Collection<DirectoryEntry> toAdd,
                          java.util.Collection<DirectoryEntry> toRemove)
                   throws ServerFault,
                          AuthFault
Description copied from interface: IGroup
Add & Remove a set of members from a group. Also updates the group.

Specified by:
updateMembers in interface IGroup
Parameters:
at - bm-core token
g - group to manage
toAdd - members to add from group
toRemove - members to remove from group
Throws:
ServerFault
AuthFault

removeMembers

public void removeMembers(AccessToken at,
                          int groupId)
                   throws AuthFault,
                          ServerFault
Description copied from interface: IGroup
Remove all members from group

Specified by:
removeMembers in interface IGroup
groupId - group ID
Throws:
AuthFault
ServerFault

getDomainGroupsExtId

public java.util.Set<java.lang.String> getDomainGroupsExtId(AccessToken at,
                                                            int domainId)
                                                     throws AuthFault,
                                                            ServerFault
Description copied from interface: IGroup
Get ext ID list of not archived domain groups

Specified by:
getDomainGroupsExtId in interface IGroup
Parameters:
at - bm-core token
domainId - domain ID to get group ext ID list
Returns:
ext ID list of not archived domain groups
Throws:
AuthFault
ServerFault

Blue Mind
Release 1.0