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

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

Introduction

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

Prototype

CreatePlatformEndpointRequest

Source Link

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;/*from  w ww.  ja v a2s .  c  o m*/
    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  ww w  .j a v  a2 s .  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.cloudbees.gasp.services.SNSMobile.java

License:Open Source License

public CreatePlatformEndpointResult createPlatformEndpoint(String customData, String platformToken,
        String applicationArn) {/*from   w  w w  . j a v  a  2  s . co  m*/
    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 w  ww. ja 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.easarrive.aws.plugins.common.service.impl.SNSService.java

License:Open Source License

/**
 * {@inheritDoc}//w w  w.j  av a 2s  .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;//from   w w  w.  j a v a  2 s .  co m
    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) {// ww w  . j  av  a  2  s  . co 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);
}