Package jmri.jmrix.ipocs
Class IpocsPortController
- java.lang.Object
-
- jmri.jmrix.AbstractPortController
-
- jmri.jmrix.ipocs.IpocsPortController
-
- All Implemented Interfaces:
IpocsClientListener,PortAdapter
public class IpocsPortController extends AbstractPortController implements IpocsClientListener
- Since:
- 4.21.2
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jmri.jmrix.AbstractPortController
AbstractPortController.Option
-
-
Field Summary
-
Fields inherited from class jmri.jmrix.AbstractPortController
allowConnectionRecovery, manufacturerName, opened, option1Name, option2Name, option3Name, option4Name, options, reconnectinterval, reconnectMaxAttempts, reconnectMaxInterval
-
-
Constructor Summary
Constructors Constructor Description IpocsPortController(IpocsSystemConnectionMemo memo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(IpocsClientListener clientListener)voidclientConnected(IpocsClientHandler client)voidclientDisconnected(IpocsClientHandler client)voidconfigure()Configure all of the other jmrix widgets needed to work with this adapter.voidconnect()Open the connection.java.lang.StringgetCurrentPortName()java.io.DataInputStreamgetInputStream()Get the InputStream from the port.MessagegetLastStatus(java.lang.String userName)java.io.DataOutputStreamgetOutputStream()Get the outputStream to the port.shortgetPort()IpocsSystemConnectionMemogetSystemConnectionMemo()Get theSystemConnectionMemoassociated with this object.voidonMessage(IpocsClientHandler client, Message msg)voidremoveListener(IpocsClientListener clientListener)voidsend(Message msg)voidsetPort(short port)-
Methods inherited from class jmri.jmrix.AbstractPortController
closeConnection, configureOption1, configureOption2, configureOption3, configureOption4, dispose, getDisabled, getManufacturer, getOption1Name, getOption2Name, getOption3Name, getOption4Name, getOptionChoices, getOptionDisplayName, getOptions, getOptionState, getReconnectMaxAttempts, getReconnectMaxInterval, getSystemPrefix, getUserName, isDirty, isOptionAdvanced, isOptionTypePassword, isOptionTypeText, isRestartRequired, purgeStream, reconnect, reconnectFromLoop, recover, resetupConnection, safeSleep, setClosed, setDisabled, setManufacturer, setOpened, setOptionState, setReconnectMaxAttempts, setReconnectMaxInterval, setSystemConnectionMemo, setSystemPrefix, setUserName, status
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jmri.jmrix.ipocs.IpocsClientListener
getUserName
-
-
-
-
Constructor Detail
-
IpocsPortController
public IpocsPortController(IpocsSystemConnectionMemo memo)
-
-
Method Detail
-
getSystemConnectionMemo
public IpocsSystemConnectionMemo getSystemConnectionMemo()
Description copied from class:AbstractPortControllerGet theSystemConnectionMemoassociated with this object.This method should only be overridden to ensure that a specific subclass of SystemConnectionMemo is returned. The recommended pattern is:
public MySystemConnectionMemo getSystemConnectionMemo() { return (MySystemConnectionMemo) super.getSystemConnectionMemo(); }- Specified by:
getSystemConnectionMemoin interfacePortAdapter- Overrides:
getSystemConnectionMemoin classAbstractPortController- Returns:
- the currently associated SystemConnectionMemo
-
configure
public void configure()
Description copied from interface:PortAdapterConfigure all of the other jmrix widgets needed to work with this adapter.- Specified by:
configurein interfacePortAdapter
-
connect
public void connect() throws java.io.IOException
Description copied from interface:PortAdapterOpen the connection.- Specified by:
connectin interfacePortAdapter- Throws:
java.io.IOException- if unable to connect
-
getInputStream
public java.io.DataInputStream getInputStream()
Description copied from class:AbstractPortControllerGet the InputStream from the port.- Specified by:
getInputStreamin interfacePortAdapter- Specified by:
getInputStreamin classAbstractPortController- Returns:
- the InputStream from the port
-
getOutputStream
public java.io.DataOutputStream getOutputStream()
Description copied from class:AbstractPortControllerGet the outputStream to the port.- Specified by:
getOutputStreamin interfacePortAdapter- Specified by:
getOutputStreamin classAbstractPortController- Returns:
- the outputStream to the port
-
getCurrentPortName
public java.lang.String getCurrentPortName()
- Specified by:
getCurrentPortNamein interfacePortAdapter- Specified by:
getCurrentPortNamein classAbstractPortController
-
addListener
public void addListener(IpocsClientListener clientListener)
-
removeListener
public void removeListener(IpocsClientListener clientListener)
-
clientConnected
public void clientConnected(IpocsClientHandler client)
- Specified by:
clientConnectedin interfaceIpocsClientListener
-
clientDisconnected
public void clientDisconnected(IpocsClientHandler client)
- Specified by:
clientDisconnectedin interfaceIpocsClientListener
-
onMessage
public void onMessage(IpocsClientHandler client, Message msg)
- Specified by:
onMessagein interfaceIpocsClientListener
-
getLastStatus
public Message getLastStatus(java.lang.String userName)
-
getPort
public short getPort()
-
setPort
public void setPort(short port)
-
-