JDUN Documentation

Examples

The following is a demonstration of how to create a program with JDUN

Example1.java

This example demonstrates much of the JDUN functionality including enumerating entries, deleting entries, renaming entries, dialing an entry, and hanging up an entry. To run the example, double click the included runExample1.bat file. Classes and source code are included in the example directory. Below are some excerpts from the source code.

Create a new DialUpManager instance

try {
      // instantiate the DialUpManager class
      dum = new DialUpManager(dnot);
}
catch (LibraryLoadFailedException e) {
      if (e instanceof JDUNLibraryLoadFailedException)
        System.out.println("JDUN Library failed to load");
      else if (e instanceof RASLibraryLoadFailedException)
        System.out.println("RAS Library failed to load");
      System.exit(0);
}

Retrieve all entry names

String[] names = dum.getEntryNames();

Dial an entry with default username and password

dum.dialEntryAsynchronous(entryName);

Hang up an entry

dum.hangUpEntry(entryName);