/** * List the Origin Access Identities in a CloudFront account. * * @return List of {@link OriginAccessIdentity} objects describing the identities. * @throws CloudFrontServiceException */ public List<OriginAccessIdentity> getOriginAccessIdentityList() throws CloudFrontServiceException { if(log.isDebugEnabled()) { log.debug("Getting list of origin access identities"); } HttpGet httpMethod = new HttpGet(ENDPOINT + VERSION + ORIGIN_ACCESS_IDENTITY_URI_PATH); try { HttpResponse response = performRestRequest(httpMethod, 200); OriginAccessIdentityListHandler handler = (new CloudFrontXmlResponsesSaxParser(this.jets3tProperties)) .parseOriginAccessIdentityListResponse(response.getEntity().getContent()); return handler.getOriginAccessIdentityList(); } catch(CloudFrontServiceException e) { throw e; } catch(RuntimeException e) { throw e; } catch(Exception e) { throw new CloudFrontServiceException(e); } }
HttpResponse response = performRestRequest(httpMethod, 200); DistributionConfigHandler handler = (new CloudFrontXmlResponsesSaxParser(this.jets3tProperties))
/** * List the Origin Access Identities in a CloudFront account. * * @return List of {@link OriginAccessIdentity} objects describing the identities. * @throws CloudFrontServiceException */ public List<OriginAccessIdentity> getOriginAccessIdentityList() throws CloudFrontServiceException { if(log.isDebugEnabled()) { log.debug("Getting list of origin access identities"); } HttpGet httpMethod = new HttpGet(ENDPOINT + VERSION + ORIGIN_ACCESS_IDENTITY_URI_PATH); try { HttpResponse response = performRestRequest(httpMethod, 200); OriginAccessIdentityListHandler handler = (new CloudFrontXmlResponsesSaxParser(this.jets3tProperties)) .parseOriginAccessIdentityListResponse(response.getEntity().getContent()); return handler.getOriginAccessIdentityList(); } catch(CloudFrontServiceException e) { throw e; } catch(RuntimeException e) { throw e; } catch(Exception e) { throw new CloudFrontServiceException(e); } }
HttpResponse response = performRestRequest(httpMethod, 200);
HttpResponse response = performRestRequest(httpMethod, 200);
HttpResponse response = performRestRequest(httpMethod, 200);
HttpResponse response = performRestRequest(httpMethod, 200); DistributionHandler handler = (new CloudFrontXmlResponsesSaxParser(this.jets3tProperties))
HttpResponse response = performRestRequest(httpMethod, 200); DistributionHandler handler = (new CloudFrontXmlResponsesSaxParser(this.jets3tProperties))
HttpResponse response = performRestRequest(httpMethod, 200);
HttpResponse response = performRestRequest(httpMethod, 200); DistributionConfigHandler handler = (new CloudFrontXmlResponsesSaxParser(this.jets3tProperties))
/** * @param distributionId The distribution's unique identifier. * @param invalidationId The identifier for the invalidation request * @return Details of a prior invalidation operation. * @throws CloudFrontServiceException exception */ public Invalidation getInvalidation(String distributionId, String invalidationId) throws CloudFrontServiceException { HttpGet httpMethod = new HttpGet(ENDPOINT + VERSION + "/distribution/" + distributionId + "/invalidation/" + invalidationId); try { HttpResponse response = performRestRequest(httpMethod, 200); InvalidationHandler handler = (new CloudFrontXmlResponsesSaxParser(this.jets3tProperties)) .parseInvalidationResponse(response.getEntity().getContent()); return handler.getInvalidation(); } catch(CloudFrontServiceException e) { throw e; } catch(RuntimeException e) { throw e; } catch(Exception e) { throw new CloudFrontServiceException(e); } }
/** * @param distributionId The distribution's unique identifier. * @param invalidationId The identifier for the invalidation request * @return Details of a prior invalidation operation. * @throws CloudFrontServiceException exception */ public Invalidation getInvalidation(String distributionId, String invalidationId) throws CloudFrontServiceException { HttpGet httpMethod = new HttpGet(ENDPOINT + VERSION + "/distribution/" + distributionId + "/invalidation/" + invalidationId); try { HttpResponse response = performRestRequest(httpMethod, 200); InvalidationHandler handler = (new CloudFrontXmlResponsesSaxParser(this.jets3tProperties)) .parseInvalidationResponse(response.getEntity().getContent()); return handler.getInvalidation(); } catch(CloudFrontServiceException e) { throw e; } catch(RuntimeException e) { throw e; } catch(Exception e) { throw new CloudFrontServiceException(e); } }
HttpResponse response = performRestRequest(httpMethod, 200);
/** * Delete an Origin Access Identity. * * @param id The identifier of the Origin Access Identity. * @throws CloudFrontServiceException exception */ public void deleteOriginAccessIdentity(String id) throws CloudFrontServiceException { if(log.isDebugEnabled()) { log.debug("Deleting origin access identity with id: " + id); } // Get the identity's current config. OriginAccessIdentityConfig currentConfig = getOriginAccessIdentityConfig(id); HttpDelete httpMethod = new HttpDelete(ENDPOINT + VERSION + ORIGIN_ACCESS_IDENTITY_URI_PATH + "/" + id); try { httpMethod.setHeader("If-Match", currentConfig.getEtag()); HttpResponse response = performRestRequest(httpMethod, 204); releaseConnection(response); } catch(CloudFrontServiceException e) { throw e; } catch(RuntimeException e) { throw e; } catch(Exception e) { throw new CloudFrontServiceException(e); } }
ContentType.create("text/xml", Constants.DEFAULT_ENCODING))); HttpResponse response = performRestRequest(httpMethod, 201);
/** * Delete an Origin Access Identity. * * @param id The identifier of the Origin Access Identity. * @throws CloudFrontServiceException exception */ public void deleteOriginAccessIdentity(String id) throws CloudFrontServiceException { if(log.isDebugEnabled()) { log.debug("Deleting origin access identity with id: " + id); } // Get the identity's current config. OriginAccessIdentityConfig currentConfig = getOriginAccessIdentityConfig(id); HttpDelete httpMethod = new HttpDelete(ENDPOINT + VERSION + ORIGIN_ACCESS_IDENTITY_URI_PATH + "/" + id); try { httpMethod.setHeader("If-Match", currentConfig.getEtag()); HttpResponse response = performRestRequest(httpMethod, 204); releaseConnection(response); } catch(CloudFrontServiceException e) { throw e; } catch(RuntimeException e) { throw e; } catch(Exception e) { throw new CloudFrontServiceException(e); } }
ContentType.create("text/xml", Constants.DEFAULT_ENCODING))); HttpResponse response = performRestRequest(httpMethod, 201);
HttpResponse response = performRestRequest(httpMethod, 204); releaseConnection(response);
builder.asString(null), ContentType.create("text/xml", Constants.DEFAULT_ENCODING))); HttpResponse response = performRestRequest(httpMethod, 201);
HttpResponse response = performRestRequest(httpMethod, 204); releaseConnection(response);