|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.jmrix.AbstractPortController
jmri.jmrix.AbstractNetworkPortController
public abstract class AbstractNetworkPortController
Enables basic setup of a network client interface for a jmrix implementation.
NetworkConfigException| Nested Class Summary | |
|---|---|
(package private) class |
AbstractNetworkPortController.reconnectwait
|
| Nested classes/interfaces inherited from class jmri.jmrix.AbstractPortController |
|---|
AbstractPortController.Option |
| Field Summary | |
|---|---|
protected static org.slf4j.Logger |
log
|
protected String |
m_HostName
|
protected int |
m_port
|
protected Socket |
socketConn
|
| Fields inherited from class jmri.jmrix.AbstractPortController |
|---|
allowConnectionRecovery, mDisabled, mManufacturer, opened, option1Name, option2Name, option3Name, option4Name, options, reconnectinterval, retryAttempts |
| Constructor Summary | |
|---|---|
AbstractNetworkPortController()
|
|
| Method Summary | |
|---|---|
void |
connect()
Open the connection |
void |
connect(String host,
int port)
Connects to the end device using a hostname/ip address and port |
void |
dispose()
|
String |
getCurrentPortName()
Returns the connection name for the network connection in the format of ip_address:port |
String |
getHostName()
|
DataInputStream |
getInputStream()
|
DataOutputStream |
getOutputStream()
|
int |
getPort()
|
SystemConnectionMemo |
getSystemConnectionMemo()
|
void |
reconnect()
Attempts to reconnect to a failed Server |
void |
recover()
This is called when a connection is initially lost. |
protected void |
resetupConnection()
Customizable method to deal with resetting a system connection after a sucessful recovery of a connection. |
void |
setDisabled(boolean disabled)
Sets whether the connection is disabled |
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, configureOption3, configureOption4, getDisabled, getManufacturer, getOption1Name, getOption2Name, getOption3Name, getOption4Name, getOptionChoices, getOptionDisplayName, getOptions, getOptionState, isOptionAdvanced, safeSleep, setClosed, setManufacturer, setOpened, setOptionState |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface jmri.jmrix.NetworkPortAdapter |
|---|
configure |
| Methods inherited from interface jmri.jmrix.PortAdapter |
|---|
configureOption1, configureOption2, configureOption3, configureOption4, getDisabled, getManufacturer, getOption1Name, getOption2Name, getOption3Name, getOption4Name, getOptionChoices, getOptionDisplayName, getOptions, getOptionState, isOptionAdvanced, setManufacturer, setOptionState |
| Field Detail |
|---|
protected String m_HostName
protected int m_port
protected Socket socketConn
protected static final org.slf4j.Logger log
| Constructor Detail |
|---|
public AbstractNetworkPortController()
| Method Detail |
|---|
public void connect(String host,
int port)
throws Exception
NetworkPortAdapter
connect in interface NetworkPortAdapterException
public void connect()
throws Exception
PortAdapter
connect in interface PortAdapterExceptionpublic boolean status()
status in interface NetworkPortAdapterstatus in interface PortAdapterstatus in class AbstractPortControllerpublic void setHostName(String s)
setHostName in interface NetworkPortAdapters - public String getHostName()
getHostName in interface NetworkPortAdapterpublic void setPort(int p)
setPort in interface NetworkPortAdapterp - public void setPort(String p)
NetworkPortAdapter
setPort in interface NetworkPortAdapterpublic int getPort()
getPort in interface NetworkPortAdapterpublic String getCurrentPortName()
getCurrentPortName in interface NetworkPortAdaptergetCurrentPortName in interface PortAdaptergetCurrentPortName in class AbstractPortControllerpublic DataInputStream getInputStream()
getInputStream in interface PortAdaptergetInputStream in class AbstractPortControllerpublic DataOutputStream getOutputStream()
getOutputStream in interface PortAdaptergetOutputStream in class AbstractPortControllerpublic SystemConnectionMemo getSystemConnectionMemo()
getSystemConnectionMemo in interface PortAdaptergetSystemConnectionMemo in class AbstractPortControllerpublic void setDisabled(boolean disabled)
PortAdapter
setDisabled in interface PortAdaptersetDisabled in class AbstractPortControllerpublic void dispose()
dispose in interface PortAdapterpublic void recover()
recover in interface PortAdapterrecover in class AbstractPortControllerpublic void reconnect()
protected void resetupConnection()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||