mirror of https://github.com/apache/jclouds.git
Added CDNSslUri to CDNContainer class, updated json and unit tests
This commit is contained in:
parent
3aa47bb499
commit
e1ab195056
|
@ -40,12 +40,13 @@ public class CDNContainer implements Comparable<CDNContainer> {
|
|||
public static class Builder {
|
||||
|
||||
protected String name;
|
||||
protected boolean cdnEnabled;
|
||||
protected boolean cdn_enabled;
|
||||
protected boolean log_retention;
|
||||
protected long ttl;
|
||||
protected URI CDNUri;
|
||||
protected String referrerAcl;
|
||||
protected String useragentAcl;
|
||||
protected boolean logRetention;
|
||||
protected URI cdn_uri;
|
||||
protected URI cdn_ssl_uri;
|
||||
protected String referrer_acl;
|
||||
protected String useragent_acl;
|
||||
|
||||
/**
|
||||
* @see CDNContainer#getName()
|
||||
|
@ -58,8 +59,8 @@ public class CDNContainer implements Comparable<CDNContainer> {
|
|||
/**
|
||||
* @see CDNContainer#isCDNEnabled()
|
||||
*/
|
||||
public Builder CDNEnabled(boolean cdnEnabled) {
|
||||
this.cdnEnabled = cdnEnabled;
|
||||
public Builder CDNEnabled(boolean cdn_enabled) {
|
||||
this.cdn_enabled = cdn_enabled;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -74,61 +75,71 @@ public class CDNContainer implements Comparable<CDNContainer> {
|
|||
/**
|
||||
* @see CDNContainer#getCDNUri()
|
||||
*/
|
||||
public Builder CDNUri(URI CDNUri) {
|
||||
this.CDNUri = CDNUri;
|
||||
public Builder CDNUri(URI cdn_uri) {
|
||||
this.cdn_uri = cdn_uri;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see CDNContainer#getCDNSslUri()
|
||||
*/
|
||||
public Builder CDNSslUri(URI cdn_ssl_uri) {
|
||||
this.cdn_ssl_uri = cdn_ssl_uri;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see CDNContainer#getReferrerAcl()
|
||||
*/
|
||||
public Builder referrerAcl(String referrerAcl) {
|
||||
this.referrerAcl = referrerAcl;
|
||||
public Builder referrerAcl(String referrer_acl) {
|
||||
this.referrer_acl = referrer_acl;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see CDNContainer#getUseragentAcl()
|
||||
*/
|
||||
public Builder useragent_acl(String useragentAcl) {
|
||||
this.useragentAcl = useragentAcl;
|
||||
public Builder useragentAcl(String useragent_acl) {
|
||||
this.useragent_acl = useragent_acl;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see CDNContainer#isLogRetention()
|
||||
*/
|
||||
public Builder logRetention(boolean logRetention) {
|
||||
this.logRetention = logRetention;
|
||||
public Builder logRetention(boolean log_retention) {
|
||||
this.log_retention = log_retention;
|
||||
return this;
|
||||
}
|
||||
|
||||
public CDNContainer build() {
|
||||
return new CDNContainer(name, cdnEnabled, ttl, CDNUri, referrerAcl, useragentAcl, logRetention);
|
||||
return new CDNContainer(name, cdn_enabled, ttl, cdn_uri, cdn_ssl_uri, referrer_acl, useragent_acl, log_retention);
|
||||
}
|
||||
|
||||
public Builder fromCDNContainer(CDNContainer in) {
|
||||
return this.name(in.getName()).CDNEnabled(in.isCDNEnabled()).ttl(in.getTTL()).CDNUri(in.getCDNUri())
|
||||
.referrerAcl(in.getReferrerAcl()).useragent_acl(in.getUseragentAcl())
|
||||
.logRetention(in.isLogRetention());
|
||||
return this.name(in.getName()).CDNEnabled(in.isCDNEnabled()).ttl(in.getTTL())
|
||||
.CDNUri(in.getCDNUri()).CDNSslUri(in.getCDNSslUri()).referrerAcl(in.getReferrerAcl())
|
||||
.useragentAcl(in.getUseragentAcl()).logRetention(in.isLogRetention());
|
||||
}
|
||||
}
|
||||
|
||||
private final String name;
|
||||
private final boolean cdnEnabled;
|
||||
private final boolean logRetention;
|
||||
private final long ttl;
|
||||
private final URI CDNUri;
|
||||
private final URI CDNSslUri;
|
||||
private final String referrerAcl;
|
||||
private final String useragentAcl;
|
||||
private final boolean logRetention;
|
||||
|
||||
@ConstructorProperties({ "name", "cdn_enabled", "ttl", "cdn_uri", "referrer_acl", "useragent_acl", "log_retention" })
|
||||
@ConstructorProperties({ "name", "cdn_enabled", "ttl", "cdn_uri", "cdn_ssl_uri", "referrer_acl", "useragent_acl", "log_retention" })
|
||||
protected CDNContainer(@Nullable String name, boolean cdnEnabled, long ttl, @Nullable URI CDNUri,
|
||||
@Nullable String referrerAcl, @Nullable String useragentAcl, boolean logRetention) {
|
||||
@Nullable URI CDNSslUri, @Nullable String referrerAcl, @Nullable String useragentAcl, boolean logRetention) {
|
||||
this.name = Strings.emptyToNull(name);
|
||||
this.cdnEnabled = cdnEnabled;
|
||||
this.ttl = ttl;
|
||||
this.CDNUri = CDNUri;
|
||||
this.CDNSslUri = CDNSslUri;
|
||||
this.referrerAcl = Strings.emptyToNull(referrerAcl);
|
||||
this.useragentAcl = Strings.emptyToNull(useragentAcl);
|
||||
this.logRetention = logRetention;
|
||||
|
@ -157,6 +168,11 @@ public class CDNContainer implements Comparable<CDNContainer> {
|
|||
return this.CDNUri;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public URI getCDNSslUri() {
|
||||
return this.CDNSslUri;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getReferrerAcl() {
|
||||
return this.referrerAcl;
|
||||
|
@ -188,8 +204,8 @@ public class CDNContainer implements Comparable<CDNContainer> {
|
|||
|
||||
protected ToStringHelper string() {
|
||||
return Objects.toStringHelper(this).omitNullValues().add("name", name).add("cdnEnabled", cdnEnabled)
|
||||
.add("ttl", ttl).add("CDNUri", CDNUri).add("referrerAcl", referrerAcl).add("useragentAcl", useragentAcl)
|
||||
.add("logRetention", logRetention);
|
||||
.add("ttl", ttl).add("CDNUri", CDNUri).add("CDNSslUri", CDNSslUri).add("referrerAcl", referrerAcl)
|
||||
.add("useragentAcl", useragentAcl).add("logRetention", logRetention);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -45,11 +45,17 @@ public class CDNContainersTest extends BaseItemParserTest<FluentIterable<CDNCont
|
|||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
public FluentIterable<CDNContainer> expected() {
|
||||
return FluentIterable.from(ImmutableSet.of(
|
||||
CDNContainer.builder().name("hpcloud-blobstore.testCDNOperationsContainerWithCDN").CDNEnabled(false)
|
||||
.ttl(3600).CDNUri(URI.create("https://cdnmgmt.hpcloud.net:8080/v1/AUTH_test/")).build(),
|
||||
CDNContainer.builder().name("hpcloud-blobstore5").CDNEnabled(true).ttl(28800)
|
||||
.CDNUri(URI.create("https://cdnmgmt.hpcloud.net:8080/v1/AUTH_test/")).build(),
|
||||
CDNContainer.builder().name("hpcloud-cfcdnint.testCDNOperationsContainerWithCDN").CDNEnabled(false)
|
||||
.ttl(3600).CDNUri(URI.create("https://cdnmgmt.hpcloud.net:8080/v1/AUTH_test/")).build()));
|
||||
CDNContainer.builder().name("hpcloud-blobstore.testCDNOperationsContainerWithCDN").CDNEnabled(false).ttl(3600)
|
||||
.CDNUri(URI.create("http://h10cdf69e2913a87afe9ce721ceb35ca5.cdn.hpcloudsvc.com"))
|
||||
.CDNSslUri(URI.create("https://a248.e.akamai.net/cdn.hpcloudsvc.com/h10cdf69e2913a87afe9ce721ceb35ca5/aw2"))
|
||||
.build(),
|
||||
CDNContainer.builder().name("hpcloud-blobstore5").CDNEnabled(true).ttl(28800)
|
||||
.CDNUri(URI.create("http://h0bc2984e4ad8f8bec0ebf5b147c9fe55.cdn.hpcloudsvc.com"))
|
||||
.CDNSslUri(URI.create("https://a248.e.akamai.net/cdn.hpcloudsvc.com/h0bc2984e4ad8f8bec0ebf5b147c9fe55/aw2"))
|
||||
.build(),
|
||||
CDNContainer.builder().name("hpcloud-cfcdnint.testCDNOperationsContainerWithCDN").CDNEnabled(false).ttl(3600)
|
||||
.CDNUri(URI.create("http://h82d1ae1ee2ada5151c60e33f097294c2.cdn.hpcloudsvc.com"))
|
||||
.CDNSslUri(URI.create("https://a248.e.akamai.net/cdn.hpcloudsvc.com/h82d1ae1ee2ada5151c60e33f097294c2/aw2"))
|
||||
.build()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[
|
||||
{"name":"hpcloud-blobstore.testCDNOperationsContainerWithCDN","cdn_enabled":"false","ttl":3600,"cdn_uri":"https://cdnmgmt.hpcloud.net:8080/v1/AUTH_test/","referrer_acl":"","useragent_acl":"", "log_retention":"false"},
|
||||
{"name":"hpcloud-blobstore5","cdn_enabled":"true","ttl":28800,"cdn_uri":"https://cdnmgmt.hpcloud.net:8080/v1/AUTH_test/","referrer_acl":"","useragent_acl":"", "log_retention":"false"},
|
||||
{"name":"hpcloud-cfcdnint.testCDNOperationsContainerWithCDN","cdn_enabled":"false","ttl":3600,"cdn_uri":"https://cdnmgmt.hpcloud.net:8080/v1/AUTH_test/","referrer_acl":"","useragent_acl":"", "log_retention":"false"}
|
||||
{"name":"hpcloud-blobstore.testCDNOperationsContainerWithCDN","cdn_enabled":"false","ttl":3600,"cdn_uri":"http://h10cdf69e2913a87afe9ce721ceb35ca5.cdn.hpcloudsvc.com","cdn_ssl_uri":"https://a248.e.akamai.net/cdn.hpcloudsvc.com/h10cdf69e2913a87afe9ce721ceb35ca5/aw2","referrer_acl":"","useragent_acl":"", "log_retention":"false"},
|
||||
{"name":"hpcloud-blobstore5","cdn_enabled":"true","ttl":28800,"cdn_uri":"http://h0bc2984e4ad8f8bec0ebf5b147c9fe55.cdn.hpcloudsvc.com","cdn_ssl_uri":"https://a248.e.akamai.net/cdn.hpcloudsvc.com/h0bc2984e4ad8f8bec0ebf5b147c9fe55/aw2","referrer_acl":"","useragent_acl":"", "log_retention":"false"},
|
||||
{"name":"hpcloud-cfcdnint.testCDNOperationsContainerWithCDN","cdn_enabled":"false","ttl":3600,"cdn_uri":"http://h82d1ae1ee2ada5151c60e33f097294c2.cdn.hpcloudsvc.com","cdn_ssl_uri":"https://a248.e.akamai.net/cdn.hpcloudsvc.com/h82d1ae1ee2ada5151c60e33f097294c2/aw2","referrer_acl":"","useragent_acl":"", "log_retention":"false"}
|
||||
]
|
Loading…
Reference in New Issue