本文整理汇总了Java中com.amazonaws.services.sns.model.CreatePlatformEndpointResult类的典型用法代码示例。如果您正苦于以下问题:Java CreatePlatformEndpointResult类的具体用法?Java CreatePlatformEndpointResult怎么用?Java CreatePlatformEndpointResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CreatePlatformEndpointResult类属于com.amazonaws.services.sns.model包,在下文中一共展示了CreatePlatformEndpointResult类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createPlatformEndpoint
import com.amazonaws.services.sns.model.CreatePlatformEndpointResult; //导入依赖的package包/类
private CreatePlatformEndpointResult createPlatformEndpoint(
Platform platform, String customData, String platformToken,
String applicationArn) {
CreatePlatformEndpointRequest platformEndpointRequest = new CreatePlatformEndpointRequest();
platformEndpointRequest.setCustomUserData(customData);
String token = platformToken;
String userId = null;
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);
}
示例2: demoNotification
import com.amazonaws.services.sns.model.CreatePlatformEndpointResult; //导入依赖的package包/类
private void demoNotification(Platform platform, String principal,
String credential, String platformToken, String applicationName){
// Create Platform Application. This corresponds to an app on a platform.
CreatePlatformApplicationResult platformApplicationResult = createPlatformApplication(
applicationName, platform, principal, credential);
System.out.println(platformApplicationResult);
// The Platform Application Arn can be used to uniquely identify the Platform Application.
String platformApplicationArn = platformApplicationResult.getPlatformApplicationArn();
// Create an Endpoint. This corresponds to an app on a device.
CreatePlatformEndpointResult platformEndpointResult = createPlatformEndpoint(
"CustomData - Useful to store endpoint specific data", platformToken, platformApplicationArn);
System.out.println(platformEndpointResult);
// Publish a push notification to an Endpoint.
PublishResult publishResult = publish(platformEndpointResult.getEndpointArn(), platform);
System.out.println("Published. MessageId="+ publishResult.getMessageId());
// Delete the Platform Application since we will no longer be using it.
deletePlatformApplication(platformApplicationArn);
}
示例3: demoNotification
import com.amazonaws.services.sns.model.CreatePlatformEndpointResult; //导入依赖的package包/类
public void demoNotification(Platform platform, String principal,
String credential, String platformToken, String applicationName,
Map<Platform, Map<String, MessageAttributeValue>> attrsMap) {
// Create Platform Application. This corresponds to an app on a
// platform.
CreatePlatformApplicationResult platformApplicationResult = createPlatformApplication(
applicationName, platform, principal, credential);
System.out.println(platformApplicationResult);
// The Platform Application Arn can be used to uniquely identify the
// Platform Application.
String platformApplicationArn = platformApplicationResult
.getPlatformApplicationArn();
// Create an Endpoint. This corresponds to an app on a device.
CreatePlatformEndpointResult platformEndpointResult = createPlatformEndpoint(
platform,
"CustomData - Useful to store endpoint specific data",
platformToken, platformApplicationArn);
System.out.println(platformEndpointResult);
// Publish a push notification to an Endpoint.
PublishResult publishResult = publish(
platformEndpointResult.getEndpointArn(), platform, attrsMap);
System.out.println("Published! \n{MessageId="
+ publishResult.getMessageId() + "}");
// Delete the Platform Application since we will no longer be using it.
deletePlatformApplication(platformApplicationArn);
}
示例4: createPlatformArn
import com.amazonaws.services.sns.model.CreatePlatformEndpointResult; //导入依赖的package包/类
public String createPlatformArn(AmazonSNS snsClient, String platformApplicationArn, String token, User user) {
CreatePlatformEndpointRequest platformEndpointRequest = new CreatePlatformEndpointRequest();
platformEndpointRequest.setPlatformApplicationArn(platformApplicationArn);
platformEndpointRequest.setToken(token);
String customUserData = getCustomUserData(user);
platformEndpointRequest.setCustomUserData(customUserData);
CreatePlatformEndpointResult platformEndpointResult = snsClient.createPlatformEndpoint(platformEndpointRequest);
return platformEndpointResult.getEndpointArn();
}
示例5: createPlatformEndpoint
import com.amazonaws.services.sns.model.CreatePlatformEndpointResult; //导入依赖的package包/类
@Override
public PlatformEndpoint createPlatformEndpoint(CreatePlatformEndpointRequest
request, ResultCapture<CreatePlatformEndpointResult> extractor) {
ActionResult result = resource.performAction("CreatePlatformEndpoint",
request, extractor);
if (result == null) return null;
return new PlatformEndpointImpl(result.getResource());
}
示例6: starterNotification
import com.amazonaws.services.sns.model.CreatePlatformEndpointResult; //导入依赖的package包/类
public void starterNotification(Platform platform, String principal,
String credential, String platformToken, String applicationName,
Map<Platform, Map<String, MessageAttributeValue>> attrsMap, String message) {
// Create Platform Application. This corresponds to an app on a
// platform.
CreatePlatformApplicationResult platformApplicationResult = createPlatformApplication(
applicationName, platform, principal, credential);
System.out.println(platformApplicationResult);
// The Platform Application Arn can be used to uniquely identify the
// Platform Application.
String platformApplicationArn = platformApplicationResult
.getPlatformApplicationArn();
// Create an Endpoint. This corresponds to an app on a device.
CreatePlatformEndpointResult platformEndpointResult = createPlatformEndpoint(
platform,
"CustomData - Useful to store endpoint specific data",
platformToken, platformApplicationArn);
System.out.println(platformEndpointResult);
// Publish a push notification to an Endpoint.
PublishResult publishResult = publish(
platformEndpointResult.getEndpointArn(), platform, attrsMap, message);
System.out.println("Published! \n{MessageId="
+ publishResult.getMessageId() + "}");
// Delete the Platform Application since we will no longer be using it.
deletePlatformApplication(platformApplicationArn);
}
示例7: createPlatformEndpoint
import com.amazonaws.services.sns.model.CreatePlatformEndpointResult; //导入依赖的package包/类
private CreatePlatformEndpointResult createPlatformEndpoint(
String customData, String platformToken, String applicationArn) {
CreatePlatformEndpointRequest platformEndpointRequest = new CreatePlatformEndpointRequest();
platformEndpointRequest.setCustomUserData(customData);
platformEndpointRequest.setToken(platformToken);
platformEndpointRequest.setPlatformApplicationArn(applicationArn);
return snsClient.createPlatformEndpoint(platformEndpointRequest);
}
示例8: createPlatformEndpoint
import com.amazonaws.services.sns.model.CreatePlatformEndpointResult; //导入依赖的package包/类
/**
* Performs the <code>CreatePlatformEndpoint</code> action and use a
* ResultCapture to retrieve the low-level client response.
*
* <p>
* The following request parameters will be populated from the data of this
* <code>PlatformApplication</code> resource, and any conflicting parameter
* value set in the request will be overridden:
* <ul>
* <li>
* <b><code>PlatformApplicationArn</code></b>
* - mapped from the <code>Arn</code> identifier.
* </li>
* </ul>
*
* <p>
*
* @return The <code>PlatformEndpoint</code> resource object associated with
* the result of this action.
* @see CreatePlatformEndpointRequest
*/
PlatformEndpoint createPlatformEndpoint(CreatePlatformEndpointRequest
request, ResultCapture<CreatePlatformEndpointResult> extractor);