コード例 #1
0
  protected void doCallbackGroupsOperation(String userId, List<String> groupIds) {

    if (userId != null) {

      if (groupIds != null && groupIds.size() > 0) {

        List<String> userGroups = userGroupCallback.getGroupsForUser(userId, groupIds, null);
        for (String groupId : groupIds) {

          if (userGroupCallback.existsGroup(groupId)
              && userGroups != null
              && userGroups.contains(groupId)) {
            addGroupFromCallbackOperation(groupId);
          }
        }
      } else {
        if (!(userGroupsMap.containsKey(userId) && userGroupsMap.get(userId).booleanValue())) {
          List<String> userGroups = userGroupCallback.getGroupsForUser(userId, null, null);
          if (userGroups != null && userGroups.size() > 0) {
            for (String group : userGroups) {
              addGroupFromCallbackOperation(group);
            }
            userGroupsMap.put(userId, true);
          }
        }
      }
    } else {
      if (groupIds != null) {
        for (String groupId : groupIds) {
          addGroupFromCallbackOperation(groupId);
        }
      }
    }
  }
コード例 #2
0
  protected boolean doCallbackUserOperation(String userId) {

    if (userId != null && userGroupCallback.existsUser(userId)) {
      addUserFromCallbackOperation(userId);
      return true;
    }
    return false;
  }
コード例 #3
0
  protected boolean doCallbackGroupOperation(String groupId) {

    if (groupId != null && userGroupCallback.existsGroup(groupId)) {
      addGroupFromCallbackOperation(groupId);
      return true;
    }
    return false;
  }
コード例 #4
0
  protected List<String> doUserGroupCallbackOperation(String userId, List<String> groupIds) {

    doCallbackUserOperation(userId);
    doCallbackGroupsOperation(userId, groupIds);
    List<String> allGroupIds = null;

    return userGroupCallback.getGroupsForUser(userId, groupIds, allGroupIds);
  }