Example usage for com.amazonaws.services.sns.model CreatePlatformEndpointRequest setCustomUserData

List of usage examples for com.amazonaws.services.sns.model CreatePlatformEndpointRequest setCustomUserData

Introduction

In this page you can find the example usage for com.amazonaws.services.sns.model CreatePlatformEndpointRequest setCustomUserData.

Prototype


public void setCustomUserData(String customUserData) 

Source Link

Document

Arbitrary user data to associate with the endpoint.

Usage

From source file:AmazonSNSClientWrapper.java

License:Open Source License

private CreatePlatformEndpointResult createPlatformEndpoint(SampleMessageGenerator.Platform platform,
        String customData, String platformToken, String applicationArn) {
    CreatePlatformEndpointRequest platformEndpointRequest = new CreatePlatformEndpointRequest();
    platformEndpointRequest.setCustomUserData(customData);
    String token = platformToken;
    String userId = null;/* w  ww . j  a  va2 s. com*/
    if (platform == SampleMessageGenerator.Platform.BAIDU) {
        String[] tokenBits = platformToken.split("\\|");
        token = tokenBits[0];
        userId = tokenBits[1];
        Map<String, String> endpointAttributes = new HashMap<String, String>();
        endpointAttributes.put("UserId", userId);
        endpointAttributes.put("ChannelId", token);
        platformEndpointRequest.setAttributes(endpointAttributes);
    }
    platformEndpointRequest.setToken(token);
    platformEndpointRequest.setPlatformApplicationArn(applicationArn);
    return snsClient.createPlatformEndpoint(platformEndpointRequest);
}

From source file:com.aws.sns.service.notifications.sns.AmazonSNSClientWrapper.java

License:Open Source License

private CreatePlatformEndpointResult createPlatformEndpoint(Platform platform, String customData,
        String platformToken, String applicationArn) {
    CreatePlatformEndpointRequest platformEndpointRequest = new CreatePlatformEndpointRequest();
    platformEndpointRequest.setCustomUserData(customData);
    String token = platformToken;
    String userId = null;/*from w ww  .  j a  v a 2 s  . c om*/
    if (platform == Platform.BAIDU) {
        String[] tokenBits = platformToken.split("\\|");
        token = tokenBits[0];
        userId = tokenBits[1];
        Map<String, String> endpointAttributes = new HashMap<String, String>();
        endpointAttributes.put("UserId", userId);
        endpointAttributes.put("ChannelId", token);
        platformEndpointRequest.setAttributes(endpointAttributes);
    }
    platformEndpointRequest.setToken(token);
    platformEndpointRequest.setPlatformApplicationArn(applicationArn);
    return snsClient.createPlatformEndpoint(platformEndpointRequest);
}

From source file:com.cloudbees.gasp.services.SNSMobile.java

License:Open Source License

public CreatePlatformEndpointResult createPlatformEndpoint(String customData, String platformToken,
        String applicationArn) {//from   w w w.  ja v a 2  s.c  om
    CreatePlatformEndpointRequest platformEndpointRequest = new CreatePlatformEndpointRequest();
    platformEndpointRequest.setCustomUserData(customData);
    platformEndpointRequest.setToken(platformToken);
    platformEndpointRequest.setPlatformApplicationArn(applicationArn);
    return snsClient.createPlatformEndpoint(platformEndpointRequest);
}

From source file:com.dev.appx.sns.tools.AmazonSNSClientWrapper.java

License:Open Source License

public CreatePlatformEndpointResult createPlatformEndpoint(Platform platform, String customData,
        String platformToken, String applicationArn) {
    CreatePlatformEndpointRequest platformEndpointRequest = new CreatePlatformEndpointRequest();
    platformEndpointRequest.setCustomUserData(customData);
    String token = platformToken;
    String userId = null;/*from  www .j  a  va  2s. co  m*/
    if (platform == Platform.BAIDU) {
        String[] tokenBits = platformToken.split("\\|");
        token = tokenBits[0];
        userId = tokenBits[1];
        Map<String, String> endpointAttributes = new HashMap<String, String>();
        endpointAttributes.put("UserId", userId);
        endpointAttributes.put("ChannelId", token);
        platformEndpointRequest.setAttributes(endpointAttributes);
    }
    platformEndpointRequest.setToken(token);
    platformEndpointRequest.setPlatformApplicationArn(applicationArn);
    return snsClient.createPlatformEndpoint(platformEndpointRequest);
}

From source file:com.easarrive.aws.plugins.common.service.impl.SNSService.java

License:Open Source License

/**
 * {@inheritDoc}//from   www.  j a v  a2  s .c om
 */
@Override
public CreatePlatformEndpointResult createPlatformEndpoint(AmazonSNS client,
        SNSPlatformEndpointRequest platformEndpointRequest) {
    if (platformEndpointRequest == null) {
        return null;
    }
    CreatePlatformEndpointRequest createPlatformEndpointRequest = new CreatePlatformEndpointRequest();
    createPlatformEndpointRequest.setCustomUserData(platformEndpointRequest.getCustomUserData());
    createPlatformEndpointRequest
            .setPlatformApplicationArn(platformEndpointRequest.getPlatformApplicationArn());
    createPlatformEndpointRequest.setToken(platformEndpointRequest.getToken());
    createPlatformEndpointRequest.withAttributes(platformEndpointRequest.getAttributes());

    CreatePlatformEndpointResult result = client.createPlatformEndpoint(createPlatformEndpointRequest);
    return result;
}

From source file:com.mistminds.service.AmazonSNSClientWrapper.java

License:Open Source License

private CreatePlatformEndpointResult createPlatformEndpoint(Platform platform, String customData,
        String platformToken, String applicationArn) {
    CreatePlatformEndpointRequest platformEndpointRequest = new CreatePlatformEndpointRequest();
    platformEndpointRequest.setCustomUserData(customData);
    String token = platformToken;
    platformEndpointRequest.setToken(token);
    platformEndpointRequest.setPlatformApplicationArn(applicationArn);
    return snsClient.createPlatformEndpoint(platformEndpointRequest);
}

From source file:com.screensaver.util.AmazonSNSClientWrapper.java

License:Open Source License

private CreatePlatformEndpointResult createPlatformEndpoint(Platform platform, String customData,
        String platformToken, String applicationArn) {
    CreatePlatformEndpointRequest platformEndpointRequest = new CreatePlatformEndpointRequest();
    platformEndpointRequest.setCustomUserData(customData);
    String token = platformToken;
    String userId = null;/* w w  w.  j a  v  a2 s  .com*/
    if (platform == SampleMessageGenerator.Platform.BAIDU) {
        String[] tokenBits = platformToken.split("\\|");
        token = tokenBits[0];
        userId = tokenBits[1];
        Map<String, String> endpointAttributes = new HashMap<String, String>();
        endpointAttributes.put("UserId", userId);
        endpointAttributes.put("ChannelId", token);
        platformEndpointRequest.setAttributes(endpointAttributes);
    }
    platformEndpointRequest.setToken(token);
    platformEndpointRequest.setPlatformApplicationArn(applicationArn);
    return snsClient.createPlatformEndpoint(platformEndpointRequest);

}

From source file:edu.utn.frba.grupo5303.serverenviolibre.services.NotificacionesPushService.java

private CreatePlatformEndpointResult createPlatformEndpoint(String customData, String gcmIdDestino,
        String applicationArn) {/* w w w  .ja  va2s.c o m*/
    CreatePlatformEndpointRequest platformEndpointRequest = new CreatePlatformEndpointRequest();
    platformEndpointRequest.setCustomUserData(customData);
    String token = gcmIdDestino;
    platformEndpointRequest.setToken(token);
    platformEndpointRequest.setPlatformApplicationArn(applicationArn);
    return snsClient.createPlatformEndpoint(platformEndpointRequest);
}

From source file:tools.AmazonSNSClientWrapper.java

License:Open Source License

private CreatePlatformEndpointResult createPlatformEndpoint(Platform platform, String customData,
        String platformToken, String applicationArn) {

    CreatePlatformEndpointRequest platformEndpointRequest = new CreatePlatformEndpointRequest();
    platformEndpointRequest.setCustomUserData(customData);
    platformEndpointRequest.setToken(platformToken);
    platformEndpointRequest.setPlatformApplicationArn(applicationArn);
    return snsClient.createPlatformEndpoint(platformEndpointRequest);
}