Package de.bsvrz.dav.dav.main
Class AbstractSubscriptionsManager
java.lang.Object
de.bsvrz.dav.dav.main.AbstractSubscriptionsManager
- All Implemented Interfaces:
SubscriptionsManager
- Direct Known Subclasses:
HighLevelSubscriptionsManager
public abstract class AbstractSubscriptionsManager extends java.lang.Object implements SubscriptionsManager
-
Field Summary
Fields Modifier and Type Field Description protected DataIndexCounter<de.bsvrz.dav.daf.communication.lowLevel.telegrams.BaseSubscriptionInfo>
_dataIndexCounter
protected java.util.concurrent.ConcurrentHashMap<de.bsvrz.dav.daf.communication.lowLevel.telegrams.BaseSubscriptionInfo,SubscriptionInfo>
_subscriptions
HashMap mit der Zuordnung einer Anmeldeklasse zu einer BaseSubscriptionInfo. -
Constructor Summary
Constructors Constructor Description AbstractSubscriptionsManager()
-
Method Summary
Modifier and Type Method Description void
addLocalReceiveSubscription(ApplicationCommunicationInterface application, de.bsvrz.dav.daf.communication.lowLevel.telegrams.ReceiveSubscriptionInfo receiveSubscriptionInfo)
Meldet einen lokalen Empfänger oder eine lokale Senke anvoid
addLocalSendSubscription(ApplicationCommunicationInterface application, de.bsvrz.dav.daf.communication.lowLevel.telegrams.SendSubscriptionInfo sendSubscriptionInfo)
Meldet einen lokalen Sender oder eine lokale Quelle anvoid
connectToRemoteDrains(SubscriptionInfo subscriptionInfo, java.util.Set<java.lang.Long> distributorsToUse)
Führt Anmeldungen bei potentiellen Zentraldatenverteilern auf eine Senke durchvoid
connectToRemoteSources(SubscriptionInfo subscriptionInfo, java.util.Set<java.lang.Long> distributorsToUse)
Führt Anmeldungen bei potentiellen Zentraldatenverteilern auf eine Quelle durchstatic java.lang.String
dataIndexToString(long c)
java.util.Collection<? extends Subscription>
getAllSubscriptions(CommunicationInterface communicationInterface)
long
getCurrentDataIndex(de.bsvrz.dav.daf.communication.lowLevel.telegrams.BaseSubscriptionInfo baseSubscriptionInfo)
Gibt den aktuellen (zuletzt generierten) Datenindex für die angegebene Anmeldung zurücklong
getNextDataIndex(de.bsvrz.dav.daf.communication.lowLevel.telegrams.BaseSubscriptionInfo baseSubscriptionInfo)
Gibt den nächsten Datenindex für die angegebene Anmeldung zurück und zählt den Index entsprechend hochlong
getNextDataIndex(SubscriptionInfo subscriptionInfo)
Gibt den nächsten Datenindex für die angegebene Anmeldung zurück und zählt den Index entsprechend hochSubscriptionInfo
getSubscriptionInfo(de.bsvrz.dav.daf.communication.lowLevel.telegrams.BaseSubscriptionInfo baseSubscriptionInfo)
Gibt zu einer baseSubscriptionInfo die zugehörige Anmeldungsinfo zurück.void
handleTransmitterSubscriptionReceipt(TransmitterCommunicationInterface communication, de.bsvrz.dav.daf.communication.lowLevel.telegrams.TransmitterSubscriptionType transmitterSubscriptionType, de.bsvrz.dav.daf.communication.lowLevel.telegrams.BaseSubscriptionInfo baseSubscriptionInfo, ConnectionState connectionState, long mainTransmitterId)
behandelt eine Anmeldungsquittung von einem anderen Datenverteilervoid
handleUserRightsChanged(long userId)
Prüft von allen Anmeldungen die den Benutzer betreffen die Rechte erneutvoid
initializeUser(long userId)
Initialisiert die Zugriffsrechte für den angegebenen BenutzerSubscriptionInfo
openExistingSubscriptionInfo(de.bsvrz.dav.daf.communication.lowLevel.telegrams.BaseSubscriptionInfo baseSubscriptionInfo)
Gibt zu einer baseSubscriptionInfo die zugehörige Anmeldungsinfo zurück.SubscriptionInfo
openSubscriptionInfo(de.bsvrz.dav.daf.communication.lowLevel.telegrams.BaseSubscriptionInfo baseSubscriptionInfo)
Gibt zu einer baseSubscriptionInfo die zugehörige Anmeldungsinfo zurück oder erstellt diese falls sie nicht existiert.void
removeAllSubscriptions(ApplicationCommunicationInterface communication)
Entfernt von einer Verbindung alle Anmeldungen (sinnvoll z.B. bei Terminierung der Verbindung)void
removeAllSubscriptions(TransmitterCommunicationInterface communication)
Entfernt von einer Verbindung alle Anmeldungen (sinnvoll z.B. bei Terminierung der Verbindung)void
removeLocalReceiveSubscriptions(ApplicationCommunicationInterface application, de.bsvrz.dav.daf.communication.lowLevel.telegrams.BaseSubscriptionInfo baseSubscriptionInfo)
Meldet einen lokalen Empfänger oder eine lokale Senke ab.void
removeLocalReceiveSubscriptions(ApplicationCommunicationInterface application, SubscriptionInfo subscriptionInfo)
Meldet einen lokalen Empfänger oder eine lokale Senke ab.void
removeLocalSendSubscription(ApplicationCommunicationInterface application, de.bsvrz.dav.daf.communication.lowLevel.telegrams.BaseSubscriptionInfo baseSubscriptionInfo)
Meldet einen lokalen Sender oder eine lokale Quelle ab.void
removeLocalSendSubscriptions(ApplicationCommunicationInterface application, SubscriptionInfo subscriptionInfo)
Meldet einen lokalen Senker oder eine lokale Quelle ab.void
removeSubscriptionInfo(SubscriptionInfo subscriptionInfo)
Entfernt eine Anmeldeinformation.void
updateDestinationRoute(long transmitterId, TransmitterCommunicationInterface oldConnection, TransmitterCommunicationInterface newConnection)
Wird aufgerufen, wenn es zu einer Dav-id eine bessere Route gibt, sorgt für entsprechende AnmeldeumleitungenMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface de.bsvrz.dav.dav.main.SubscriptionsManager
getBestConnectionToRemoteDav, getPotentialCentralDistributors, getThisTransmitterId, isActionAllowed, isActionAllowed, notifyIsNewCentralDistributor, notifyWasCentralDistributor, objectToString, subscriptionToString
-
Field Details
-
_subscriptions
protected final java.util.concurrent.ConcurrentHashMap<de.bsvrz.dav.daf.communication.lowLevel.telegrams.BaseSubscriptionInfo,SubscriptionInfo> _subscriptionsHashMap mit der Zuordnung einer Anmeldeklasse zu einer BaseSubscriptionInfo. -
_dataIndexCounter
protected final DataIndexCounter<de.bsvrz.dav.daf.communication.lowLevel.telegrams.BaseSubscriptionInfo> _dataIndexCounter
-
-
Constructor Details
-
AbstractSubscriptionsManager
public AbstractSubscriptionsManager()
-
-
Method Details
-
dataIndexToString
public static java.lang.String dataIndexToString(long c) -
openSubscriptionInfo
public SubscriptionInfo openSubscriptionInfo(de.bsvrz.dav.daf.communication.lowLevel.telegrams.BaseSubscriptionInfo baseSubscriptionInfo)Gibt zu einer baseSubscriptionInfo die zugehörige Anmeldungsinfo zurück oder erstellt diese falls sie nicht existiert. Nachdem die Benutzung des Objekts beendet ist, mussSubscriptionInfo.close()
aufgerufen werden, damit eventuelle Aufräumarbeiten erledigt werden können.- Specified by:
openSubscriptionInfo
in interfaceSubscriptionsManager
- Parameters:
baseSubscriptionInfo
- baseSubscriptionInfo- Returns:
- Anmeldungsklasse
-
openExistingSubscriptionInfo
public SubscriptionInfo openExistingSubscriptionInfo(de.bsvrz.dav.daf.communication.lowLevel.telegrams.BaseSubscriptionInfo baseSubscriptionInfo)Gibt zu einer baseSubscriptionInfo die zugehörige Anmeldungsinfo zurück. Nachdem die Benutzung des Objekts beendet ist, muss (sofern Rückgabewert != null)SubscriptionInfo.close()
aufgerufen werden, damit eventuelle Aufräumarbeiten erledigt werden können.- Specified by:
openExistingSubscriptionInfo
in interfaceSubscriptionsManager
- Parameters:
baseSubscriptionInfo
- baseSubscriptionInfo- Returns:
- Anmeldungsklasseoder null falls nicht existent
-
getSubscriptionInfo
public SubscriptionInfo getSubscriptionInfo(de.bsvrz.dav.daf.communication.lowLevel.telegrams.BaseSubscriptionInfo baseSubscriptionInfo)Gibt zu einer baseSubscriptionInfo die zugehörige Anmeldungsinfo zurück.- Specified by:
getSubscriptionInfo
in interfaceSubscriptionsManager
- Parameters:
baseSubscriptionInfo
- baseSubscriptionInfo- Returns:
- Anmeldungsklasse oder null falls zu dieser baseSubscriptionInfo keine Anmeldungsinfo vorliegt
-
addLocalSendSubscription
public void addLocalSendSubscription(ApplicationCommunicationInterface application, de.bsvrz.dav.daf.communication.lowLevel.telegrams.SendSubscriptionInfo sendSubscriptionInfo)Meldet einen lokalen Sender oder eine lokale Quelle an- Parameters:
application
- VerbindungsendSubscriptionInfo
- Anmeldeparameter
-
removeLocalSendSubscription
public void removeLocalSendSubscription(ApplicationCommunicationInterface application, de.bsvrz.dav.daf.communication.lowLevel.telegrams.BaseSubscriptionInfo baseSubscriptionInfo)Meldet einen lokalen Sender oder eine lokale Quelle ab. Gibt eine Warnung aus, falls die angegebene Anmeldung nicht besteht- Parameters:
application
- VerbindungbaseSubscriptionInfo
- Objekt und Attributgruppenverwendung
-
addLocalReceiveSubscription
public void addLocalReceiveSubscription(ApplicationCommunicationInterface application, de.bsvrz.dav.daf.communication.lowLevel.telegrams.ReceiveSubscriptionInfo receiveSubscriptionInfo)Meldet einen lokalen Empfänger oder eine lokale Senke an- Parameters:
application
- VerbindungreceiveSubscriptionInfo
- Anmeldeparameter
-
removeLocalReceiveSubscriptions
public void removeLocalReceiveSubscriptions(ApplicationCommunicationInterface application, de.bsvrz.dav.daf.communication.lowLevel.telegrams.BaseSubscriptionInfo baseSubscriptionInfo)Meldet einen lokalen Empfänger oder eine lokale Senke ab. Gibt eine Warnung aus, falls die angegebene Anmeldung nicht besteht- Parameters:
application
- VerbindungbaseSubscriptionInfo
- Objekt und Attributgruppenverwendung
-
handleUserRightsChanged
public void handleUserRightsChanged(long userId)Prüft von allen Anmeldungen die den Benutzer betreffen die Rechte erneut- Parameters:
userId
- Id des Benutzers
-
removeLocalSendSubscriptions
public void removeLocalSendSubscriptions(ApplicationCommunicationInterface application, SubscriptionInfo subscriptionInfo)Meldet einen lokalen Senker oder eine lokale Quelle ab.- Parameters:
application
- AnwendungsubscriptionInfo
- subscriptionInfo
-
removeLocalReceiveSubscriptions
public void removeLocalReceiveSubscriptions(ApplicationCommunicationInterface application, SubscriptionInfo subscriptionInfo)Meldet einen lokalen Empfänger oder eine lokale Senke ab.- Parameters:
application
- AnwendungsubscriptionInfo
- subscriptionInfo
-
removeAllSubscriptions
Entfernt von einer Verbindung alle Anmeldungen (sinnvoll z.B. bei Terminierung der Verbindung)- Parameters:
communication
- Verbindung
-
removeAllSubscriptions
Entfernt von einer Verbindung alle Anmeldungen (sinnvoll z.B. bei Terminierung der Verbindung)- Parameters:
communication
- Verbindung
-
handleTransmitterSubscriptionReceipt
public void handleTransmitterSubscriptionReceipt(TransmitterCommunicationInterface communication, de.bsvrz.dav.daf.communication.lowLevel.telegrams.TransmitterSubscriptionType transmitterSubscriptionType, de.bsvrz.dav.daf.communication.lowLevel.telegrams.BaseSubscriptionInfo baseSubscriptionInfo, ConnectionState connectionState, long mainTransmitterId)Description copied from interface:SubscriptionsManager
behandelt eine Anmeldungsquittung von einem anderen Datenverteiler- Specified by:
handleTransmitterSubscriptionReceipt
in interfaceSubscriptionsManager
- Parameters:
communication
- Verbindung zum anderen DavtransmitterSubscriptionType
- Art der Anmeldung (Sender/Empfänger)baseSubscriptionInfo
- AnmeldeinformationconnectionState
- Rückmeldung des anderen Datenverteilers (Zuständig, nicht zuständig, etc.)mainTransmitterId
- Zentraldatenverteiler-ID sofern verfügbar
-
updateDestinationRoute
public void updateDestinationRoute(long transmitterId, TransmitterCommunicationInterface oldConnection, TransmitterCommunicationInterface newConnection)Description copied from interface:SubscriptionsManager
Wird aufgerufen, wenn es zu einer Dav-id eine bessere Route gibt, sorgt für entsprechende Anmeldeumleitungen- Specified by:
updateDestinationRoute
in interfaceSubscriptionsManager
- Parameters:
transmitterId
- Dav-IdoldConnection
- Alte VerbindungnewConnection
- Neue bessere Verbindung
-
getNextDataIndex
public long getNextDataIndex(de.bsvrz.dav.daf.communication.lowLevel.telegrams.BaseSubscriptionInfo baseSubscriptionInfo)Description copied from interface:SubscriptionsManager
Gibt den nächsten Datenindex für die angegebene Anmeldung zurück und zählt den Index entsprechend hoch- Specified by:
getNextDataIndex
in interfaceSubscriptionsManager
- Parameters:
baseSubscriptionInfo
- Anmeldung- Returns:
- Datenindex
-
getCurrentDataIndex
public long getCurrentDataIndex(de.bsvrz.dav.daf.communication.lowLevel.telegrams.BaseSubscriptionInfo baseSubscriptionInfo)Description copied from interface:SubscriptionsManager
Gibt den aktuellen (zuletzt generierten) Datenindex für die angegebene Anmeldung zurück- Specified by:
getCurrentDataIndex
in interfaceSubscriptionsManager
- Parameters:
baseSubscriptionInfo
- Anmeldung- Returns:
- Datenindex
-
getNextDataIndex
Gibt den nächsten Datenindex für die angegebene Anmeldung zurück und zählt den Index entsprechend hoch- Parameters:
subscriptionInfo
- Anmeldung- Returns:
- Datenindex
-
removeSubscriptionInfo
Description copied from interface:SubscriptionsManager
Entfernt eine Anmeldeinformation. Es dürfen beim Aufruf dieser Methode keine Anmeldungen mehr bestehen.- Specified by:
removeSubscriptionInfo
in interfaceSubscriptionsManager
- Parameters:
subscriptionInfo
- Anmeldeinformation
-
connectToRemoteDrains
public void connectToRemoteDrains(SubscriptionInfo subscriptionInfo, java.util.Set<java.lang.Long> distributorsToUse)Description copied from interface:SubscriptionsManager
Führt Anmeldungen bei potentiellen Zentraldatenverteilern auf eine Senke durch- Specified by:
connectToRemoteDrains
in interfaceSubscriptionsManager
- Parameters:
subscriptionInfo
- AnmeldeinformationdistributorsToUse
- Liste mit zu berücksichtigenden potentiellen Zentraldatenverteilern
-
connectToRemoteSources
public void connectToRemoteSources(SubscriptionInfo subscriptionInfo, java.util.Set<java.lang.Long> distributorsToUse)Description copied from interface:SubscriptionsManager
Führt Anmeldungen bei potentiellen Zentraldatenverteilern auf eine Quelle durch- Specified by:
connectToRemoteSources
in interfaceSubscriptionsManager
- Parameters:
subscriptionInfo
- AnmeldeinformationdistributorsToUse
- Liste mit zu berücksichtigenden potentiellen Zentraldatenverteilern
-
getAllSubscriptions
public java.util.Collection<? extends Subscription> getAllSubscriptions(CommunicationInterface communicationInterface) -
initializeUser
public void initializeUser(long userId)Initialisiert die Zugriffsrechte für den angegebenen Benutzer- Parameters:
userId
- Benutzer-ID (muss in der lokalen Konfiguration existieren)
-