// bergmark - ITX project - Spring 1999

// This standalone ITX Directory Service application writes extensions
// and names of all items in the database to a vector of UserProperty

import cnrg.itx.ds.*;      // for Directory Service
import java.util.*;        // for vector

public class Dump {
   public static void main (String[] args) {
      Dump me = new Dump();
   }
   public Dump() {
      try {
         DirectoryService sig = new DirectoryService ();
	 sig.declareIdentity (new UserID("guest"), new Password("guest"));
         Vector x = sig.dumpAllUsers();
	 System.out.println ("Get a list of " + 
	    x.size() + " entries");
	 for (int i=0; i<x.size(); i++) {
	    UserProperty p = (UserProperty)x.elementAt(i);
	    System.out.println(Integer.toString(p.getExtension()) + "\t" +
	       p.getUserID());
	 }
      } catch (Exception e) {
         System.out.println("Couldn't get authenticated");
      }
   }
}
