de.bsvrz.kex.tls.osi2osi3.osi2.tc57primary
Class Primary

java.lang.Object
  extended by de.bsvrz.kex.tls.osi2osi3.osi2.api.AbstractDataLinkLayer
      extended by de.bsvrz.kex.tls.osi2osi3.osi2.tc57primary.AbstractTc57
          extended by de.bsvrz.kex.tls.osi2osi3.osi2.tc57primary.Primary
All Implemented Interfaces:
DataLinkLayer, PropertyQueryInterface

public class Primary
extends AbstractTc57
implements PropertyQueryInterface

OSI-2 Modul, das das TC57-Protokoll nach TLS auf Seite der Primary implementiert.

Author:
Kappich Systemberatung

Nested Class Summary
private  class Primary.Link
           
private static class Primary.PollState
          Definiert die möglichen Unterzustände einer Verbindung.
private static class Primary.PriorizedByteArray
           
private  class Primary.RunnablePrimary
           
 
Field Summary
private static Debug _debug
           
private  List _links
           
private  ListIterator _linksPollingIterator
           
private  Properties _newProperties
           
private static boolean _offlineTest
           
private  Thread _pollingThread
           
private  Object _protocolLock
           
private  boolean _reloadProperties
           
private  SerialPortControl _serialPortControl
           
private  boolean _shuttingDown
           
private  int _simulatedDataCount
           
private  boolean _started
           
private  boolean _stopped
           
 
Constructor Summary
Primary()
           
 
Method Summary
 void abort()
          Beendet die Kommunikation dieses Protokolls.
 DataLinkLayer.Link createLink(int remoteAddress)
          Erzeugt eine neue logische Verbindung zu einem bestimmten Kommunikationspartner.
 boolean isStarted()
          Bestimmt, ob die Kommunikation dieses Protokolls bereits mit dr Methode start() aktiviert wurde.
private  SecondaryFrame querySecondary(PrimaryFrame primaryFrame, PropertyConsultant propertyConsultant, Primary.Link link)
           
 void setDavConnection(ClientDavInterface connection)
          Nimmmt die Verbindung zum Datenverteiler entgegen.
 void setProperties(Properties properties)
          Setzt einen neuen Satz von Protokoll-Parametern.
 void shutdown()
          Beendet die Kommunikation dieses Protokolls.
private  SecondaryFrame simulateQuery(PrimaryFrame primaryFrame)
           
private  byte[] simulateQueryBytes(PrimaryFrame primaryFrame)
           
 void start()
          Aktiviert die Kommunikation dieses Protokolls.
 String toString()
           
 
Methods inherited from class de.bsvrz.kex.tls.osi2osi3.osi2.tc57primary.AbstractTc57
getDefaultProperty, getMaximumDataSize
 
Methods inherited from class de.bsvrz.kex.tls.osi2osi3.osi2.api.AbstractDataLinkLayer
addEventListener, allowConnection, allowConnection, checkConnection, getLocalAddress, getProperty, notifyEvent, notifyEvent, removeEventListener, setLocalAddress
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.bsvrz.kex.tls.osi2osi3.properties.PropertyQueryInterface
getProperty
 

Field Detail

_debug

private static final Debug _debug

_protocolLock

private final Object _protocolLock

_pollingThread

private final Thread _pollingThread

_started

private boolean _started

_stopped

private boolean _stopped

_shuttingDown

private boolean _shuttingDown

_links

private List _links

_linksPollingIterator

private ListIterator _linksPollingIterator

_serialPortControl

private SerialPortControl _serialPortControl

_newProperties

private Properties _newProperties

_reloadProperties

private boolean _reloadProperties

_offlineTest

private static final boolean _offlineTest
See Also:
Constant Field Values

_simulatedDataCount

private int _simulatedDataCount
Constructor Detail

Primary

public Primary()
Method Detail

toString

public String toString()
Overrides:
toString in class Object

setDavConnection

public void setDavConnection(ClientDavInterface connection)
Nimmmt die Verbindung zum Datenverteiler entgegen. Diese Methode wird vom OSI-3 Modul nach dem Erzeugen des OSI-2 Moduls durch den jeweiligen Konstruktor aufgerufen. Eine Implementierung eines Protokollmoduls kann sich bei Bedarf die übergebene Datenverteilerverbindung intern merken, um zu späteren Zeitpunkten auf die Datenverteiler-Applikationsfunktionen zuzugreifen.

Specified by:
setDavConnection in interface DataLinkLayer
Parameters:
connection - Verbindung zum Datenverteiler

isStarted

public boolean isStarted()
Bestimmt, ob die Kommunikation dieses Protokolls bereits mit dr Methode start() aktiviert wurde.

Specified by:
isStarted in interface DataLinkLayer
Returns:
true, wenn die Kommunikation dieses Protokolls bereits aktiviert wurde, sonst false.

start

public void start()
Description copied from interface: DataLinkLayer
Aktiviert die Kommunikation dieses Protokolls.

Specified by:
start in interface DataLinkLayer

shutdown

public void shutdown()
Description copied from interface: DataLinkLayer
Beendet die Kommunikation dieses Protokolls. Alle noch verbundenen Links werden mit der Methode DataLinkLayer.Link.shutdown() terminiert. Dabei wird sichergestellt, dass Daten, die zuvor an die Methode DataLinkLayer.Link.send(byte[], int) übergeben wurden, auch übertragen werden.

Specified by:
shutdown in interface DataLinkLayer

abort

public void abort()
Description copied from interface: DataLinkLayer
Beendet die Kommunikation dieses Protokolls. Alle noch verbundenen Links werden mit der Methode DataLinkLayer.Link.abort() terminiert.

Specified by:
abort in interface DataLinkLayer

setProperties

public void setProperties(Properties properties)
Description copied from interface: DataLinkLayer
Setzt einen neuen Satz von Protokoll-Parametern. Diese dienen auch als Defaultwerte für die Verbindungsparameter.

Specified by:
setProperties in interface DataLinkLayer
Overrides:
setProperties in class AbstractDataLinkLayer
Parameters:
properties - Neue Verbindungsparameter.
See Also:
DataLinkLayer.Link.getProperty(java.lang.String)

querySecondary

private SecondaryFrame querySecondary(PrimaryFrame primaryFrame,
                                      PropertyConsultant propertyConsultant,
                                      Primary.Link link)
                               throws InterruptedException,
                                      IOException
Throws:
InterruptedException
IOException

simulateQuery

private SecondaryFrame simulateQuery(PrimaryFrame primaryFrame)

simulateQueryBytes

private byte[] simulateQueryBytes(PrimaryFrame primaryFrame)

createLink

public DataLinkLayer.Link createLink(int remoteAddress)
Description copied from interface: DataLinkLayer
Erzeugt eine neue logische Verbindung zu einem bestimmten Kommunikationspartner.

Specified by:
createLink in interface DataLinkLayer
Parameters:
remoteAddress - OSI-2 Adresse bzw. Portnummer des gewünschten Kommunikationspartners.
Returns:
Logische Verbindung zum Kommunikationspartner.