Class WiretapOutputStream
java.lang.Object
java.io.OutputStream
de.kappich.pat.testumg.util.connections.DelayOutputStream
de.kappich.pat.testumg.util.connections.WiretapOutputStream
- All Implemented Interfaces:
de.bsvrz.dav.daf.communication.lowLevel.ConnectionInterface
,java.io.Closeable
,java.io.Flushable
,java.lang.AutoCloseable
public abstract class WiretapOutputStream extends DelayOutputStream implements de.bsvrz.dav.daf.communication.lowLevel.ConnectionInterface
Abstrakte Implementierung von
ConnectionInterface
, die alle versendeten Telegramme zusätzlich in der abstrakten Methode telegramSend(DataTelegram)
ausgibt.
Mit dieser Klasse kann damit z. B. testweise die komplette Kommunikation zwischen Softwareeinheiten ausgegeben und analysiert werden.
-
Field Summary
Fields inherited from class de.kappich.pat.testumg.util.connections.DelayOutputStream
DISABLE_DELAY
-
Constructor Summary
Constructors Constructor Description WiretapOutputStream(java.io.OutputStream outputStream, long transmissionDelay, double maxFlowRate)
-
Method Summary
Modifier and Type Method Description void
connect(java.lang.String mainAdress, int subAdressNumber)
void
disconnect()
protected void
enqueue(byte[] bytes)
java.io.InputStream
getInputStream()
java.lang.String
getMainAdress()
java.io.OutputStream
getOutputStream()
int
getSubAdressNumber()
boolean
isConnected()
abstract void
telegramSend(de.bsvrz.dav.daf.communication.lowLevel.telegrams.DataTelegram telegram)
Methods inherited from class de.kappich.pat.testumg.util.connections.DelayOutputStream
close, write, write, write
Methods inherited from class java.io.OutputStream
flush, nullOutputStream
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface de.bsvrz.dav.daf.communication.lowLevel.ConnectionInterface
isLoopback
-
Constructor Details
-
WiretapOutputStream
public WiretapOutputStream(java.io.OutputStream outputStream, long transmissionDelay, double maxFlowRate)
-
-
Method Details
-
telegramSend
public abstract void telegramSend(de.bsvrz.dav.daf.communication.lowLevel.telegrams.DataTelegram telegram) -
enqueue
protected void enqueue(byte[] bytes) throws java.io.IOException- Overrides:
enqueue
in classDelayOutputStream
- Throws:
java.io.IOException
-
getMainAdress
public java.lang.String getMainAdress()- Specified by:
getMainAdress
in interfacede.bsvrz.dav.daf.communication.lowLevel.ConnectionInterface
-
getSubAdressNumber
public int getSubAdressNumber()- Specified by:
getSubAdressNumber
in interfacede.bsvrz.dav.daf.communication.lowLevel.ConnectionInterface
-
getOutputStream
public java.io.OutputStream getOutputStream()- Specified by:
getOutputStream
in interfacede.bsvrz.dav.daf.communication.lowLevel.ConnectionInterface
-
getInputStream
public java.io.InputStream getInputStream()- Specified by:
getInputStream
in interfacede.bsvrz.dav.daf.communication.lowLevel.ConnectionInterface
-
connect
public void connect(java.lang.String mainAdress, int subAdressNumber) throws de.bsvrz.dav.daf.main.ConnectionException- Specified by:
connect
in interfacede.bsvrz.dav.daf.communication.lowLevel.ConnectionInterface
- Throws:
de.bsvrz.dav.daf.main.ConnectionException
-
disconnect
public void disconnect()- Specified by:
disconnect
in interfacede.bsvrz.dav.daf.communication.lowLevel.ConnectionInterface
-
isConnected
public boolean isConnected()- Specified by:
isConnected
in interfacede.bsvrz.dav.daf.communication.lowLevel.ConnectionInterface
-