Class LocalDavDavConnection

  • All Implemented Interfaces:
    de.bsvrz.dav.daf.communication.lowLevel.ConnectionInterface

    public class LocalDavDavConnection
    extends java.lang.Object
    implements de.bsvrz.dav.daf.communication.lowLevel.ConnectionInterface
    Erweitert die TCP_IP_Communication-Verbindung um die Möglichkeit, Verbindungen (temporär) zu unterbrechen oder auszubremsen.
    • Constructor Summary

      Constructors 
      Constructor Description
      LocalDavDavConnection()
      Erstellt ein neues LocalDavDavConnection-Objekt mit Standardparametern
      LocalDavDavConnection​(java.lang.String parameters)
      Erstellt ein neues LocalDavDavConnection-Objekt auf Client-Seite
      LocalDavDavConnection​(java.net.Socket socket, java.lang.String parameters)
      Erstellt ein neues LocalDavDavConnection-Objekt auf Server-Seite
    • Method Summary

      Modifier and Type Method Description
      void connect​(java.lang.String mainAddress, int subAddressNumber)  
      static void disableConnection​(java.lang.String davName, int targetPort)
      Kappt die angegebene Verbindung
      void disconnect()  
      static void enableAll()
      Aktiviert alle deaktivierten Verbindungen und setzt diese Klasse zurück (am Ende eines Tests)
      static void enableConnection​(java.lang.String davName, int targetPort)
      Stelle die angegebene Verbindung wieder her
      java.io.InputStream getInputStream()  
      java.lang.String getMainAdress()  
      java.io.OutputStream getOutputStream()  
      int getSubAdressNumber()  
      boolean isConnected()  
      boolean isLoopback()  
      static void setConnectionDelay​(java.lang.String fromDav, int toPort, long transmissionDelay, double maxFlowRate)
      Setzt die Geschwindigkeit einer Verbindung (zum manuellen Ausbremsen)
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • LocalDavDavConnection

        public LocalDavDavConnection​(java.net.Socket socket,
                                     java.lang.String parameters)
        Erstellt ein neues LocalDavDavConnection-Objekt auf Server-Seite
        Parameters:
        socket - Socket (Verbindung zu Client)
        parameters - Parameter
      • LocalDavDavConnection

        public LocalDavDavConnection​(java.lang.String parameters)
        Erstellt ein neues LocalDavDavConnection-Objekt auf Client-Seite
        Parameters:
        parameters - Parameter
      • LocalDavDavConnection

        public LocalDavDavConnection()
        Erstellt ein neues LocalDavDavConnection-Objekt mit Standardparametern
    • Method Detail

      • 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
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • 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 mainAddress,
                            int subAddressNumber)
                     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
      • isLoopback

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

        public static void disableConnection​(java.lang.String davName,
                                             int targetPort)
        Kappt die angegebene Verbindung
        Parameters:
        davName - Datenverteiler-Name
        targetPort - Port
      • enableConnection

        public static void enableConnection​(java.lang.String davName,
                                            int targetPort)
        Stelle die angegebene Verbindung wieder her
        Parameters:
        davName - Datenverteiler-Name
        targetPort - Port
      • setConnectionDelay

        public static void setConnectionDelay​(java.lang.String fromDav,
                                              int toPort,
                                              long transmissionDelay,
                                              double maxFlowRate)
        Setzt die Geschwindigkeit einer Verbindung (zum manuellen Ausbremsen)
        Parameters:
        maxFlowRate - Maximale Datenrate in Bytes/Sekunde (ungefähr)
        transmissionDelay - Zeit in Nanosekunden, die Daten auf jeden Fall für die Strecke vom Sender zum Empfänger benötigen
        fromDav - Von-Datenverteiler
        toPort - Bis-Port
      • enableAll

        public static void enableAll()
        Aktiviert alle deaktivierten Verbindungen und setzt diese Klasse zurück (am Ende eines Tests)