Package org.openmuc.jdlms
Class TcpConnectionBuilder
- java.lang.Object
-
- org.openmuc.jdlms.ConnectionBuilder<TcpConnectionBuilder>
-
- org.openmuc.jdlms.TcpConnectionBuilder
-
public class TcpConnectionBuilder extends ConnectionBuilder<TcpConnectionBuilder>
Builder class to establish a DLMS connection via TCP/IP protocol suite. This includes the transport layers TCP and UDP.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TcpConnectionBuilder.InetTransportProtocol
class
TcpConnectionBuilder.TcpSettingsImpl
-
Nested classes/interfaces inherited from class org.openmuc.jdlms.ConnectionBuilder
ConnectionBuilder.SettingsImpl
-
-
Constructor Summary
Constructors Constructor Description TcpConnectionBuilder(java.lang.String inetAddress)
TcpConnectionBuilder(java.net.InetAddress inetAddress)
Construct aTcpConnectionBuilder
with client ID 1, logical device address 16 and a default TCP port 4059.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SessionLayer
buildSessionLayer(Settings settings)
protected Settings
buildSettings()
TcpConnectionBuilder
setInetAddress(java.net.InetAddress inetAddress)
build Set the Internet address of the remote meter.TcpConnectionBuilder
setPort(int port)
Set the port of the remote meter.void
setTranportProtocol(TcpConnectionBuilder.InetTransportProtocol tranportProtocol)
TcpConnectionBuilder
useHdlc()
Use the HDLC protocol.TcpConnectionBuilder
useWrapper()
Use the Wrapper protocol.-
Methods inherited from class org.openmuc.jdlms.ConnectionBuilder
build, buildSnConnection, setAlwaysSendSecurityMechanismName, setChallengeLength, setClientId, setFrameCounter, setHdlcMaxInformationLength, setLnToSnMapping, setLogicalDeviceId, setPhysicalDeviceAddress, setRawMessageListener, setReferencingMethod, setResponseTimeout, setSecuritySuite, setSkipAARQEncryption, setSnClassInfo, setSystemTitle, setUserId
-
-
-
-
Constructor Detail
-
TcpConnectionBuilder
public TcpConnectionBuilder(java.net.InetAddress inetAddress)
Construct aTcpConnectionBuilder
with client ID 1, logical device address 16 and a default TCP port 4059.- Parameters:
inetAddress
- the Internet address of the remote meter.
-
TcpConnectionBuilder
public TcpConnectionBuilder(java.lang.String inetAddress) throws java.net.UnknownHostException
- Throws:
java.net.UnknownHostException
-
-
Method Detail
-
setInetAddress
public TcpConnectionBuilder setInetAddress(java.net.InetAddress inetAddress)
build Set the Internet address of the remote meter.- Parameters:
inetAddress
- the Internet address.- Returns:
- the builder.
-
setTranportProtocol
public void setTranportProtocol(TcpConnectionBuilder.InetTransportProtocol tranportProtocol)
-
setPort
public TcpConnectionBuilder setPort(int port)
Set the port of the remote meter.- Parameters:
port
- the port.- Returns:
- the builder.
-
useHdlc
public TcpConnectionBuilder useHdlc()
Use the HDLC protocol.- Returns:
- the builder.
-
useWrapper
public TcpConnectionBuilder useWrapper()
Use the Wrapper protocol. This is the defualt.- Returns:
- the builder.
-
buildSettings
protected Settings buildSettings()
- Specified by:
buildSettings
in classConnectionBuilder<TcpConnectionBuilder>
-
buildSessionLayer
protected SessionLayer buildSessionLayer(Settings settings) throws java.io.IOException
- Specified by:
buildSessionLayer
in classConnectionBuilder<TcpConnectionBuilder>
- Throws:
java.io.IOException
-
-