use of com.amazonaws.services.sns.model.GetPlatformApplicationAttributesResult in project ETSMobile-Android2 by ApplETS.
the class CreateEndpointJob method verifyPlatformApplication.
public void verifyPlatformApplication(AmazonSNS client) {
try {
if (!listOfRegions.contains(this.region = this.applicationArn.split(":")[3])) {
System.err.println("[ERROR] The region " + region + " is invalid");
System.exit(MALFORMED_PROPERTIES_ERROR_CODE);
}
} catch (ArrayIndexOutOfBoundsException aioobe) {
System.err.println("[ERROR] The ARN " + this.applicationArn + " is malformed");
System.exit(MALFORMED_PROPERTIES_ERROR_CODE);
}
client.setEndpoint("https://sns." + this.region + ".amazonaws.com/");
try {
GetPlatformApplicationAttributesRequest applicationAttributesRequest = new GetPlatformApplicationAttributesRequest();
applicationAttributesRequest.setPlatformApplicationArn(this.applicationArn);
@SuppressWarnings("unused") GetPlatformApplicationAttributesResult getAttributesResult = client.getPlatformApplicationAttributes(applicationAttributesRequest);
} catch (NotFoundException nfe) {
System.err.println("[ERROR: APP NOT FOUND] The application ARN provided: " + this.applicationArn + " does not correspond to any existing platform applications. " + nfe.getMessage());
System.exit(NOT_FOUND_ERROR_CODE);
} catch (InvalidParameterException ipe) {
System.err.println("[ERROR: APP ARN INVALID] The application ARN provided: " + this.applicationArn + " is malformed" + ipe.getMessage());
System.exit(NOT_FOUND_ERROR_CODE);
}
}
Aggregations