jmri.jmrix
Class AbstractNetworkPortController

Show UML class diagram
java.lang.Object
  extended by jmri.jmrix.AbstractPortController
      extended by jmri.jmrix.AbstractNetworkPortController
All Implemented Interfaces:
NetworkPortAdapter, PortAdapter
Direct Known Subclasses:
EasyDccNetworkPortController, EcosPortController, SRCPPortController

public abstract class AbstractNetworkPortController
extends AbstractPortController
implements NetworkPortAdapter

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

See Also:
NetworkConfigException

Constructor Summary
AbstractNetworkPortController()
           
 
Method Summary
 void connect()
           
 void connect(String host, int port)
          Connects to the end device using a hostname/ip address and port
 void dispose()
           
 String getCurrentPortName()
           
 String getHostName()
           
 DataInputStream getInputStream()
           
 DataOutputStream getOutputStream()
           
 int getPort()
           
 SystemConnectionMemo getSystemConnectionMemo()
           
 void setHostName(String s)
          Remember the associated host name
 void setPort(int p)
          Remeber the associated port number
 void setPort(String p)
          Remember the associated port name
 boolean status()
          Query the status of this connection.
 
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.NetworkPortAdapter
configure, configureOption1, configureOption2, getCurrentOption1Setting, getCurrentOption2Setting, option1Name, option2Name, validOption1, validOption2
 
Methods inherited from interface jmri.jmrix.PortAdapter
getManufacturer, setManufacturer
 

Constructor Detail

AbstractNetworkPortController

public AbstractNetworkPortController()
Method Detail

connect

public void connect(String host,
                    int port)
             throws Exception
Description copied from interface: NetworkPortAdapter
Connects to the end device using a hostname/ip address and port

Specified by:
connect in interface NetworkPortAdapter
Throws:
Exception

connect

public void connect()
             throws Exception
Specified by:
connect in interface NetworkPortAdapter
Throws:
Exception

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

setHostName

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

Specified by:
setHostName in interface NetworkPortAdapter
Parameters:
s -

getHostName

public String getHostName()
Specified by:
getHostName in interface NetworkPortAdapter

setPort

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

Specified by:
setPort in interface NetworkPortAdapter
Parameters:
p -

getPort

public int getPort()
Specified by:
getPort in interface NetworkPortAdapter

getCurrentPortName

public String getCurrentPortName()
Specified by:
getCurrentPortName in interface NetworkPortAdapter
Specified by:
getCurrentPortName in interface PortAdapter
Specified by:
getCurrentPortName in class AbstractPortController

setPort

public void setPort(String p)
Description copied from interface: NetworkPortAdapter
Remember the associated port name

Specified by:
setPort in interface NetworkPortAdapter

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

getSystemConnectionMemo

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

dispose

public void dispose()
Specified by:
dispose in interface PortAdapter


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