public User[] listMembers(String groupname) throws RemoteException, VOMSException {

    log.info("listMembers(" + StringUtils.join(new Object[] {groupname}, ',') + ");");

    if (groupname == null || groupname.equals(""))
      groupname = "/" + VOMSConfiguration.instance().getVOName();

    try {

      List<VOMSUser> members = (List<VOMSUser>) ListMembersOperation.instance(groupname).execute();

      HibernateFactory.commitTransaction();

      return VOMSUser.collectionAsUsers(members);

    } catch (RuntimeException e) {

      ServiceExceptionHelper.handleServiceException(log, e);
      throw e;
    }
  }
  public User[] listUsersWithRole(String groupname, String rolename)
      throws RemoteException, VOMSException {

    log.info(
        "listUsersWithRole(" + StringUtils.join(new Object[] {groupname, rolename}, ',') + ");");
    try {

      if (!PathNamingScheme.isRole(rolename)) rolename = "Role=" + rolename;

      String contextString = groupname + "/" + rolename;

      List members = (List) ListMembersOperation.instance(contextString).execute();

      HibernateFactory.commitTransaction();
      return VOMSUser.collectionAsUsers(members);

    } catch (RuntimeException e) {

      ServiceExceptionHelper.handleServiceException(log, e);
      throw e;
    }
  }