private void saveUsers(PrintStream ps) {
    Set s = _userCache.getUsers(0);
    Iterator it = s.iterator();
    while (it.hasNext()) {
      String uid = (String) it.next();
      Map m = null;
      try {
        m = _userCache.getUser(uid);
      } catch (UserServiceException e) {
        _log.warn("Unable to get user data", e);
      }
      if (m != null) {
        ps.println("  <user>");
        printField(ps, m, UserEntries.FIELD_UID);
        printField(ps, m, UserEntries.FIELD_PASSWORD);
        printField(ps, m, UserEntries.FIELD_ENABLE_TIME);
        printField(ps, m, UserEntries.FIELD_CERT_OK);
        printField(ps, m, UserEntries.FIELD_AUTH);
        printField(ps, m, UserEntries.FIELD_FNAME);
        printField(ps, m, UserEntries.FIELD_LNAME);
        printField(ps, m, UserEntries.FIELD_NAME);
        printField(ps, m, UserEntries.FIELD_MAIL);
        printField(ps, m, UserEntries.FIELD_ROLE_LIST);

        ps.println("  </user>");
      }
    }
  }
 private void saveRoles(PrintStream ps) {
   Set s = null;
   try {
     s = _userCache.getRoles(0);
   } catch (UserServiceException e) {
     _log.warn("Unable to get roles", e);
   }
   if (s != null) {
     Iterator it = s.iterator();
     while (it.hasNext()) {
       Map m = null;
       try {
         m = _userCache.getRole((String) it.next());
       } catch (UserServiceException e) {
         _log.warn("Unable to get role ID", e);
       }
       if (m != null) {
         ps.println("  <role>");
         printField(ps, m, UserEntries.FIELD_RID);
         printField(ps, m, UserEntries.FIELD_DESCRIPTION);
         ps.println("  </role>");
       }
     }
   }
 }