public void deleteRole(String rolename) throws RemoteException, VOMSException {

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

    try {
      if (PathNamingScheme.isRole(rolename)) rolename = PathNamingScheme.getRoleName(rolename);

      DeleteRoleOperation.instance(rolename).execute();
      HibernateFactory.commitTransaction();

    } catch (RuntimeException e) {

      ServiceExceptionHelper.handleServiceException(log, e);
      throw e;
    }
  }
  public void assignRole(String groupname, String rolename, String username, String userca)
      throws RemoteException, VOMSException {

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

    if (PathNamingScheme.isRole(rolename)) rolename = PathNamingScheme.getRoleName(rolename);

    try {

      AssignRoleOperation.instance(groupname, rolename, username, userca).execute();

      HibernateFactory.commitTransaction();

    } catch (RuntimeException e) {

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

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

    try {

      String[] parentChain = PathNamingScheme.getParentGroupChain(groupname);
      String[] result = new String[parentChain.length + 1];

      result[0] = groupname;
      System.arraycopy(parentChain, 0, result, 1, parentChain.length);

      return result;

    } 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;
    }
  }