com.jmethod.jdlite
Class JDial

java.lang.Object
  extended by com.jmethod.jdlite.JDial

public class JDial
extends java.lang.Object

Provides Windows operating system RAS Networking. There is jdlite.dll file that must be activated within your system:


Author: jmethod.com, version 7.2


Field Summary
static int BAD_CONNECTION
           
static int ENTRY_IS_ACTIVE
           
static int ENTRY_IS_DIALING
           
static int EST_CONNECTION
           
static int NO_SUCH_ENTRY
           
 
Constructor Summary
JDial()
          Creates JDial object.
 
Method Summary
 int dialAsync(java.lang.String entry)
          Asynchronous dialing of the specified entry.
 int dialAsync(java.lang.String entry, java.lang.String user, java.lang.String password)
          Asynchronous dialing of the specified entry.
 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.
 long getConnectionSpeed(java.lang.String entry)
          Gets speed of connection of the specified entry.
 java.lang.String getDefaultEntry()
          Returns the name of the default entry, empty string if there are no default entries, null if error or not supported.
 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.
 int getHangUpTimeOut()
          Returns hangup timeout value in ms.
 boolean hangUp(java.lang.String entry)
          Hanging up the specified entry
 void setDialTimeOut(int dto)
          Sets dialing timeout value in ms.
 void setHangUpTimeOut(int hto)
          Sets hangup timeout value in ms.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_SUCH_ENTRY

public static final int NO_SUCH_ENTRY
See Also:
Constant Field Values

ENTRY_IS_ACTIVE

public static final int ENTRY_IS_ACTIVE
See Also:
Constant Field Values

ENTRY_IS_DIALING

public static final int ENTRY_IS_DIALING
See Also:
Constant Field Values

BAD_CONNECTION

public static final int BAD_CONNECTION
See Also:
Constant Field Values

EST_CONNECTION

public static final int EST_CONNECTION
See Also:
Constant Field Values
Constructor Detail

JDial

public JDial()
      throws JDException
Creates JDial object.

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

dialAsync

public int dialAsync(java.lang.String entry)
Asynchronous dialing of the specified entry.

Parameters:
entry - entry name
Returns:
EST_CONNECTION - if it resulted in successful connection, ENTRY_IS_ACTIVE - if connection is already established, ENTRY_IS_DIALING - if dialing is still in process, BAD_CONNECTION - if connection didn't succeed, NO_SUCH_ENTRY - if entry doesn't exist

dialAsync

public int dialAsync(java.lang.String entry,
                     java.lang.String user,
                     java.lang.String password)
Asynchronous dialing of the specified entry.

Parameters:
entry - entry name
user - entry login name
password - entry password
Returns:
EST_CONNECTION - if it resulted in successful connection, ENTRY_IS_ACTIVE - if connection is already established, ENTRY_IS_DIALING - if dialing is still in process, BAD_CONNECTION - if connection didn't succeed, NO_SUCH_ENTRY - if entry doesn't exist

hangUp

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

Parameters:
entry - entry name

getDialingConns

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

Returns:
a string array containing 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 containing all entry names; empty array if there are no available entries; 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.


getConnectionSpeed

public long getConnectionSpeed(java.lang.String entry)
Gets speed of connection of the specified entry. This method is supported only for Windows 2000 or later version.

Returns:
speed, in bits per second, of connection of the specified entry. This speed is negotiated at the time the connection is established. If error, or not supported, returns -1;

getDefaultEntry

public java.lang.String getDefaultEntry()
Returns the name of the default entry, empty string if there are no default entries, null if error or not supported. This method is supported only for Windows 2000 or later version.