List of usage examples for com.amazonaws.services.iotdata AWSIotDataClient AWSIotDataClient
AWSIotDataClient(AwsSyncClientParams clientParams)
From source file:com.erudika.para.iot.AWSIoTService.java
License:Apache License
protected AWSIotDataClient getDataClient() { if (iotDataClient != null) { return iotDataClient; }//ww w . j a v a 2s .com Region region = Regions.getCurrentRegion(); region = region != null ? region : Region.getRegion(Regions.fromName(Config.AWS_REGION)); iotDataClient = new AWSIotDataClient(new BasicAWSCredentials(Config.AWS_ACCESSKEY, Config.AWS_SECRETKEY)) .withRegion(region); Para.addDestroyListener(new DestroyListener() { public void onDestroy() { shutdownDataClient(); } }); return iotDataClient; }