Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
breakoutModewide
// Provide an input stream to the Certificate Authorities allowed on this provider
InputStream nexoCAFile = { ... };

// Initiate an instance of an Object implementing the TMSConnectionProvider interface
// We are using the Amadis provider here for ease of use
AmadisUnifiedConnectionProvider connectionProvider = AmadisUnifiedConnectionProvider.DefaultNexoProvider(nexoCAFile);

// [configuration] must be a previously received valid configuration from the TMS system
TMSResult result = AmadisTMSModule.DoConfiguration(connectionProvider, configuration);

// Inspect and use the result Object
if (result.isSuccess()) {
    Log.d("config", "Configuration attempt was successful");
    configuration = result.getConfiguration();

    // It is important to always keep the Connection Provider up to date with the current configuration
    connectionProvider.setConfiguration(configuration);
}
else {
    // The textual reason for a failure is provided
    Log.d("config", "Configuration attempt failed: " + result.getError());
}