/** * The Asynchronous SNS client is used for publishing events to SNS. */ private AmazonSNSAsyncClient createAsyncSNSClient( final Region region, final ExecutorService executor ) { final UsergridAwsCredentialsProvider ugProvider = new UsergridAwsCredentialsProvider(); final AmazonSNSAsyncClient sns = new AmazonSNSAsyncClient( ugProvider.getCredentials(), clientConfiguration, executor ); sns.setRegion( region ); return sns; }
public Void call() throws Exception { addPermission(addPermissionRequest); return null; } });
public CheckIfPhoneNumberIsOptedOutResult call() throws Exception { return checkIfPhoneNumberIsOptedOut(checkIfPhoneNumberIsOptedOutRequest); } });
/** * Construct an asynchronous implementation of AmazonSNSAsync using the current builder configuration. * * @param params * Current builder configuration represented as a parameter object. * @return Fully configured implementation of AmazonSNSAsync. */ @Override protected AmazonSNSAsync build(AwsAsyncClientParams params) { return new AmazonSNSAsyncClient(params); }
public Void call() throws Exception { deleteTopic(deleteTopicRequest); return null; } });
public Void call() throws Exception { deletePlatformApplication(deletePlatformApplicationRequest); return null; } });
public ConfirmSubscriptionResult call() throws Exception { return confirmSubscription(confirmSubscriptionRequest); } });
public CreatePlatformApplicationResult call() throws Exception { return createPlatformApplication(createPlatformApplicationRequest); } });
public CreatePlatformEndpointResult call() throws Exception { return createPlatformEndpoint(createPlatformEndpointRequest); } });
public CreateTopicResult call() throws Exception { return createTopic(createTopicRequest); } });
public Void call() throws Exception { deleteEndpoint(deleteEndpointRequest); return null; } });
AmazonSNSAsyncClient snsClient = new AmazonSNSAsyncClient();
public Void call() throws Exception { Void result = null; try { deleteTopic(deleteTopicRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(deleteTopicRequest, result); return result; } });
public Void call() throws Exception { Void result = null; try { deletePlatformApplication(deletePlatformApplicationRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(deletePlatformApplicationRequest, result); return result; } });
public ConfirmSubscriptionResult call() throws Exception { ConfirmSubscriptionResult result = null; try { result = confirmSubscription(confirmSubscriptionRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(confirmSubscriptionRequest, result); return result; } });
public CreatePlatformApplicationResult call() throws Exception { CreatePlatformApplicationResult result = null; try { result = createPlatformApplication(createPlatformApplicationRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(createPlatformApplicationRequest, result); return result; } });
public CreatePlatformEndpointResult call() throws Exception { CreatePlatformEndpointResult result = null; try { result = createPlatformEndpoint(createPlatformEndpointRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(createPlatformEndpointRequest, result); return result; } });
public CreateTopicResult call() throws Exception { CreateTopicResult result = null; try { result = createTopic(createTopicRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(createTopicRequest, result); return result; } });
public Void call() throws Exception { Void result = null; try { deleteEndpoint(deleteEndpointRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(deleteEndpointRequest, result); return result; } });
public AmazonAwsSQSConnector(String awsAccessKey, String awsSecretKey, boolean isSecure, long receiveCheckIntervalMs, boolean isAsync) { super(receiveCheckIntervalMs, isAsync); AWSCredentials awsCredentials = new BasicAWSCredentials(awsAccessKey, awsSecretKey); ClientConfiguration clientConfiguration = new ClientConfiguration(); String proxyHost = System.getProperty("http.proxyHost"); String proxyPort = System.getProperty("http.proxyPort"); if(proxyHost != null){ clientConfiguration.setProxyHost(proxyHost); if(proxyPort != null){ clientConfiguration.setProxyPort(Integer.parseInt(proxyPort)); } } clientConfiguration.setProtocol(isSecure ? Protocol.HTTPS : Protocol.HTTP); if (isAsync) { ExecutorService executorService = Executors.newSingleThreadExecutor(); _amazonSQS = new AmazonSQSAsyncClient(awsCredentials, clientConfiguration, executorService); _amazonSNS = new AmazonSNSAsyncClient(awsCredentials, clientConfiguration, executorService); } else { _amazonSQS = new AmazonSQSClient(awsCredentials, clientConfiguration); _amazonSNS = new AmazonSNSClient(awsCredentials, clientConfiguration); } }