jmri.jmrix
Interface NetworkPortAdapter

All Superinterfaces:
PortAdapter
All Known Implementing Classes:
AbstractNetworkPortController, EasyDccNetworkPortController, EcosPortController, JMRIClientPortController, LIUSBServerAdapter, LnNetworkPortController, LnTcpDriverAdapter, NceNetworkPortController, NetworkDriverAdapter, NetworkDriverAdapter, NetworkDriverAdapter, NetworkDriverAdapter, NetworkDriverAdapter, SRCPPortController, XNetNetworkPortController, XnTcpAdapter

public interface NetworkPortAdapter
extends PortAdapter

Enables basic setup of a network interface for a jmrix implementation. Based upon work by Bob Jacobsen from SerialPortAdapter

Author:
Kevin Dickerson Copyright (C) 2010, Bob Jacobsen Copyright (C) 2010
See Also:
NetworkConfigException

Method Summary
 void configure()
          Configure all of the other jmrix widgets needed to work with this adapter
 void configureOption1(String value)
          Set the first port option.
 void configureOption2(String value)
          Set the second port option.
 void connect()
           
 void connect(String host, int port)
          Connects to the end device using a hostname/ip address and port
 String getCurrentOption1Setting()
           
 String getCurrentOption2Setting()
          Get current option 2 value
 String getCurrentPortName()
           
 String getHostName()
           
 int getPort()
           
 String option1Name()
          Get a String that says what Option 1 represents May be an empty string, but will not be null
 String option2Name()
          Get a String that says what Option 2 represents May be an empty string, but will not be null
 void setHostName(String hostname)
           
 void setPort(int s)
           
 void setPort(String s)
          Remember the associated port name
 boolean status()
          Query the status of this connection.
 String[] validOption1()
          Get an array of valid values for "option 1"; used to display valid options.
 String[] validOption2()
          Get an array of valid values for "option 2"; used to display valid options.
 
Methods inherited from interface jmri.jmrix.PortAdapter
dispose, getDisabled, getInputStream, getManufacturer, getOutputStream, getSystemConnectionMemo, setDisabled, setManufacturer
 

Method Detail

connect

void connect(String host,
             int port)
             throws Exception
Connects to the end device using a hostname/ip address and port

Throws:
Exception

connect

void connect()
             throws Exception
Throws:
Exception

configure

void configure()
Configure all of the other jmrix widgets needed to work with this adapter

Specified by:
configure in interface PortAdapter

status

boolean status()
Query the status of this connection. If all OK, at least as far as is known, return true

Specified by:
status in interface PortAdapter

setPort

void setPort(String s)
Remember the associated port name

Parameters:
s -

setPort

void setPort(int s)

getPort

int getPort()

getCurrentPortName

String getCurrentPortName()
Specified by:
getCurrentPortName in interface PortAdapter

setHostName

void setHostName(String hostname)

getHostName

String getHostName()

validOption1

String[] validOption1()
Get an array of valid values for "option 1"; used to display valid options. May not be null, but may have zero entries

Specified by:
validOption1 in interface PortAdapter

option1Name

String option1Name()
Get a String that says what Option 1 represents May be an empty string, but will not be null

Specified by:
option1Name in interface PortAdapter

configureOption1

void configureOption1(String value)
Set the first port option. Only to be used after construction, but before the openPort call

Specified by:
configureOption1 in interface PortAdapter

getCurrentOption1Setting

String getCurrentOption1Setting()
Specified by:
getCurrentOption1Setting in interface PortAdapter

validOption2

String[] validOption2()
Get an array of valid values for "option 2"; used to display valid options. May not be null, but may have zero entries

Specified by:
validOption2 in interface PortAdapter

option2Name

String option2Name()
Get a String that says what Option 2 represents May be an empty string, but will not be null

Specified by:
option2Name in interface PortAdapter

configureOption2

void configureOption2(String value)
Set the second port option. Only to be used after construction, but before the openPort call

Specified by:
configureOption2 in interface PortAdapter

getCurrentOption2Setting

String getCurrentOption2Setting()
Get current option 2 value

Specified by:
getCurrentOption2Setting in interface PortAdapter


Copyright © 1997 - 2011 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads