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.

  • Constructor Details

    • WiretapOutputStream

      public WiretapOutputStream(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 IOException
      Overrides:
      enqueue in class DelayOutputStream
      Throws:
      IOException
    • getMainAdress

      public String getMainAdress()
      Specified by:
      getMainAdress in interface de.bsvrz.dav.daf.communication.lowLevel.ConnectionInterface
    • getSubAdressNumber

      public int getSubAdressNumber()
      Specified by:
      getSubAdressNumber in interface de.bsvrz.dav.daf.communication.lowLevel.ConnectionInterface
    • getOutputStream

      public OutputStream getOutputStream()
      Specified by:
      getOutputStream in interface de.bsvrz.dav.daf.communication.lowLevel.ConnectionInterface
    • getInputStream

      public InputStream getInputStream()
      Specified by:
      getInputStream in interface de.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 interface de.bsvrz.dav.daf.communication.lowLevel.ConnectionInterface
      Throws:
      de.bsvrz.dav.daf.main.ConnectionException
    • disconnect

      public void disconnect()
      Specified by:
      disconnect in interface de.bsvrz.dav.daf.communication.lowLevel.ConnectionInterface
    • isConnected

      public boolean isConnected()
      Specified by:
      isConnected in interface de.bsvrz.dav.daf.communication.lowLevel.ConnectionInterface