Kanzi Connect  3.9.5
Kanzi Connect Java API
ConfigurationReader Class Reference

Utility class to read kanzi connect specific connection configuration file. More...

Public Member Functions

 ConfigurationReader (String serverName)
 Constructor. More...
 
 ConfigurationReader (String serverName, AssetManager assetManager)
 Constructor. More...
 
boolean certificatesValid ()
 Checks that all certificates and private keys have valid content. More...
 
int countIP ()
 Retrieves amount of IP Address candidates. More...
 
String getClientCertificateContent ()
 Retrieve Client certificate file content. More...
 
String getClientPrivateKeyContent ()
 Retrieve client private key content. More...
 
String getConnectIdentifier ()
 Retrieve connection identifier. More...
 
StringMap getConnectionParameters ()
 Retrieve connection parameters in a string-map can be fed to client connector directly. More...
 
String getIP ()
 Retrieve IP address. More...
 
String getIPAt (int index)
 Retrieve IP address at given position. More...
 
String getPort ()
 Retrieve port number. More...
 
String getProtocol ()
 Retrieve protocol name. More...
 
String getServerCACertificateContent ()
 Retrieve Server CA certificate content (textual) More...
 
void refresh ()
 Re-Read the configuration.
 
boolean valid ()
 Checks whether the configuration is valid. More...
 

Static Public Member Functions

static StringMap getConnectionParametersStatic (String serverName)
 Static convenience method to access connection parameters. More...
 
static StringMap getConnectionParametersStatic (String serverName, AssetManager assetManager)
 Static convenience method to access connection parameters. More...
 

Detailed Description

Utility class to read kanzi connect specific connection configuration file.

Constructor & Destructor Documentation

◆ ConfigurationReader() [1/2]

ConfigurationReader ( String  serverName)

Constructor.

Will try to read the configuration file during construction.

◆ ConfigurationReader() [2/2]

ConfigurationReader ( String  serverName,
AssetManager  assetManager 
)

Constructor.

Will try to read the configuration file during construction.

Member Function Documentation

◆ certificatesValid()

boolean certificatesValid ( )

Checks that all certificates and private keys have valid content.

Returns
true if valid content.

◆ countIP()

int countIP ( )

Retrieves amount of IP Address candidates.

Returns
amount of ip address candidates.

◆ getClientCertificateContent()

String getClientCertificateContent ( )

Retrieve Client certificate file content.

Returns
client certificate file content

◆ getClientPrivateKeyContent()

String getClientPrivateKeyContent ( )

Retrieve client private key content.

Returns
private file content

◆ getConnectIdentifier()

String getConnectIdentifier ( )

Retrieve connection identifier.

Returns
connection identifier used with non-ip bearers (shared memory etc).

◆ getConnectionParameters()

StringMap getConnectionParameters ( )

Retrieve connection parameters in a string-map can be fed to client connector directly.

Returns
StringMap with valid connection information.

◆ getConnectionParametersStatic() [1/2]

static StringMap getConnectionParametersStatic ( String  serverName)
static

Static convenience method to access connection parameters.

Returns
connection parameters.

◆ getConnectionParametersStatic() [2/2]

static StringMap getConnectionParametersStatic ( String  serverName,
AssetManager  assetManager 
)
static

Static convenience method to access connection parameters.

Returns
connection parameters.

◆ getIP()

String getIP ( )

Retrieve IP address.

If none is defined, returns 127.0.0.1

Returns
IP Address

◆ getIPAt()

String getIPAt ( int  index)

Retrieve IP address at given position.

Parameters
indexthe position from 0...countIP()-1
Returns

◆ getPort()

String getPort ( )

Retrieve port number.

Returns
port number

◆ getProtocol()

String getProtocol ( )

Retrieve protocol name.

E.g. "connect.bearer.tcp"

Returns
protocol name

◆ getServerCACertificateContent()

String getServerCACertificateContent ( )

Retrieve Server CA certificate content (textual)

Returns
certificate content

◆ valid()

boolean valid ( )

Checks whether the configuration is valid.

Returns
true if configuration has all relevant parameters set.