Integrate client status notification in your application
This article describes how to configure client status notifications into your application.
Prerequisites
CipherTrust Manager must be up and running. Refer to CipherTrust Manager Deployment for details.
CADP for Java must be up and running and registered on the CipherTrust Manager. Refer to the Quick Start section for details.
Steps
To configure the client status notification in your application:
Create an implementation of
ClientObserver<ClientStatus, String>
and overridenotifyStatusUpdate
method.For example:
public class StatusUpdate implements ClientObserver<ClientStatus, String> { @Override public void notifyStatusUpdate(ClientStatus status, String message) { // You need to define the behavior of CADP for Java client here. } }
To subscribe to status change notification, call
subscribeToStatusUpdate
method oncentralManagementProvider
and pass the implementation created above as a parameter.RegisterClientParameters registerClientParams = new RegisterClientParameters.Builder(keyManagerHost, registrationToken).build(); CentralManagementProvider centralManagementProvider = new CentralManagementProvider(registerClientParams); centralManagementProvider.subscribeToStatusUpdate(new StatusUpdate()); centralManagementProvider.addProvider();