T
- the concrete connection builder.public abstract class ConnectionBuilder<T extends ConnectionBuilder<T>>
extends java.lang.Object
DlmsConnection
.TcpConnectionBuilder
,
SerialConnectionBuilder
Modifier and Type | Class and Description |
---|---|
protected class |
ConnectionBuilder.SettingsImpl |
Constructor and Description |
---|
ConnectionBuilder()
Create a new connection builder, with default settings.
|
Modifier and Type | Method and Description |
---|---|
abstract DlmsConnection |
buildLnConnection()
Builds a new DLMS/COSEM LN Connection, which is connected to the remote meter.
|
abstract DlmsConnection |
buildSnConnection()
Builds a new DLMS/COSEM SN Connection, which is connected to the remote meter.
|
protected T |
self()
Access the casted this reference.
|
T |
setAuthentication(Authentication authentication)
Set
Authentication . |
T |
setChallengeLength(int challengeLength)
Change the used challenge length.
|
T |
setClientId(int clientId)
Set the client ID which should be used to connect to the server.
|
T |
setDeviceId(long deviceId)
Set the used device ID.
|
T |
setLogicalDeviceId(int logicalDeviceId)
Set the logical device ID of the logical device in the physical server.
|
T |
setManufactureId(java.lang.String manufactureId)
Sets the manufacturer ID.
|
T |
setPhysicalDeviceAddress(int physicalDeviceAddress)
Sets the physical device address.
|
T |
setResponseTimeout(int responseTimeout)
Sets the time in milliseconds the client waits for a response.
|
T |
setSystemTitle(java.lang.String manufacturerId,
long deviceId)
Set the client's system title.
|
public ConnectionBuilder()
public T setAuthentication(Authentication authentication)
Authentication
.authentication
- authentication objectpublic T setClientId(int clientId)
Default client ID is 16 (Public Client).
clientId
- the client id.public T setLogicalDeviceId(int logicalDeviceId)
Default logical device ID is 1 (Management Logical Device).
logicalDeviceId
- the logical device ID.public T setChallengeLength(int challengeLength)
challengeLength
- challenge lengthpublic T setDeviceId(long deviceId)
deviceId
- the device IDpublic T setPhysicalDeviceAddress(int physicalDeviceAddress)
This is only relevant if a connection over HDLC is used.
physicalDeviceAddress
- the physical device address.public T setResponseTimeout(int responseTimeout)
responseTimeout
- time in milliseconds.public T setManufactureId(java.lang.String manufactureId)
manufactureId
- the manufacturer IDpublic T setSystemTitle(java.lang.String manufacturerId, long deviceId)
manufacturerId
- the manufacturer IDdeviceId
- the device IDpublic abstract DlmsConnection buildLnConnection() throws java.io.IOException
java.io.IOException
- if an error occurs, while connecting to the meter.public abstract DlmsConnection buildSnConnection() throws java.io.IOException
java.io.IOException
- if an error occurs, while connecting to the meter.protected T self()