Package org.openmuc.eebus.spine.api
Interface ConnectionHandler
-
public interface ConnectionHandler
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addAddressMapping(java.lang.String deviceAddress, java.lang.String address)
Associates the SPINE device address with the address used in the communication protocol.void
closeConnection(java.lang.String address)
java.lang.String
getCommunicationAddress(java.lang.String deviceAddress)
Returns the mapped communication address for the given SPINE device address.SpineConnection
newConnection(java.lang.String address)
Returns an open connection to the requested communication partner.void
registerConnection(SpineConnection connection)
Register an open connectionvoid
removeAddressMapping(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 address)
Associates the SPINE device address with the address used in the communication protocol.- Parameters:
deviceAddress
- the device address used in SPINEaddress
- 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.
-
-