Package org.openmuc.jeebus.spine.api
Interface ConnectionHandler
-
public interface ConnectionHandler
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddAddressMapping(java.lang.String deviceAddress, java.lang.String communicationAddress)Associates the SPINE device address with the address used in the communication protocol.voidcloseConnection(java.lang.String address)java.lang.StringgetCommunicationAddress(java.lang.String deviceAddress)Returns the mapped communication address for the given SPINE device address.java.lang.StringgetDeviceAddress(java.lang.String communicationAddress)SpineConnectionnewConnection(java.lang.String address)Returns an open connection to the requested communication partner.voidregisterConnection(SpineConnection connection)Register an open connectionvoidremoveAddressMapping(java.lang.String address)
-
-
-
Method Detail
-
newConnection
SpineConnection newConnection(java.lang.String address)
Returns an open connection to the requested communication partner.- Parameters:
address- the address used in the communication protocol, i.e. not the SPINE device address. SeegetCommunicationAddress(java.lang.String)- Returns:
- a connection to the requested device
-
getCommunicationAddress
java.lang.String getCommunicationAddress(java.lang.String deviceAddress)
Returns the mapped communication address for the given SPINE device address.- Parameters:
deviceAddress- the device address used in SPINE- Returns:
- the address used in the communication protocol
- Throws:
java.util.NoSuchElementException- when no associated address is known
-
registerConnection
void registerConnection(SpineConnection connection)
Register an open connection- Parameters:
connection- the connection that will be registered to be reused
-
addAddressMapping
void addAddressMapping(java.lang.String deviceAddress, java.lang.String communicationAddress)Associates the SPINE device address with the address used in the communication protocol.- Parameters:
deviceAddress- the device address used in SPINEcommunicationAddress- the address used in the communication protocol
-
removeAddressMapping
void removeAddressMapping(java.lang.String address)
- Parameters:
address- the address used in the communication protocol, i.e. not the SPINE device address.
-
closeConnection
void closeConnection(java.lang.String address)
- Parameters:
address- the address used in the communication protocol, i.e. not the device address. See getCommunicationAddress.
-
getDeviceAddress
java.lang.String getDeviceAddress(java.lang.String communicationAddress)
-
-