jmri.jmrix
Class AbstractNetworkPortAdapter

Show UML class diagram
java.lang.Object
  extended by jmri.jmrix.AbstractPortController
      extended by jmri.jmrix.AbstractSerialPortController
          extended by jmri.jmrix.AbstractNetworkPortAdapter
All Implemented Interfaces:
PortAdapter, SerialPortAdapter

public abstract class AbstractNetworkPortAdapter
extends AbstractSerialPortController

Enables basic setup of a network client interface for a jmrix implementation.

See Also:
NetworkConfigException

Constructor Summary
AbstractNetworkPortAdapter()
           
 
Method Summary
 void dispose()
           
 String getHostName()
           
 DataInputStream getInputStream()
           
 DataOutputStream getOutputStream()
           
 int getPort()
           
 SystemConnectionMemo getSystemConnectionMemo()
           
 String openPort(String ipAddress, int port, String appName)
          Open an IP port.
 String openPort(String portName, String appName)
          Open a specified port.
 void setHostName(String s)
          Remember the associated host name
 void setPort(int p)
          Remeber the associated port number
 boolean status()
          Query the status of this connection.
 String[] validBaudRates()
          Get an array of valid baud rates.
 
Methods inherited from class jmri.jmrix.AbstractSerialPortController
configureBaudRate, currentBaudNumber, getCurrentBaudRate, getCurrentPortName, getPortNames, handlePortBusy, handlePortNotFound, setPort, validBaudNumber
 
Methods inherited from class jmri.jmrix.AbstractPortController
configureOption1, configureOption2, getCurrentOption1Setting, getCurrentOption2Setting, getManufacturer, option1Name, option2Name, setManufacturer, validOption1, validOption2
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jmri.jmrix.SerialPortAdapter
configure, configureOption1, configureOption2, getCurrentOption1Setting, getCurrentOption2Setting, getManufacturer, option1Name, option2Name, setManufacturer, validOption1, validOption2
 

Constructor Detail

AbstractNetworkPortAdapter

public AbstractNetworkPortAdapter()
Method Detail

openPort

public String openPort(String portName,
                       String appName)
Open a specified port. The appname argument is to be provided to the underlying OS during startup so that it can show on status displays, etc


openPort

public String openPort(String ipAddress,
                       int port,
                       String appName)
Open an IP port. The appname argument is to be provided to the underlying OS during startup so that it can show on status displays, etc


status

public 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
Specified by:
status in interface SerialPortAdapter
Overrides:
status in class AbstractPortController

setHostName

public void setHostName(String s)
Remember the associated host name

Parameters:
s -

getHostName

public String getHostName()

setPort

public void setPort(int p)
Remeber the associated port number

Parameters:
p -

getPort

public int getPort()

getInputStream

public DataInputStream getInputStream()
Specified by:
getInputStream in interface PortAdapter
Specified by:
getInputStream in class AbstractPortController

getOutputStream

public DataOutputStream getOutputStream()
Specified by:
getOutputStream in interface PortAdapter
Specified by:
getOutputStream in class AbstractPortController

validBaudRates

public String[] validBaudRates()
Get an array of valid baud rates. This is currently just a message saying its fixed


getSystemConnectionMemo

public SystemConnectionMemo getSystemConnectionMemo()
Specified by:
getSystemConnectionMemo in interface PortAdapter
Overrides:
getSystemConnectionMemo in class AbstractSerialPortController

dispose

public void dispose()
Specified by:
dispose in interface PortAdapter
Overrides:
dispose in class AbstractSerialPortController


Copyright © 1997 - 2010 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