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 Detail

      • 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 supported
        attributeAddress - specifiers which attributes to send (See AttributeAddress)
        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 or ResponseTimeoutException

        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 supported
        params - args of specifiers which attributes to send (See AttributeAddress)
        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 or ResponseTimeoutException

      • 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 (See SetParameter)
        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 or ResponseTimeoutException

        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 supported
        params - Varargs of specifier which attributes to set to which values (See SetParameter)
        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 or ResponseTimeoutException

      • 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 supported
        setParameter - Varargs of specifier which attributes to set to which values (See SetParameter)
        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 or ResponseTimeoutException

      • 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 (see SetParameter)
        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 or ResponseTimeoutException

      • 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 supported
        methodParameter - method to be called and, if needed, what parameters to call (See MethodParameter
        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 or ResponseTimeoutException

      • 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 (See MethodParameter
        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 or ResponseTimeoutException

      • action

        java.util.List<MethodResult> action​(java.util.List<MethodParameter> params)
                                     throws java.io.IOException
        Convenience method to call action(false, params)
        Parameters:
        params - List of specifier which methods to be called and, if needed, what parameters to call (See MethodParameter
        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 or ResponseTimeoutException

      • 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 supported
        params - List of specifier which methods to be called and, if needed, what parameters to call (See MethodParameter
        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 or ResponseTimeoutException

      • 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 interface java.lang.AutoCloseable
        Throws:
        java.io.IOException - if an I/O Exception occurs while closing