jdialup
Class JDial

java.lang.Object
  extended by jdialup.JDial

public class JDial
extends java.lang.Object

Provides Windows operating system RAS Networking. There is a jdialup.dll file that must be activated within your system. There are several ways to do it:


Constructor Summary
JDial(JDNotification dn)
          Creates JDial object with specified feedback class
 
Method Summary
 int createModemEntry(java.lang.String entry, java.lang.String modem, java.lang.String user, java.lang.String password, java.lang.String phone)
          Creates modem entry
 boolean deleteEntry(java.lang.String entry)
          Deletes the specified entry
 void dialAsyncProcess(java.lang.String entry)
          Asynchronous dialing of the specified entry in a seperate thread
 boolean entryExists(java.lang.String entry)
          Checks for availibility of the specified entry
 boolean entryIsActive(java.lang.String entry)
          Checks for active connection of the specified entry
 boolean entryIsDialing(java.lang.String entry)
          Checks for dialing state of the specified entry
 java.lang.String[] getActiveConns()
          Looks for entries with established connections
 java.lang.String[] getDialingConns()
          Looks for entries in dialing state
 int getDialTimeOut()
          Returns dialing timeout value in ms
 java.lang.String[] getEntries()
          Looks for all entries
static java.lang.String getErrorMessage(int error_code)
          Returns error string according to error_code parameter
 int getHangUpTimeOut()
          Returns hangup timeout value in ms
 java.lang.String[] getModemDeviceNames()
          Looks for all modem device names
 boolean hangUp(java.lang.String entry)
          Hanging up the specified entry
static void loadNativeLibrary()
          Loads native library
 boolean renameEntry(java.lang.String oldEntry, java.lang.String newEntry)
          Renames entry
 void setDialTimeOut(int dto)
          Sets dialing timeout value in ms.
 void setHangUpTimeOut(int hto)
          Sets hangup timeout value in ms.
 boolean showCreateEntryDialog()
          Activates native entry creation dialog
 void showEditEntryDialog(java.lang.String entry)
          Activates native entry edit dialog for the specified entry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDial

public JDial(JDNotification dn)
      throws JDException
Creates JDial object with specified feedback class

Parameters:
dn - feedback class object, may be null if no feedback
Throws:
JDException
Method Detail

entryExists

public boolean entryExists(java.lang.String entry)
Checks for availibility of the specified entry

Parameters:
entry - entry name

entryIsActive

public boolean entryIsActive(java.lang.String entry)
Checks for active connection of the specified entry

Parameters:
entry - entry name

entryIsDialing

public boolean entryIsDialing(java.lang.String entry)
Checks for dialing state of the specified entry

Parameters:
entry - entry name

dialAsyncProcess

public void dialAsyncProcess(java.lang.String entry)
Asynchronous dialing of the specified entry in a seperate thread

Parameters:
entry - entry name

hangUp

public boolean hangUp(java.lang.String entry)
Hanging up the specified entry

Parameters:
entry - entry name

createModemEntry

public int createModemEntry(java.lang.String entry,
                            java.lang.String modem,
                            java.lang.String user,
                            java.lang.String password,
                            java.lang.String phone)
Creates modem entry

Parameters:
entry - entry name
modem - entry modem name
user - entry login name
password - entry password
phone - entry phone number
Returns:
an integer indicating the creation operation; 0 - success; -1 - invalid entry name; -2 - phonebook errors; -3 - if native library wasn't loaded prperly;

showCreateEntryDialog

public boolean showCreateEntryDialog()
Activates native entry creation dialog

Returns:
a boolean reply; true - success; false - error;

showEditEntryDialog

public void showEditEntryDialog(java.lang.String entry)
Activates native entry edit dialog for the specified entry


renameEntry

public boolean renameEntry(java.lang.String oldEntry,
                           java.lang.String newEntry)
Renames entry

Parameters:
oldEntry - old entry name
newEntry - new entry name
Returns:
a boolean reply; true - success; false - error;

deleteEntry

public boolean deleteEntry(java.lang.String entry)
Deletes the specified entry

Returns:
a boolean reply; true - success; false - error;

getActiveConns

public java.lang.String[] getActiveConns()
Looks for entries with established connections

Returns:
a string array containg entry names of active connections; empty array if there are no active connections; null - if native library wasn't loaded properly;

getDialingConns

public java.lang.String[] getDialingConns()
Looks for entries in dialing state

Returns:
a string array containg entry names in dialing state; empty array if there are no entries in dialing state; null - if native library wasn't loaded properly;

getEntries

public java.lang.String[] getEntries()
Looks for all entries

Returns:
a string array containg all entry names; empty array if there are no available entries; null - if native library wasn't loaded properly;

getModemDeviceNames

public java.lang.String[] getModemDeviceNames()
Looks for all modem device names

Returns:
a string array containg all modem device names; empty array if there are no available modems; null - if native library wasn't loaded properly;

getDialTimeOut

public int getDialTimeOut()
Returns dialing timeout value in ms


setDialTimeOut

public void setDialTimeOut(int dto)
Sets dialing timeout value in ms. Dialing timeout is set to 120000 ms (2 min) by default


getHangUpTimeOut

public int getHangUpTimeOut()
Returns hangup timeout value in ms


setHangUpTimeOut

public void setHangUpTimeOut(int hto)
Sets hangup timeout value in ms. Hangup timeout is set to 10000 ms (10 sec) by default


loadNativeLibrary

public static void loadNativeLibrary()
Loads native library


getErrorMessage

public static java.lang.String getErrorMessage(int error_code)
Returns error string according to error_code parameter