public class SenderSubscribtion extends Object implements de.bsvrz.dav.daf.main.ClientSenderInterface
Klasse zum Versenden von Daten.
Die Methode sendData(ResultData)
dient dem
Versenden von Datensätzen. In dieser Methode erfolgt auch die
Sendeanmeldung.
Es wird erst versucht sich als Quelle anzumelden. Ist die nicht erfolgreich (andere Quelle oder Senke vorhanden), wird versucht sich als Sender anzumelden.
Kann der Datensatz nicht versendet werden, wird eine Exception geworfen.
Mit der Methode unsubscribeSender()
kann die Sendeanmeldung
zurückgenommen werden.
Wird die sendData(ResultData)
danach
aufgerufen wird die Sendeanmeldung wiederhergestellt.
Es wird eine Timeout-Zeit auf eine positive Sendesteuerung gewartet. Ist diese Zeit überschritten, ist wahrscheinlich weder Senke noch Empfänger vorhanden.
Modifier and Type | Class and Description |
---|---|
(package private) static class |
SenderSubscribtion.State |
Modifier and Type | Field and Description |
---|---|
private de.bsvrz.sys.funclib.dataIdentificationSettings.DataIdentification |
_DataIdentification |
private de.bsvrz.dav.daf.main.ClientDavInterface |
_DavConn |
protected boolean |
_IgnoreStopSending
Ist _IgnoreStopSending==true, dann wird auch die TimeoutZeit auf eine
positive Sendesteuerung gewartet, wenn ein STOP_SENDING ausgelöst
wurde.
|
private boolean |
_IsSendingAllowed |
private boolean |
_IsTimeOut |
private long |
_LastUse |
private SenderSubscribtion.State |
_State |
private int |
_TimeOut
Zeit in msec, die gewartet wird, dass das Senden erlaubt wird.
|
private static de.bsvrz.sys.funclib.debug.Debug |
LOGGER |
Constructor and Description |
---|
SenderSubscribtion(de.bsvrz.dav.daf.main.ClientDavInterface davConn,
de.bsvrz.sys.funclib.dataIdentificationSettings.DataIdentification dataIdentification)
erzeugt eine SenderSubscribtion.
|
SenderSubscribtion(de.bsvrz.dav.daf.main.ClientDavInterface davConn,
de.bsvrz.sys.funclib.dataIdentificationSettings.DataIdentification dataIdentification,
int timeout,
boolean ignoreStopSending)
erzeugt eine SenderSubscribtion.
|
SenderSubscribtion(de.bsvrz.dav.daf.main.ClientDavInterface davConn,
de.bsvrz.dav.daf.main.config.SystemObject so,
de.bsvrz.dav.daf.main.DataDescription dataDescription)
erzeugt eine SenderSubscribtion.
|
SenderSubscribtion(de.bsvrz.dav.daf.main.ClientDavInterface davConn,
de.bsvrz.dav.daf.main.config.SystemObject so,
de.bsvrz.dav.daf.main.DataDescription dataDescription,
int timeOut,
boolean ignoreStopSending)
erzeugt eine SenderSubscribtion.
|
Modifier and Type | Method and Description |
---|---|
void |
dataRequest(de.bsvrz.dav.daf.main.config.SystemObject object,
de.bsvrz.dav.daf.main.DataDescription dataDescription,
byte state) |
long |
getLastUse()
gibt den Zeitpunkt zurück, zum dem der letzte Datensatz gesendet bzw
das Object erzeugt wurde.
|
boolean |
isRequestSupported(de.bsvrz.dav.daf.main.config.SystemObject object,
de.bsvrz.dav.daf.main.DataDescription dataDescription)
gibt true zurück, um zu signalisieren, dass die Sendesteuerung
unterstützt wird.
|
void |
sendData(de.bsvrz.dav.daf.main.ResultData rs)
versendet den Datensatz.
|
void |
setTimeOut(int timeOut)
Setzt die Zeitspanne, die auf eine positive Sendesteuerung gewartet wird
bevor davon ausgegangen wird, dass es weder Empfänger noch Senke gibt.
|
private void |
subscribe() |
private void |
subscribeSender() |
private void |
subscribeSource() |
String |
toString()
gibt eine Stringrepräsentation zurück, die die
DataIdentification und den Status enthält.
|
void |
unsubscribeSender()
meldet sich als Sender für die DataIdentification ab.
|
private void |
waitForSendePermission() |
private static final de.bsvrz.sys.funclib.debug.Debug LOGGER
private boolean _IsTimeOut
private boolean _IsSendingAllowed
private SenderSubscribtion.State _State
private final de.bsvrz.dav.daf.main.ClientDavInterface _DavConn
private final de.bsvrz.sys.funclib.dataIdentificationSettings.DataIdentification _DataIdentification
private long _LastUse
protected boolean _IgnoreStopSending
private int _TimeOut
public SenderSubscribtion(de.bsvrz.dav.daf.main.ClientDavInterface davConn, de.bsvrz.dav.daf.main.config.SystemObject so, de.bsvrz.dav.daf.main.DataDescription dataDescription)
davConn
- ClientDavInterfaceso
- SystemObjectdataDescription
- DataDescriptionpublic SenderSubscribtion(de.bsvrz.dav.daf.main.ClientDavInterface davConn, de.bsvrz.dav.daf.main.config.SystemObject so, de.bsvrz.dav.daf.main.DataDescription dataDescription, int timeOut, boolean ignoreStopSending)
davConn
- ClientDavInterfaceso
- SystemObjectdataDescription
- DataDescriptiontimeOut
- Zeit in msec, die auf positive Sendesteuerung gewartet wirdpublic SenderSubscribtion(de.bsvrz.dav.daf.main.ClientDavInterface davConn, de.bsvrz.sys.funclib.dataIdentificationSettings.DataIdentification dataIdentification)
davConn
- ClientDavInterfacedataIdentification
- DataIdentificationpublic SenderSubscribtion(de.bsvrz.dav.daf.main.ClientDavInterface davConn, de.bsvrz.sys.funclib.dataIdentificationSettings.DataIdentification dataIdentification, int timeout, boolean ignoreStopSending)
davConn
- ClientDavInterfacedataIdentification
- DataIdentificationtimeout
- Zeit in msec, die auf positive Sendesteuerung gewartet wirdignoreStopSending
- booleanpublic void dataRequest(de.bsvrz.dav.daf.main.config.SystemObject object, de.bsvrz.dav.daf.main.DataDescription dataDescription, byte state)
dataRequest
in interface de.bsvrz.dav.daf.main.ClientSenderInterface
public boolean isRequestSupported(de.bsvrz.dav.daf.main.config.SystemObject object, de.bsvrz.dav.daf.main.DataDescription dataDescription)
isRequestSupported
in interface de.bsvrz.dav.daf.main.ClientSenderInterface
object
- SystemObjectdataDescription
- DataDescriptionpublic void sendData(de.bsvrz.dav.daf.main.ResultData rs) throws de.bsvrz.dav.daf.main.SendSubscriptionNotConfirmed, de.bsvrz.dav.daf.main.OneSubscriptionPerSendData
Ist die zugrunde liegende DataIdentification nicht zum Senden angemeldet, erfolgt hier die Anmeldung
rs
- zu versendender Datensatzde.bsvrz.dav.daf.main.SendSubscriptionNotConfirmed
- wird geworfen, wenn innerhalb der TimeoutZeit keine positive
Sendesteuerung vom Datenverteiler für die zu versendenden
Daten vorliegt oder kein Empfänger vorhanden ist.de.bsvrz.dav.daf.main.OneSubscriptionPerSendData
- wird geworfen, wenn bereits eine lokale Sendeanmeldung für
die gleichen Daten von einem anderen Anwendungsobjekt
vorliegt.private void waitForSendePermission()
public void setTimeOut(int timeOut)
timeOut
- intprivate void subscribe() throws de.bsvrz.dav.daf.main.OneSubscriptionPerSendData, de.bsvrz.dav.daf.main.SendSubscriptionNotConfirmed
de.bsvrz.dav.daf.main.OneSubscriptionPerSendData
de.bsvrz.dav.daf.main.SendSubscriptionNotConfirmed
private void subscribeSource()
private void subscribeSender() throws de.bsvrz.dav.daf.main.OneSubscriptionPerSendData
de.bsvrz.dav.daf.main.OneSubscriptionPerSendData
public void unsubscribeSender()
public String toString()
public long getLastUse()
Copyright © 2017 BitCtrl Systems GmbH. All rights reserved.