TaskManagerQueryService queryManager = TaskManagerClientFactory.getQueryManager(clientFactory);
TaskManager taskManager = TaskManagerClientFactory.getTaskManager(clientFactory);
DirectoryManagerServiceClient dirClient = new DirectoryManagerServiceClient(clientFactory);
PrincipalSearchFilter psf = new PrincipalSearchFilter();
psf.setUserIdAbsolute(user.getUserName());
List<?> principalList = dirClient.findPrincipals(psf);
Iterator<?> pit = principalList.iterator();
User lcUser = null;
if (pit.hasNext())
lcUser = (User) (pit.next());
Set<Group> groupMemberships = lcUser.getGroupMemberships();