Class ConnectionBuilder

  • All Implemented Interfaces:

    
    public final class ConnectionBuilder
    
                        

    Builder to create the different connection objects.

    Since:

    2.0

    • Constructor Detail

      • ConnectionBuilder

        ConnectionBuilder()
    • Method Detail

      • withAddress

         final ConnectionBuilder withAddress(String address)

        Sets the IP address or the domain name of the home power plant (Without port!)

        Parameters:
        address - IP address or domain name
        Returns:

        this reference

      • withPort

         final ConnectionBuilder withPort(Integer port)

        Port on which the RSCP service in the home power plant listens. The specification is optional. By default, 5033 is used. For farms it should be 5034.

        Parameters:
        port - Port of the RSCP service in the home power plant
        Returns:

        this reference

        Since:

        2.0

      • withPortalUser

         final ConnectionBuilder withPortalUser(String portalUser)

        Username from the E3DC portal.

        Parameters:
        portalUser - E3DC Portal Username
        Returns:

        this reference

        Since:

        2.0

      • withRSCPPassword

         final ConnectionBuilder withRSCPPassword(String rscpPassword)

        RSCP Password. This is used to encrypt the transmission. The same value must be selected as was stored at the home power plant.

        Parameters:
        rscpPassword - RSCP Password for encryption
        Returns:

        this reference

        Since:

        2.0

      • withCipherFactory

         final ConnectionBuilder withCipherFactory(AESCipherFactory cipherFactory)

        If you want to use your own implementation for encryption, you can set a factory here. The setting is optional. By default BouncyCastleAESCipherFactory is used.

        Parameters:
        cipherFactory - Factory to use
        Returns:

        this reference

        Since:

        2.0

      • withSocketTimeoutMillis

         final ConnectionBuilder withSocketTimeoutMillis(Long timeout)

        Timeout in milliseconds for establishing the connection. Optional specification. By default 10000ms is used.

        Parameters:
        timeout - Timeout in milliseconds
        Returns:

        this reference

        Since:

        2.0

      • withSocketFactory

         final ConnectionBuilder withSocketFactory(SocketFactory socketFactory)

        If you want to use your own SocketFactory, you can set the instance here. Optional specification. By default an instance of type DefaultSocketFactory is used.

        Parameters:
        socketFactory - Factory to be used
        Returns:

        this reference

        Since:

        2.0

      • withFrameParser

         final ConnectionBuilder withFrameParser(FrameParser frameParser)

        If you want to use your own frame parser, you can set the instance here. Optional specification. By default an instance of type DefaultFrameParser is used.

        Parameters:
        frameParser - Parser to use
        Returns:

        this reference

        Since:

        2.0

      • withConnectionPool

         final ConnectionBuilder withConnectionPool(ConnectionPool connectionPool)

        If you want to use your own ConnectionPool, you can set it here. Optional specification. By default an instance of the type SingleInstanceConnectionPool is used.

        Parameters:
        connectionPool - ConnectionPool to use
        Returns:

        this reference

        Since:

        2.0

      • buildConnectionFactory

         final HomePowerPlantConnectionFactory buildConnectionFactory()

        Creates a new HomePowerPlantConnectionFactory instance.

        Returns:

        Newly created implementation of the HomePowerPlantConnectionFactory interface.

        Since:

        2.0

      • buildConnectionData

         final E3DCConnectionData buildConnectionData()

        Creates a new instance with the configured connection data

        Returns:

        Newly created instance of the connection data E3DCConnectionData.

        Since:

        2.0