Class 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.

    • Constructor Summary

      Constructors 
      Constructor Description
      WiretapOutputStream​(java.io.OutputStream outputStream, long transmissionDelay, double maxFlowRate)  
    • Constructor Detail

      • WiretapOutputStream

        public WiretapOutputStream​(java.io.OutputStream outputStream,
                                   long transmissionDelay,
                                   double maxFlowRate)
    • Method Detail

      • 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 class DelayOutputStream
        Throws:
        java.io.IOException
      • getMainAdress

        public java.lang.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 java.io.OutputStream getOutputStream()
        Specified by:
        getOutputStream in interface de.bsvrz.dav.daf.communication.lowLevel.ConnectionInterface
      • getInputStream

        public java.io.InputStream getInputStream()
        Specified by:
        getInputStream in interface de.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 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