@Override
    public void getGroupsForUser(List<String> grpMbrshipAttrs, int countLimit) throws WIMException {
        String securityName = null;
        try {
            securityName = getSecurityName(false);
            List<String> returnNames = urBridge.getGroupsForUser(securityName);

            // if countLimit is zero then we should return complete result-set
            countLimit = (countLimit == 0) ? returnNames.size() : countLimit;

            // if countLImit is negative we should not return any result.
            countLimit = (countLimit < 0) ? 0 : countLimit;

            // if countLimt greater than result size then return the complete result.
            countLimit = (returnNames.size() > countLimit) ? countLimit : returnNames.size();

            for (int j = 0; j < countLimit; j++) {
                Root fakeRoot = new Root();
                Group memberDO = new Group();
                fakeRoot.getEntities().add(memberDO);

                IdentifierType identifier = new IdentifierType();
                memberDO.setIdentifier(identifier);

                URBridgeEntityFactory osFactory = new URBridgeEntityFactory();
                URBridgeEntity osEntity = osFactory.createObject(memberDO, urBridge, attrMap, baseEntryName, entityConfigMap);
                osEntity.setSecurityNameProp(returnNames.get(j));
                osEntity.populateEntity(grpMbrshipAttrs);
                osEntity.setRDNPropValue(returnNames.get(j));
                entity.getGroups().add(memberDO);
            }
        } catch (com.ibm.websphere.security.EntryNotFoundException enfe) {
            throw new EntityNotFoundException(WIMMessageKey.ENTITY_NOT_FOUND, Tr.formatMessage(tc, WIMMessageKey.ENTITY_NOT_FOUND,
                                                                                               WIMMessageHelper.generateMsgParms(securityName)));
        } catch (com.ibm.websphere.security.NotImplementedException nie) {
            throw new EntityNotFoundException(WIMMessageKey.ENTITY_NOT_FOUND, Tr.formatMessage(tc, WIMMessageKey.ENTITY_NOT_FOUND,
                                                                                               WIMMessageHelper.generateMsgParms(securityName)));
        } catch (Exception e) {
            throw new WIMApplicationException(WIMMessageKey.ENTITY_GET_FAILED, Tr.formatMessage(tc, WIMMessageKey.ENTITY_GET_FAILED,
                                                                                                WIMMessageHelper.generateMsgParms(securityName, e.toString())));
        }
    }
@ Override public void getGroupsForUser ( List < String > grpMbrshipAttrs , int countLimit ) throws WIMException { String securityName = null ; try { securityName = getSecurityName ( false ) ; List < String > returnNames = urBridge . getGroupsForUser ( securityName ) ; countLimit = ( countLimit == 0 ) ? returnNames . size ( ) : countLimit ; countLimit = ( countLimit < 0 ) ? 0 : countLimit ; countLimit = ( returnNames . size ( ) > countLimit ) ? countLimit : returnNames . size ( ) ; for ( int j = 0 ; j < countLimit ; j ++ ) { Root fakeRoot = new Root ( ) ; Group memberDO = new Group ( ) ; fakeRoot . getEntities ( ) . add ( memberDO ) ; IdentifierType identifier = new IdentifierType ( ) ; memberDO . setIdentifier ( identifier ) ; URBridgeEntityFactory osFactory = new URBridgeEntityFactory ( ) ; URBridgeEntity osEntity = osFactory . createObject ( memberDO , urBridge , attrMap , baseEntryName , entityConfigMap ) ; osEntity . setSecurityNameProp ( returnNames . get ( j ) ) ; osEntity . populateEntity ( grpMbrshipAttrs ) ; osEntity . setRDNPropValue ( returnNames . get ( j ) ) ; entity . getGroups ( ) . add ( memberDO ) ; } } catch ( com . ibm . websphere . security . EntryNotFoundException enfe ) { throw new EntityNotFoundException ( WIMMessageKey . ENTITY_NOT_FOUND , Tr . formatMessage ( tc , WIMMessageKey . ENTITY_NOT_FOUND , WIMMessageHelper . generateMsgParms ( securityName ) ) ) ; } catch ( com . ibm . websphere . security . NotImplementedException nie ) { throw new EntityNotFoundException ( WIMMessageKey . ENTITY_NOT_FOUND , Tr . formatMessage ( tc , WIMMessageKey . ENTITY_NOT_FOUND , WIMMessageHelper . generateMsgParms ( securityName ) ) ) ; } catch ( Exception e ) { throw new WIMApplicationException ( WIMMessageKey . ENTITY_GET_FAILED , Tr . formatMessage ( tc , WIMMessageKey . ENTITY_GET_FAILED , WIMMessageHelper . generateMsgParms ( securityName , e . toString ( ) ) ) ) ; } }
Get the members for the group and add the specified attributes
to each of the members.

@param grpMbrAttrs the attributes to be added to the members.
@WIMException an error occurs in the underlying registry