/** * Construct a distribution configuration compatible with CloudFront API versions 2012-05-05 and later */ public StreamingDistributionConfig(Origin[] origins, String callerReference, String[] cnames, String comment, boolean enabled, LoggingStatus loggingStatus, String[] trustedSignerAwsAccountNumbers) { super(origins, callerReference, cnames, comment, enabled, loggingStatus, null, new CacheBehavior(null, false, trustedSignerAwsAccountNumbers, CacheBehavior.ViewerProtocolPolicy.ALLOW_ALL, 0L), null); }
@Override public String toString() { return "CacheBehavior" + ": pathPattern=" + getPathPattern() + ", targetOriginId=" + getTargetOriginId() + ", isForwardQueryString=" + isForwardQueryString() + ", trustedSignerAwsAccountNumbers=" + Arrays.asList(getTrustedSignerAwsAccountNumbers()) + ", viewerProtocolPolicy=" + getViewerProtocolPolicy() + ", minTTL=" + getMinTTL() ; }
public boolean hasTrustedSignerAwsAccountNumbers() { return getTrustedSignerAwsAccountNumbers() != null && getTrustedSignerAwsAccountNumbers().length > 0; }
/** * @deprecated as of 2012-05-05 API version, instead use {@link #getDefaultCacheBehavior()} */ @Deprecated public String[] getRequiredProtocols() { if(this.getDefaultCacheBehavior().getViewerProtocolPolicy() == ViewerProtocolPolicy.HTTPS_ONLY) { return new String[]{"https"}; } else { return null; } }
/** * @deprecated as of 2012-05-05 API version, instead use {@link #getDefaultCacheBehavior()} */ @Deprecated public Long getMinTTL() { return this.getDefaultCacheBehavior().getMinTTL(); }
/** * @deprecated as of 2012-05-05 API version, instead use {@link #getDefaultCacheBehavior()} */ @Deprecated public boolean isTrustedSignerSelf() { return this.getDefaultCacheBehavior().isTrustedSignerSelf(); }
/** * @deprecated as of 2012-05-05 API version, instead use {@link #getDefaultCacheBehavior()} */ @Deprecated public boolean hasMinTTL() { return this.getDefaultCacheBehavior().hasMinTTL(); }
public void endQueryString(String text) { cacheBehavior.setIsForwardQueryString(String.valueOf(true).equals(text)); }
public boolean hasTrustedSignerAwsAccountNumbers() { return getTrustedSignerAwsAccountNumbers() != null && getTrustedSignerAwsAccountNumbers().length > 0; }
/** * @deprecated as of 2012-05-05 API version, instead use {@link #getDefaultCacheBehavior()} */ @Deprecated public String[] getRequiredProtocols() { if(this.getDefaultCacheBehavior().getViewerProtocolPolicy() == ViewerProtocolPolicy.HTTPS_ONLY) { return new String[]{"https"}; } else { return null; } }
/** * @deprecated as of 2012-05-05 API version, instead use {@link #getDefaultCacheBehavior()} */ @Deprecated public Long getMinTTL() { return this.getDefaultCacheBehavior().getMinTTL(); }
/** * @deprecated as of 2012-05-05 API version, instead use {@link #getDefaultCacheBehavior()} */ @Deprecated public boolean isTrustedSignerSelf() { return this.getDefaultCacheBehavior().isTrustedSignerSelf(); }
/** * @deprecated as of 2012-05-05 API version, instead use {@link #getDefaultCacheBehavior()} */ @Deprecated public boolean hasMinTTL() { return this.getDefaultCacheBehavior().hasMinTTL(); }
public void endQueryString(String text) { cacheBehavior.setIsForwardQueryString(String.valueOf(true).equals(text)); }
@Override public String toString() { return "CacheBehavior" + ": pathPattern=" + getPathPattern() + ", targetOriginId=" + getTargetOriginId() + ", isForwardQueryString=" + isForwardQueryString() + ", trustedSignerAwsAccountNumbers=" + Arrays.asList(getTrustedSignerAwsAccountNumbers()) + ", viewerProtocolPolicy=" + getViewerProtocolPolicy() + ", minTTL=" + getMinTTL() ; }
public boolean isTrustedSignerSelf() { for (String trustedSigner: getTrustedSignerAwsAccountNumbers()) { if ("self".equals(trustedSigner)) { return true; } } return false; }
/** * Construct a distribution configuration compatible with CloudFront API versions 2012-05-05 and later */ public StreamingDistributionConfig(Origin[] origins, String callerReference, String[] cnames, String comment, boolean enabled, LoggingStatus loggingStatus, String[] trustedSignerAwsAccountNumbers) { super(origins, callerReference, cnames, comment, enabled, loggingStatus, null, new CacheBehavior(null, false, trustedSignerAwsAccountNumbers, CacheBehavior.ViewerProtocolPolicy.ALLOW_ALL, 0L), null); }
itemBuilder.e("PathPattern").t(cb.getPathPattern()); if(cb.getTargetOriginId() != null) { itemBuilder.e("TargetOriginId").t(cb.getTargetOriginId()); itemBuilder.e("ForwardedValues").e("QueryString").t(String.valueOf(cb.isForwardQueryString())); itemBuilder.importXMLBuilder(buildTrustedSigners(cb.getTrustedSignerAwsAccountNumbers())); itemBuilder.e("ViewerProtocolPolicy").t(cb.getViewerProtocolPolicy().toText()); if(cb.getMinTTL() != null) { itemBuilder.e("MinTTL").t(String.valueOf(cb.getMinTTL()));
public boolean isTrustedSignerSelf() { for (String trustedSigner: getTrustedSignerAwsAccountNumbers()) { if ("self".equals(trustedSigner)) { return true; } } return false; }
/** * Construct a distribution configuration compatible with CloudFront API versions * 2012-05-05 and later (i.e. including cache behaviors and multiple origins) */ public DistributionConfig(Origin[] origins, String callerReference, String[] cnames, String comment, boolean enabled, LoggingStatus loggingStatus, String defaultRootObject, CacheBehavior defaultCacheBehavior, CacheBehavior[] cacheBehaviors) { this.origins = origins; this.callerReference = callerReference; this.cnames = null == cnames ? new String[0] : cnames; this.comment = comment; this.enabled = enabled; this.loggingStatus = loggingStatus; this.defaultRootObject = defaultRootObject; this.defaultCacheBehavior = null == defaultCacheBehavior ? new CacheBehavior() : defaultCacheBehavior; this.cacheBehaviors = null == cacheBehaviors ? new CacheBehavior[]{} : cacheBehaviors; }