Package de.bsvrz.pua.prot.processing
Class BasicFlowControl
- java.lang.Object
-
- de.bsvrz.pua.prot.processing.BasicFlowControl
-
- All Implemented Interfaces:
ProcessingInterface
- Direct Known Subclasses:
Processing
,ProtocolReader
public abstract class BasicFlowControl extends java.lang.Object implements ProcessingInterface
Basisklasse für Protokolldaten-sendende Klassen, die eine Flusskontrolle unterstützen. Bei jedem erfolgreich versendeten Datensatz mussdatasetSend()
aufgerufen werden um den Zähler der gesendeten Daten hochzuzählen.flowControl()
kann immer aufgerufen werden bevor ein Datensätze versendet werden würde um den Versand ggf. auszubremsen.
-
-
Constructor Summary
Constructors Constructor Description BasicFlowControl(long maxDelay, int timeout, long initialFlowControl)
Erzeut eine neue Instanz
-
Method Summary
Modifier and Type Method Description void
datasetSend()
protected void
flowControl()
Flußkontrolle.void
flowControl(long numData)
Clientseitige automatische flusskontrolle.protected abstract java.lang.Object
getClient()
abstract long
getJobId()
Gibt die Auftrags-Id zurückint
getTimeout()
void
pauseProcessing()
Versand von Protokolldatensätzen anhalten.void
resumeProcessing()
Versand von Protokolldatensätzen fortsetzen.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.bsvrz.pua.prot.processing.ProcessingInterface
abort, getJobState, getProtocolId, getStatus, process, stopProtocolTransmission
-
-
-
-
Constructor Detail
-
BasicFlowControl
public BasicFlowControl(long maxDelay, int timeout, long initialFlowControl)
Erzeut eine neue Instanz- Parameters:
maxDelay
- Maximale wartezeit bei manueller Flusskontrolle in mstimeout
- Anzahl Minuten ohne Antwort vom Client, nach der die Übertragung getrennt wirdinitialFlowControl
- Anzahl initial zu sendende Datensätze bis zu automatische Flusskontrolle den Versand bremst
-
-
Method Detail
-
pauseProcessing
public void pauseProcessing()
Description copied from interface:ProcessingInterface
Versand von Protokolldatensätzen anhalten.- Specified by:
pauseProcessing
in interfaceProcessingInterface
- See Also:
ProcessingInterface.pauseProcessing()
-
resumeProcessing
public void resumeProcessing()
Description copied from interface:ProcessingInterface
Versand von Protokolldatensätzen fortsetzen.- Specified by:
resumeProcessing
in interfaceProcessingInterface
- See Also:
ProcessingInterface.resumeProcessing()
-
flowControl
protected void flowControl() throws java.lang.InterruptedException
Flußkontrolle. Ggf. wird wird gewartet bis das Senden fortgesetzt werden kann.- Throws:
java.lang.InterruptedException
- Warten wurde unterbrochen.
-
getClient
protected abstract java.lang.Object getClient()
-
getJobId
public abstract long getJobId()
Description copied from interface:ProcessingInterface
Gibt die Auftrags-Id zurück- Specified by:
getJobId
in interfaceProcessingInterface
- Returns:
- Id des Auftrags
-
flowControl
public void flowControl(long numData)
Description copied from interface:ProcessingInterface
Clientseitige automatische flusskontrolle. Der Client gibt vor, bis zu welchem Datensatz PuA Datensätze mit voller Geschwindigkeit senden soll. danach wird der Versand stark ausgebremst (nicht völlig gestoppt, da PuA sonst evtl. nicht merkt, ob der Client noch erreichbar ist)- Specified by:
flowControl
in interfaceProcessingInterface
- Parameters:
numData
- Bis zu welcher Datensatznummer (einfach durchnummeriert) Daten gesendet werden sollen.
-
datasetSend
public void datasetSend()
-
getTimeout
public int getTimeout()
-
-