Interface DlmsConnection
-
- All Superinterfaces:
java.lang.AutoCloseable
public interface DlmsConnection
Interface used to interact with a DLMS/COSEM server using the LN services.- See Also:
ConnectionBuilder
,DlmsSnConnection
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<MethodResult>
action(boolean priority, java.util.List<MethodParameter> params)
Requests the remote smart meter to call one or several methods with or without committed parametersMethodResult
action(boolean priority, MethodParameter methodParameter)
Requests the remote smart meter to call one methods with or without committed parameters.java.util.List<MethodResult>
action(java.util.List<MethodParameter> params)
Convenience method to callaction(false, params)
MethodResult
action(MethodParameter methodParameter)
Requests the remote smart meter to call one methods with or without committed parameters.void
changeClientGlobalAuthenticationKey(byte[] key)
Change the global authentication key used by the client.void
changeClientGlobalEncryptionKey(byte[] key)
Change the global encryption used by the client.void
close()
Closes the connection.void
disconnect()
Disconnects gracefully from the server.java.util.List<GetResult>
get(boolean priority, java.util.List<AttributeAddress> params)
Requests the remote smart meter to send the values of one or several attributesGetResult
get(boolean priority, AttributeAddress attributeAddress)
Requests the remote smart meter to send the values of several attributes.java.util.List<GetResult>
get(java.util.List<AttributeAddress> params)
Convenience method to call#get(false, List)
GetResult
get(AttributeAddress attributeAddress)
Requests the remote smart meter to send the values of several attributes.java.util.List<AccessResultCode>
set(boolean priority, java.util.List<SetParameter> params)
Requests the remote smart meter to set one or several attributes to the committed valuesAccessResultCode
set(boolean priority, SetParameter setParameter)
Requests the remote smart meter to set one attributes to the committed values.java.util.List<AccessResultCode>
set(java.util.List<SetParameter> params)
Requests the remote smart meter to set one attribute to the committed value.AccessResultCode
set(SetParameter setParameter)
Requests the remote smart meter to set one or several attributes to the committed values.
-
-
-
Method Detail
-
get
java.util.List<GetResult> get(java.util.List<AttributeAddress> params) throws java.io.IOException
Convenience method to call#get(false, List)
- Parameters:
params
- args of specifiers which attributes to send (SeeAttributeAddress
)- Returns:
- List of results from the smart meter in the same order as the requests
- Throws:
java.io.IOException
- if the connection breaks, while requesting.May be of type
FatalJDlmsException
orResponseTimeoutException
- See Also:
get(boolean, List)
-
get
GetResult get(AttributeAddress attributeAddress) throws java.io.IOException
Requests the remote smart meter to send the values of several attributes.Convenience method to call
#get(false, AttributeAddress)
.- Parameters:
attributeAddress
- specifiers which attributes to send (SeeAttributeAddress
)- Returns:
- single result from the meter.
- Throws:
java.io.IOException
- if the connection breaks, while requesting.May be of type
FatalJDlmsException
orResponseTimeoutException
- See Also:
get(boolean, AttributeAddress)
-
get
GetResult get(boolean priority, AttributeAddress attributeAddress) throws java.io.IOException
Requests the remote smart meter to send the values of several attributes.- Parameters:
priority
- if true: sends this request with high priority, if supportedattributeAddress
- specifiers which attributes to send (SeeAttributeAddress
)- Returns:
- single results from the smart meter in the same order as the requests
- Throws:
java.io.IOException
- if the connection breaks, while requesting.May be of type
FatalJDlmsException
orResponseTimeoutException
- See Also:
get(boolean, List)
-
get
java.util.List<GetResult> get(boolean priority, java.util.List<AttributeAddress> params) throws java.io.IOException
Requests the remote smart meter to send the values of one or several attributes- Parameters:
priority
- if true: sends this request with high priority, if supportedparams
- args of specifiers which attributes to send (SeeAttributeAddress
)- Returns:
- List of results from the smart meter in the same order as the requests
- Throws:
java.io.IOException
- if the connection breaks, while requesting.May be of type
FatalJDlmsException
orResponseTimeoutException
-
set
java.util.List<AccessResultCode> set(java.util.List<SetParameter> params) throws java.io.IOException
Requests the remote smart meter to set one attribute to the committed value.Convenience method to call
set(false, SetParameter...)
.- Parameters:
params
- args of specifier which attributes to set to which values (SeeSetParameter
)- Returns:
- List of results from the smart meter in the same order as the requests or null if confirmed has been set to false on creation of this object. A true value indicates that this particular value has been successfully set
- Throws:
java.io.IOException
- if the connection breaks, while requesting.May be of type
FatalJDlmsException
orResponseTimeoutException
- See Also:
set(boolean, List)
-
set
java.util.List<AccessResultCode> set(boolean priority, java.util.List<SetParameter> params) throws java.io.IOException
Requests the remote smart meter to set one or several attributes to the committed values- Parameters:
priority
- Sends this request with high priority, if supportedparams
- Varargs of specifier which attributes to set to which values (SeeSetParameter
)- Returns:
- List of results from the smart meter in the same order as the requests or null if confirmed has been set to false on creation of this object. A true value indicates that this particular value has been successfully set
- Throws:
java.io.IOException
- if the connection breaks, while requesting.May be of type
FatalJDlmsException
orResponseTimeoutException
-
set
AccessResultCode set(boolean priority, SetParameter setParameter) throws java.io.IOException
Requests the remote smart meter to set one attributes to the committed values.- Parameters:
priority
- Sends this request with high priority, if supportedsetParameter
- Varargs of specifier which attributes to set to which values (SeeSetParameter
)- Returns:
- results from the smart meter in the same order as the requests or null if confirmed has been set to false on creation of this object. A true value indicates that this particular value has been successfully set
- Throws:
java.io.IOException
- if the connection breaks, while requesting.May be of type
FatalJDlmsException
orResponseTimeoutException
-
set
AccessResultCode set(SetParameter setParameter) throws java.io.IOException
Requests the remote smart meter to set one or several attributes to the committed values.Convenience method to call
set(false, SetParameter)
- Parameters:
setParameter
- attribute and values (seeSetParameter
)- Returns:
- results from the smart meter in the same order as the requests or null if confirmed has been set to false on creation of this object. A true value indicates that this particular value has been successfully set
- Throws:
java.io.IOException
- if the connection breaks, while requesting.May be of type
FatalJDlmsException
orResponseTimeoutException
-
action
MethodResult action(boolean priority, MethodParameter methodParameter) throws java.io.IOException
Requests the remote smart meter to call one methods with or without committed parameters.- Parameters:
priority
- Sends this request with high priority, if supportedmethodParameter
- method to be called and, if needed, what parameters to call (SeeMethodParameter
- Returns:
- results from the smart meter in the same order as the requests or null if confirmed has been set to false on creation of this object.
- Throws:
java.io.IOException
- if the connection breaks, while requesting.May be of type
FatalJDlmsException
orResponseTimeoutException
-
action
MethodResult action(MethodParameter methodParameter) throws java.io.IOException
Requests the remote smart meter to call one methods with or without committed parameters.Convenience method to call
action(false, methodParameter)
- Parameters:
methodParameter
- specifier which method to be called and, if needed, what parameters to call (SeeMethodParameter
- Returns:
- results from the smart meter in the same order as the requests or null if confirmed has been set to false on creation of this object.
- Throws:
java.io.IOException
- if the connection breaks, while requesting.May be of type
FatalJDlmsException
orResponseTimeoutException
-
action
java.util.List<MethodResult> action(java.util.List<MethodParameter> params) throws java.io.IOException
Convenience method to callaction(false, params)
- Parameters:
params
- List of specifier which methods to be called and, if needed, what parameters to call (SeeMethodParameter
- Returns:
- List of results from the smart meter in the same order as the requests or null if confirmed has been set to false on creation of this object
- Throws:
java.io.IOException
- if the connection breaks, while requesting.May be of type
FatalJDlmsException
orResponseTimeoutException
-
action
java.util.List<MethodResult> action(boolean priority, java.util.List<MethodParameter> params) throws java.io.IOException
Requests the remote smart meter to call one or several methods with or without committed parameters- Parameters:
priority
- Sends this request with high priority, if supportedparams
- List of specifier which methods to be called and, if needed, what parameters to call (SeeMethodParameter
- Returns:
- List of results from the smart meter in the same order as the requests or null if confirmed has been set to false on creation of this object
- Throws:
java.io.IOException
- if the connection breaks, while requesting.May be of type
FatalJDlmsException
orResponseTimeoutException
-
changeClientGlobalAuthenticationKey
void changeClientGlobalAuthenticationKey(byte[] key)
Change the global authentication key used by the client.- Parameters:
key
- the new key
-
changeClientGlobalEncryptionKey
void changeClientGlobalEncryptionKey(byte[] key)
Change the global encryption used by the client.- Parameters:
key
- the new key
-
disconnect
void disconnect() throws java.io.IOException
Disconnects gracefully from the server.- Throws:
java.io.IOException
- if an I/O Exception occurs while closing
-
close
void close() throws java.io.IOException
Closes the connection.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Throws:
java.io.IOException
- if an I/O Exception occurs while closing
-
-