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
,Closeable
,Flushable
,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
ConstructorsConstructorDescriptionWiretapOutputStream
(OutputStream outputStream, long transmissionDelay, double maxFlowRate) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
protected void
enqueue
(byte[] bytes) int
boolean
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
-
-
Method Details
-
telegramSend
public abstract void telegramSend(de.bsvrz.dav.daf.communication.lowLevel.telegrams.DataTelegram telegram) -
enqueue
- Overrides:
enqueue
in classDelayOutputStream
- Throws:
IOException
-
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
- Specified by:
getOutputStream
in interfacede.bsvrz.dav.daf.communication.lowLevel.ConnectionInterface
-
getInputStream
- Specified by:
getInputStream
in interfacede.bsvrz.dav.daf.communication.lowLevel.ConnectionInterface
-
connect
public void connect(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
-