Class LocalDavDavConnection

java.lang.Object
de.kappich.pat.testumg.util.connections.LocalDavDavConnection
All Implemented Interfaces:
de.bsvrz.dav.daf.communication.lowLevel.ConnectionInterface

public class LocalDavDavConnection extends 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 Details

    • LocalDavDavConnection

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

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

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

    • disableConnection

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

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

      public static void setConnectionDelay(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)
    • 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
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getInputStream

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

      public void connect(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