public final class LowLevelTransmitterConnections extends Object
Modifier and Type | Class and Description |
---|---|
(package private) class |
LowLevelTransmitterConnections.TransmitterConnectionsSubscriber |
(package private) class |
LowLevelTransmitterConnections.TransmitterReconnectionTask |
Modifier and Type | Field and Description |
---|---|
private static Debug |
_debug |
private LowLevelConnectionsManagerInterface |
_lowLevelConnectionsManager |
private long |
_myTransmitterId |
private int |
_reconnectionDelay
Wartezeit in ms, bevor versucht wird, eine abgebrochene Verbindung wiederherzustellen
|
private ServerDavParameters |
_serverDavParameters |
private TransmitterConnectionInfo[] |
_transmitterConnectionInfos
Infos zur Verbindungsherstellung mit anderen Datenverteilern
|
private Map<Long,T_T_HighLevelCommunication> |
_transmitterConnections
Liste der Datenverteilerverbindungen
|
private LowLevelTransmitterConnections.TransmitterConnectionsSubscriber |
_transmitterConnectionsSubscriber
Interne Thread zur Kommunikation
|
private HighLevelTransmitterManager |
_transmitterManager |
private ScheduledExecutorService |
_transmitterReconnectService
Threadpool, der nicht etablierte Verbindungen aufbaut
|
private ServerConnectionInterface |
_transmittersServerConnection
Die Serverkommunikationskomponente der Datenverteiler, die Datenverteilersverbindungen akzeptiert.
|
private Set<T_T_HighLevelCommunication> |
_unsortedTransmitterConnections |
private static short |
DEFAULT_WEIGHT |
Constructor and Description |
---|
LowLevelTransmitterConnections(HighLevelTransmitterManager transmitterManager,
Class<? extends ServerConnectionInterface> communicationProtocolClass,
ServerDavParameters serverDavParameters,
LowLevelConnectionsManagerInterface lowLevelConnectionsManager) |
Modifier and Type | Method and Description |
---|---|
private void |
addConnection(T_T_HighLevelCommunication highLevelCommunication) |
private int |
analyseConnectionInfosAndGetSubadress() |
void |
close(boolean error,
String message) |
private void |
connectToAlternativeTransmitters(TransmitterConnectionInfo transmitterConnectionInfo)
Startet den Ersatzverbindungsaufbau zwischen zwei nicht direkt benachbarten Datenverteilern.
|
private boolean |
connectToMainTransmitter(TransmitterConnectionInfo transmitterConnectionInfo)
Startet den Verbindungsaufbau zwischen zwei direkt benachbarten Datenverteilern.
|
private void |
connectToNeighbours()
Verbindet mit den Nachbardatenverteilern
|
private boolean |
connectToTransmitter(TransmitterInfo t_info,
short weight,
long time,
String userName)
Startet den Verbindungsaufbau zwischen zwei Datenverteilern.
|
private void |
connectToTransmitter(TransmitterInfo t_info,
short weight,
String userName,
String password)
Etabliert Verbindung zwischen zwei Datenverteilern.
|
private LowLevelCommunication |
createLowLevelConnection(ConnectionInterface connection,
boolean connected) |
private T_T_HighLevelCommunication |
createTransmitterHighLevelCommunication(short weight,
String userName,
String password,
ServerConnectionProperties properties) |
private void |
disableReplacementConnection(TransmitterConnectionInfo transmitterConnectionInfo) |
private List<TransmitterConnectionInfo> |
getInvolvedTransmitters(TransmitterInfo t_info)
Erstellt ein Array, das die Informationen über die benachbarten Datenverteiler des übergebenen Datenverteilers enthält.
|
private int |
getListenSubadress() |
TransmitterConnectionInfo |
getRemoteTransmitterConnectionInfo(long connectedTransmitterId)
Bestimmt die Verbindungsinformationen für eine Verbindung vom angegebenen Datenverteiler zu diesem Datenverteiler.
|
(package private) T_T_HighLevelCommunication |
getTransmitterConnection(long transmitterId) |
TransmitterConnectionInfo |
getTransmitterConnectionInfo(long connectedTransmitterId)
Bestimmt die Verbindungsinformationen für eine Verbindung von diesem Datenverteiler zum angegebenen Datenverteiler.
|
Collection<T_T_HighLevelCommunication> |
getTransmitterConnections() |
short |
getWeight(long connectedTransmitterId)
Diese Methode wird von der Protokollsteuerung aufgerufen, um einer Verbindung ein Gewicht zuzuweisen.
|
boolean |
removeTransmitterConnection(T_T_HighLevelCommunication transmitterCommunication) |
private void |
scheduleTransmitterConnect(TransmitterConnectionInfo transmitterConnectionInfo,
int delay,
TimeUnit timeUnit) |
private void |
startTransmitterConnection(ConnectionInterface connection) |
private T_T_HighLevelCommunication |
startTransmitterConnection(TransmitterInfo t_info,
short weight,
String userName,
String password,
int subAddressToConnectTo) |
void |
startTransmitterConnections(Class<? extends ServerConnectionInterface> communicationProtocolClass,
DataModel dataModel)
Startet Transmitter-Anmeldungen.
|
private void |
terminateReplacementConnection(TransmitterInfo transmitterInfo,
boolean automatic) |
void |
updateId(T_T_HighLevelCommunication communication) |
private static final Debug _debug
private static final short DEFAULT_WEIGHT
private int _reconnectionDelay
private ScheduledExecutorService _transmitterReconnectService
private ServerConnectionInterface _transmittersServerConnection
private TransmitterConnectionInfo[] _transmitterConnectionInfos
private final Set<T_T_HighLevelCommunication> _unsortedTransmitterConnections
private final Map<Long,T_T_HighLevelCommunication> _transmitterConnections
private LowLevelTransmitterConnections.TransmitterConnectionsSubscriber _transmitterConnectionsSubscriber
private final HighLevelTransmitterManager _transmitterManager
private final ServerDavParameters _serverDavParameters
private final LowLevelConnectionsManagerInterface _lowLevelConnectionsManager
private final long _myTransmitterId
public LowLevelTransmitterConnections(HighLevelTransmitterManager transmitterManager, Class<? extends ServerConnectionInterface> communicationProtocolClass, ServerDavParameters serverDavParameters, LowLevelConnectionsManagerInterface lowLevelConnectionsManager)
public void startTransmitterConnections(Class<? extends ServerConnectionInterface> communicationProtocolClass, DataModel dataModel) throws InstantiationException, IllegalAccessException, CommunicationError
LowLevelConnectionsManager.LowLevelConnectionsManager(ServerDavParameters)
communicationProtocolClass
- KommunikationsprotokolldataModel
- DatenmodellInstantiationException
- -IllegalAccessException
- -CommunicationError
- -private int getListenSubadress()
private int analyseConnectionInfosAndGetSubadress()
private void connectToNeighbours()
private boolean connectToMainTransmitter(TransmitterConnectionInfo transmitterConnectionInfo)
transmitterConnectionInfo
- Enthält Informationen zu der Verbindungart zwischen zwei Datenverteilern.connectToTransmitter(de.bsvrz.dav.daf.main.impl.config.telegrams.TransmitterInfo, short, long, String)
private void connectToAlternativeTransmitters(TransmitterConnectionInfo transmitterConnectionInfo)
transmitterConnectionInfo
- Enthält Informationen zu der Verbindungart zwischen zwei Datenverteilern.connectToTransmitter(de.bsvrz.dav.daf.main.impl.config.telegrams.TransmitterInfo, short, long, String)
private boolean connectToTransmitter(TransmitterInfo t_info, short weight, long time, String userName)
t_info
- Information zum Datenverteilerweight
- Die Information wird von der Wegverwaltung benutzt, wenn eine Verbindung bewertet wird.time
- Zeitspanne in der versucht werden soll eine Verbindung aufzubauen, in Millisekunden. Maximale Wartezeit eine Sekunde.userName
- Benutzername mit dem die Authentifizierung durchgeführt werden soll.connectToTransmitter(de.bsvrz.dav.daf.main.impl.config.telegrams.TransmitterInfo, short, String, String)
private LowLevelCommunication createLowLevelConnection(ConnectionInterface connection, boolean connected) throws ConnectionException
ConnectionException
private void connectToTransmitter(TransmitterInfo t_info, short weight, String userName, String password) throws ConnectionException, CommunicationError
t_info
- Informationen zum Datenverteiler.weight
- Die Information wird von der Wegverwaltung benutzt, wenn eine Verbindung bewertet wird.userName
- Benutzername mit dem die Authentifizierung durchgeführt werden soll.password
- Passwort des Benutzers mit dem die Authentifizierung durchgeführt werden soll.ConnectionException
- wenn eine Verbindung nicht aufgebaut werden konnteCommunicationError
- wenn bei der initialen Kommunikation mit dem Datenverteiler Fehler aufgetreten sindprivate void addConnection(T_T_HighLevelCommunication highLevelCommunication)
public final short getWeight(long connectedTransmitterId)
connectedTransmitterId
- ID des DAVprivate List<TransmitterConnectionInfo> getInvolvedTransmitters(TransmitterInfo t_info)
t_info
- Information zum Datenverteilerprivate void startTransmitterConnection(ConnectionInterface connection) throws ConnectionException
ConnectionException
private T_T_HighLevelCommunication startTransmitterConnection(TransmitterInfo t_info, short weight, String userName, String password, int subAddressToConnectTo) throws ConnectionException
ConnectionException
private T_T_HighLevelCommunication createTransmitterHighLevelCommunication(short weight, String userName, String password, ServerConnectionProperties properties)
T_T_HighLevelCommunication getTransmitterConnection(long transmitterId)
public void close(boolean error, String message)
public TransmitterConnectionInfo getTransmitterConnectionInfo(long connectedTransmitterId)
connectedTransmitterId
- ID des DAVpublic TransmitterConnectionInfo getRemoteTransmitterConnectionInfo(long connectedTransmitterId)
connectedTransmitterId
- ID des DAVpublic boolean removeTransmitterConnection(T_T_HighLevelCommunication transmitterCommunication)
public Collection<T_T_HighLevelCommunication> getTransmitterConnections()
public void updateId(T_T_HighLevelCommunication communication)
private void disableReplacementConnection(TransmitterConnectionInfo transmitterConnectionInfo)
private void terminateReplacementConnection(TransmitterInfo transmitterInfo, boolean automatic)
private void scheduleTransmitterConnect(TransmitterConnectionInfo transmitterConnectionInfo, int delay, TimeUnit timeUnit)