com.jpackages.jdun
Class DialUpEntryProperties

java.lang.Object
  extended by com.jpackages.jdun.DialUpEntryProperties

public class DialUpEntryProperties
extends java.lang.Object

This class defines the properties for a dial-up entry.

Example 1 (editing properties):

 // dialUpManager is an instance of DialUpManager
 DialUpEntryProperties props = dialUpManager.getDialUpEntryProperties("My Connection");
 // set the area code and phone number and set it to use the area code
 props.setAreaCode("504");
 props.setUseCountryAndAreaCodes(true);
 props.setLocalPhoneNumber("5551234");
 // specify a script file for the entry. scriptFile is a String path for the file
 props.setScriptFilePath(scriptFile);
 // update the entry's properties
 dialUpManager.setDialUpEntryProperties("My Connection", props);
 

Example 2 (creating dial-up entry):

 // dialUpManager is an instance of DialUpManager
 DialUpDevice modem = dialUpManager.getDialUpDeviceModem();
 dialUpManager.createEntry("My Connection", new DialUpEntryProperties("5551234", modem));
 

Example 3 (creating VPN entry - only works in Windows 2000/XP/Vista):

 // dialUpManager is an instance of DialUpManager
 DialUpDevice vpn = dialUpManager.getDialUpDevice("vpn");
 DialUpEntryProperties props = new DialUpEntryProperties();
 props.setDialUpDevice(vpn);
 props.setEntryType(DialUpEntryProperties.ENTRY_TYPE_VPN);
 dialUpManager.createEntry("My VPN Connection", props);
 

Copyright (c) 2001-2007

Author:
JPackages.com

Field Summary
static int ENTRY_TYPE_BROADBAND
          Indicates a Broadband (PPPoE) entry type.
static int ENTRY_TYPE_DIRECT
          Indicates a direct (serial or parallel) entry type.
static int ENTRY_TYPE_PHONE
          Indicates a phone line (modem, ISDN) entry type.
static int ENTRY_TYPE_VPN
          Indicates a Virtual Private Network (VPN) entry type.
static int FRAMING_PROTOCOL_PPP
          Indicates a Point-to-Point Protocol (PPP)
static int FRAMING_PROTOCOL_SLIP
          Indicates a Serial Line Internet Protocol (SLIP)
 
Constructor Summary
DialUpEntryProperties()
          Construct DialUpEntryProperties with all default values and no specified phone number.
DialUpEntryProperties(java.lang.String local_phone_number, DialUpDevice dialUpDevice)
          Construct DialUpEntryProperties with all default values and the specified phone number and DialUpDevice.
 
Method Summary
 java.lang.String getAreaCode()
          Retrieves the area code to use when dialing.
 int getCountryID()
          Retrieves the TAPI country identifier.
 DialUpDevice getDialUpDevice()
          Retrieves the DialUpDevice used.
 boolean getDisableLCPExtensions()
          Retrieves if PPP LCP extensions are to be disabled.
 boolean getDisplayTerminalWindowAfterDial()
          Retrieves if a terminal window is to be displayed after dialing.
 boolean getDisplayTerminalWindowBeforeDial()
          Retrieves if a terminal window is to be displayed before dialing.
 int getEntryType()
          Retrieves the entry type.
 long getFlags2()
           
 int getFramingProtocol()
          Retrieves the framing protocol used.
 java.lang.String getIPAddress()
          Retrieves the IP address.
 java.lang.String getIPAddressForDNS()
          Retrieves the IP address for Primary DNS.
 java.lang.String getIPAddressForSecondaryDNS()
          Retrieves the IP address for Secondary DNS.
 java.lang.String getIPAddressForSecondaryWINS()
          Retrieves the IP address for Secondary WINS.
 java.lang.String getIPAddressForWINS()
          Retrieves the IP address for Primary WINS.
 java.lang.String getLocalPhoneNumber()
          Retrieves the telephone number to use when dialing.
 boolean getLogOnToNetwork()
          Retrieves if this entry is to log on to the network.
 boolean getRequireDataEncryption()
          Retrieves if data encryption is required.
 boolean getRequireEncryptedPassword()
          Retrieves if encrypted passwords are required.
 boolean getRequireMicrosoftEncryptedPassword()
          Retrieves if Microsoft encrypted passwords are required.
 java.lang.String getScriptFilePath()
          Retrieves the script file path used.
 boolean getUseClientForMicrosoftNetworks()
           
 boolean getUseCountryAndAreaCodes()
           Retrieves if the country and area codes are to be used.
 boolean getUseDefaultGatewayOnRemoteNetwork()
          Retrieves if default gateway on remote network is to be used.
 boolean getUseIPHeaderCompression()
          Retrieves if IP header compression is to be used.
 boolean getUseProtocolIPX()
          Retrieves if the IPX protocol is to be used.
 boolean getUseProtocolNetBEUI()
          Retrieves if the NetBEUI protocol is to be used.
 boolean getUseProtocolTCPIP()
          Retrieves if the TCP/IP protocol is to be used.
 boolean getUseSoftwareCompression()
          Retrieve if software compression is to be used.
 boolean getUseSpecificIPAddress()
          Retrieves if a specific IP address is to be used.
 boolean getUseSpecificNameServers()
          Retrieves if specific name servers are to be used.
 void setAreaCode(java.lang.String area_code)
          Specifies the area code to use when dialing.
 void setCountryID(int id)
          Specifies the TAPI country identifier.
 void setDialUpDevice(DialUpDevice dialUpDevice)
          Specifies the DialUpDevice to use.
 void setDisableLCPExtensions(boolean b)
          Disables the PPP LCP extensions.
 void setDisplayTerminalWindowAfterDial(boolean b)
          Display a terminal window after dialing.
 void setDisplayTerminalWindowBeforeDial(boolean b)
          Display a terminal window before dialing.
 void setEntryType(int type)
          Sets the entry type.
 void setFramingProtocol(int framing_protocol)
          Specifies the framing protocol to be used.
 void setIPAddress(java.lang.String ipAddress)
          Specifies the IP address to use.
 void setIPAddressForDNS(java.lang.String ipAddress)
          Specifies the IP address to use as Primary DNS.
 void setIPAddressForSecondaryDNS(java.lang.String ipAddress)
          Specifies the IP address to use as Secondary DNS.
 void setIPAddressForSecondaryWINS(java.lang.String ipAddress)
          Specifies the IP address to use as Secondary WINS.
 void setIPAddressForWINS(java.lang.String ipAddress)
          Specifies the IP address to use as Primary WINS.
 void setLocalPhoneNumber(java.lang.String local_phone_number)
          Specifies a telephone number to use when dialing.
 void setLogOnToNetwork(boolean b)
          Log on to the network
 void setRequireDataEncryption(boolean b)
          Requires data encryption.
 void setRequireEncryptedPassword(boolean b)
          Require encrypted password.
 void setRequireMicrosoftEncryptedPassword(boolean b)
          Require Microsoft encrypted passord.
 void setScriptFilePath(java.lang.String script_file_path)
          Specifies the script file path to use.
 void setUseClientForMicrosoftNetworks(boolean b)
           
 void setUseCountryAndAreaCodes(boolean b)
          Use the area code and country ID when dialing.
 void setUseDefaultGatewayOnRemoteNetwork(boolean b)
          Use default gateway on remote network.
 void setUseIPHeaderCompression(boolean b)
          Use IP header comression.
 void setUseProtocolIPX(boolean b)
          Use the IPX protocol.
 void setUseProtocolNetBEUI(boolean b)
          Use the NetBEUI protocol.
 void setUseProtocolTCPIP(boolean b)
          Use the TCP/IP protocol.
 void setUseSoftwareCompression(boolean b)
          Use software compression.
 void setUseSpecificIPAddress(boolean b)
          Use a specific IP address.
 void setUseSpecificNameServers(boolean b)
          Use specific name servers.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FRAMING_PROTOCOL_PPP

public static final int FRAMING_PROTOCOL_PPP
Indicates a Point-to-Point Protocol (PPP)

See Also:
Constant Field Values

FRAMING_PROTOCOL_SLIP

public static final int FRAMING_PROTOCOL_SLIP
Indicates a Serial Line Internet Protocol (SLIP)

See Also:
Constant Field Values

ENTRY_TYPE_PHONE

public static final int ENTRY_TYPE_PHONE
Indicates a phone line (modem, ISDN) entry type.

See Also:
Constant Field Values

ENTRY_TYPE_VPN

public static final int ENTRY_TYPE_VPN
Indicates a Virtual Private Network (VPN) entry type.

See Also:
Constant Field Values

ENTRY_TYPE_DIRECT

public static final int ENTRY_TYPE_DIRECT
Indicates a direct (serial or parallel) entry type.

See Also:
Constant Field Values

ENTRY_TYPE_BROADBAND

public static final int ENTRY_TYPE_BROADBAND
Indicates a Broadband (PPPoE) entry type.

See Also:
Constant Field Values
Constructor Detail

DialUpEntryProperties

public DialUpEntryProperties()

Construct DialUpEntryProperties with all default values and no specified phone number.


DialUpEntryProperties

public DialUpEntryProperties(java.lang.String local_phone_number,
                             DialUpDevice dialUpDevice)

Construct DialUpEntryProperties with all default values and the specified phone number and DialUpDevice.

Parameters:
local_phone_number - The telephone number.
dialUpDevice - The dial-up device.
Method Detail

getEntryType

public int getEntryType()

Retrieves the entry type.

Entry types only work in Windows 2000/XP. ENTRY_TYPE_BROADBAND only works in Windows XP.

Returns:
The entry type.

setEntryType

public void setEntryType(int type)

Sets the entry type.

Entry types include DialUpEntryProperties.ENTRY_TYPE_PHONE, DialUpEntryProperties.ENTRY_TYPE_VPN, DialUpEntryProperties.ENTRY_TYPE_DIRECT, and DialUpEntryProperties.ENTRY_TYPE_BROADBAND.

Entry types only work in Windows 2000/XP. ENTRY_TYPE_BROADBAND only works in Windows XP.

Parameters:
type - The entry type to specify.

getFlags2

public long getFlags2()

setUseClientForMicrosoftNetworks

public void setUseClientForMicrosoftNetworks(boolean b)

getUseClientForMicrosoftNetworks

public boolean getUseClientForMicrosoftNetworks()

setUseCountryAndAreaCodes

public void setUseCountryAndAreaCodes(boolean b)

Use the area code and country ID when dialing.

Parameters:
b - true to use, false otherwise.

getUseCountryAndAreaCodes

public boolean getUseCountryAndAreaCodes()

Retrieves if the country and area codes are to be used.

Returns:
true if used, false otherwise.

setUseSpecificIPAddress

public void setUseSpecificIPAddress(boolean b)

Use a specific IP address.

Parameters:
b - true to use, false otherwise.

getUseSpecificIPAddress

public boolean getUseSpecificIPAddress()

Retrieves if a specific IP address is to be used.

Returns:
true if used, false otherwise.

setUseSpecificNameServers

public void setUseSpecificNameServers(boolean b)

Use specific name servers.

Parameters:
b - true to use, false otherwise.

getUseSpecificNameServers

public boolean getUseSpecificNameServers()

Retrieves if specific name servers are to be used.

Returns:
true if used, false otherwise.

setUseIPHeaderCompression

public void setUseIPHeaderCompression(boolean b)

Use IP header comression.

Parameters:
b - true to use, false otherwise.

getUseIPHeaderCompression

public boolean getUseIPHeaderCompression()

Retrieves if IP header compression is to be used.

Returns:
true if used, false otherwise.

setUseDefaultGatewayOnRemoteNetwork

public void setUseDefaultGatewayOnRemoteNetwork(boolean b)

Use default gateway on remote network.

Parameters:
b - true to use, false otherwise.

getUseDefaultGatewayOnRemoteNetwork

public boolean getUseDefaultGatewayOnRemoteNetwork()

Retrieves if default gateway on remote network is to be used.

Returns:
true if used, false otherwise.

setDisableLCPExtensions

public void setDisableLCPExtensions(boolean b)

Disables the PPP LCP extensions.

Parameters:
b - true to disable, false otherwise.

getDisableLCPExtensions

public boolean getDisableLCPExtensions()

Retrieves if PPP LCP extensions are to be disabled.

Returns:
true if disabled, false otherwise.

setDisplayTerminalWindowBeforeDial

public void setDisplayTerminalWindowBeforeDial(boolean b)

Display a terminal window before dialing.

NOTE: terminal windows are not displayed when dialing with JDUN.

This has no effect in Windows XP.

Parameters:
b - true to display, false otherwise.

getDisplayTerminalWindowBeforeDial

public boolean getDisplayTerminalWindowBeforeDial()

Retrieves if a terminal window is to be displayed before dialing.

Returns:
true if displayed, false otherwise.

setDisplayTerminalWindowAfterDial

public void setDisplayTerminalWindowAfterDial(boolean b)

Display a terminal window after dialing.

NOTE: terminal windows are not displayed when dialing with JDUN.

Parameters:
b - true to display, false otherwise.

getDisplayTerminalWindowAfterDial

public boolean getDisplayTerminalWindowAfterDial()

Retrieves if a terminal window is to be displayed after dialing.

Returns:
true if displayed, false otherwise.

setUseSoftwareCompression

public void setUseSoftwareCompression(boolean b)

Use software compression.

Parameters:
b - true to use, false otherwise.

getUseSoftwareCompression

public boolean getUseSoftwareCompression()

Retrieve if software compression is to be used.

Returns:
true if used, false otherwise.

setRequireEncryptedPassword

public void setRequireEncryptedPassword(boolean b)

Require encrypted password.

Parameters:
b - true to use, false otherwise.

getRequireEncryptedPassword

public boolean getRequireEncryptedPassword()

Retrieves if encrypted passwords are required.

Returns:
true if used, false otherwise.

setRequireMicrosoftEncryptedPassword

public void setRequireMicrosoftEncryptedPassword(boolean b)

Require Microsoft encrypted passord.

Parameters:
b - true to use, false otherwise.

getRequireMicrosoftEncryptedPassword

public boolean getRequireMicrosoftEncryptedPassword()

Retrieves if Microsoft encrypted passwords are required.

Returns:
true if used, false otherwise.

setRequireDataEncryption

public void setRequireDataEncryption(boolean b)

Requires data encryption.

Parameters:
b - true to use, false otherwise.

getRequireDataEncryption

public boolean getRequireDataEncryption()

Retrieves if data encryption is required.

This is ignored unless setRequireMicrosoftEncryptedPassword is set to true.

Returns:
true if used, false otherwise.

setLogOnToNetwork

public void setLogOnToNetwork(boolean b)

Log on to the network

This has no effect in Windows NT/2000/XP.

Parameters:
b - true to use, false otherwise.

getLogOnToNetwork

public boolean getLogOnToNetwork()

Retrieves if this entry is to log on to the network.

Returns:
true if used, false otherwise.

setCountryID

public void setCountryID(int id)

Specifies the TAPI country identifier.

Default is 1 (United States)

Parameters:
id - The country ID.

getCountryID

public int getCountryID()

Retrieves the TAPI country identifier.

Returns:
The country ID.

setAreaCode

public void setAreaCode(java.lang.String area_code)

Specifies the area code to use when dialing.

Do not include parantheses or other delimiters in the area code String. For example, "206" is valid but "(206)" is not.

Parameters:
area_code - The area code.

getAreaCode

public java.lang.String getAreaCode()

Retrieves the area code to use when dialing.

Returns:
The area code.

setLocalPhoneNumber

public void setLocalPhoneNumber(java.lang.String local_phone_number)

Specifies a telephone number to use when dialing.

Parameters:
local_phone_number - The telephone number.

getLocalPhoneNumber

public java.lang.String getLocalPhoneNumber()

Retrieves the telephone number to use when dialing.

Returns:
The telephone number.

setIPAddress

public void setIPAddress(java.lang.String ipAddress)

Specifies the IP address to use.

Format of the String should be "aaa.bbb.ccc.ddd". Invalid formatting may result in errors.

Parameters:
ipAddress - The IP address.

getIPAddress

public java.lang.String getIPAddress()

Retrieves the IP address.

Returns:
The IP address.

setIPAddressForDNS

public void setIPAddressForDNS(java.lang.String ipAddress)

Specifies the IP address to use as Primary DNS.

Format of the String should be "aaa.bbb.ccc.ddd". Invalid formatting may result in errors.

Parameters:
ipAddress - The IP address.

getIPAddressForDNS

public java.lang.String getIPAddressForDNS()

Retrieves the IP address for Primary DNS.

Returns:
The IP address.

setIPAddressForSecondaryDNS

public void setIPAddressForSecondaryDNS(java.lang.String ipAddress)

Specifies the IP address to use as Secondary DNS.

Format of the String should be "aaa.bbb.ccc.ddd". Invalid formatting may result in errors.

Parameters:
ipAddress - The IP address.

getIPAddressForSecondaryDNS

public java.lang.String getIPAddressForSecondaryDNS()

Retrieves the IP address for Secondary DNS.

Returns:
The IP address.

setIPAddressForWINS

public void setIPAddressForWINS(java.lang.String ipAddress)

Specifies the IP address to use as Primary WINS.

Format of the String should be "aaa.bbb.ccc.ddd". Invalid formatting may result in errors.

Parameters:
ipAddress - The IP address.

getIPAddressForWINS

public java.lang.String getIPAddressForWINS()

Retrieves the IP address for Primary WINS.

Returns:
The IP address.

setIPAddressForSecondaryWINS

public void setIPAddressForSecondaryWINS(java.lang.String ipAddress)

Specifies the IP address to use as Secondary WINS.

Format of the String should be "aaa.bbb.ccc.ddd". Invalid formatting may result in errors.

Parameters:
ipAddress - The IP address.

getIPAddressForSecondaryWINS

public java.lang.String getIPAddressForSecondaryWINS()

Retrieves the IP address for Secondary WINS.

Returns:
The IP address.

setUseProtocolNetBEUI

public void setUseProtocolNetBEUI(boolean b)

Use the NetBEUI protocol.

This is ignored in Windows XP.

Parameters:
b - true to use, false otherwise.

getUseProtocolNetBEUI

public boolean getUseProtocolNetBEUI()

Retrieves if the NetBEUI protocol is to be used.

Returns:
true if used, false otherwise.

setUseProtocolIPX

public void setUseProtocolIPX(boolean b)

Use the IPX protocol.

Parameters:
b - true to use, false otherwise.

getUseProtocolIPX

public boolean getUseProtocolIPX()

Retrieves if the IPX protocol is to be used.

Returns:
true if used, false otherwise.

setUseProtocolTCPIP

public void setUseProtocolTCPIP(boolean b)

Use the TCP/IP protocol.

Parameters:
b - true to use, false otherwise.

getUseProtocolTCPIP

public boolean getUseProtocolTCPIP()

Retrieves if the TCP/IP protocol is to be used.

Returns:
true if used, false otherwise.

setFramingProtocol

public void setFramingProtocol(int framing_protocol)

Specifies the framing protocol to be used.

Valid framing protocols are FRAMING_PROTOCOL_PPP and FRAMING_PROTOCOL_SLIP. FRAMING_PROTOCOL_PPP is the default.

Parameters:
framing_protocol - The framing protocol.

getFramingProtocol

public int getFramingProtocol()

Retrieves the framing protocol used.

Returns:
The framing protocol.

setScriptFilePath

public void setScriptFilePath(java.lang.String script_file_path)

Specifies the script file path to use.

Use null or "" to specify no script.

NOTE for Windows NT4: Requires latest service pack update for this method to work.

Parameters:
script_file_path - The script file path to use.

getScriptFilePath

public java.lang.String getScriptFilePath()

Retrieves the script file path used.

Returns:
The script file path.

setDialUpDevice

public void setDialUpDevice(DialUpDevice dialUpDevice)

Specifies the DialUpDevice to use.

Parameters:
dialUpDevice - The dial-up device.
See Also:
DialUpManager.getDialUpDevices

getDialUpDevice

public DialUpDevice getDialUpDevice()

Retrieves the DialUpDevice used.

Returns:
The dial-up device.