EMMA Coverage Report (generated Mon Dec 09 15:12:29 EST 2013)
[all classes][org.jclouds.glesys.domain]

COVERAGE SUMMARY FOR SOURCE FILE [Domain.java]

nameclass, %method, %block, %line, %
Domain.java75%  (3/4)37%  (13/35)48%  (136/286)49%  (29.4/60)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class Domain$Builder100% (1/1)36%  (5/14)40%  (53/133)32%  (8/25)
expire (int): Domain$Builder 0%   (0/1)0%   (0/6)0%   (0/2)
fromDomain (Domain): Domain$Builder 0%   (0/1)0%   (0/32)0%   (0/1)
minimum (int): Domain$Builder 0%   (0/1)0%   (0/6)0%   (0/2)
primaryNameServer (String): Domain$Builder 0%   (0/1)0%   (0/6)0%   (0/2)
refresh (int): Domain$Builder 0%   (0/1)0%   (0/6)0%   (0/2)
responsiblePerson (String): Domain$Builder 0%   (0/1)0%   (0/6)0%   (0/2)
retry (int): Domain$Builder 0%   (0/1)0%   (0/6)0%   (0/2)
ttl (int): Domain$Builder 0%   (0/1)0%   (0/6)0%   (0/2)
useGlesysNameServer (boolean): Domain$Builder 0%   (0/1)0%   (0/6)0%   (0/2)
Domain$Builder (): void 100% (1/1)100% (3/3)100% (1/1)
build (): Domain 100% (1/1)100% (29/29)100% (1/1)
createTime (Date): Domain$Builder 100% (1/1)100% (6/6)100% (2/2)
domainName (String): Domain$Builder 100% (1/1)100% (9/9)100% (2/2)
recordCount (int): Domain$Builder 100% (1/1)100% (6/6)100% (2/2)
     
class Domain100% (1/1)28%  (5/18)52%  (75/145)59%  (19.4/33)
getExpire (): int 0%   (0/1)0%   (0/3)0%   (0/1)
getMinimum (): int 0%   (0/1)0%   (0/3)0%   (0/1)
getPrimaryNameServer (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getRecordCount (): int 0%   (0/1)0%   (0/3)0%   (0/1)
getRefresh (): int 0%   (0/1)0%   (0/3)0%   (0/1)
getResponsiblePerson (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getRetry (): int 0%   (0/1)0%   (0/3)0%   (0/1)
getTtl (): int 0%   (0/1)0%   (0/3)0%   (0/1)
hashCode (): int 0%   (0/1)0%   (0/9)0%   (0/1)
isUseGlesysNameServer (): boolean 0%   (0/1)0%   (0/3)0%   (0/1)
string (): Objects$ToStringHelper 0%   (0/1)0%   (0/19)0%   (0/1)
toBuilder (): Domain$Builder 0%   (0/1)0%   (0/7)0%   (0/1)
toString (): String 0%   (0/1)0%   (0/4)0%   (0/1)
equals (Object): boolean 100% (1/1)84%  (21/25)84%  (3.4/4)
Domain (String, Date, int, GleSYSBoolean, String, String, int, int, int, int,... 100% (1/1)100% (43/43)100% (13/13)
builder (): Domain$Builder 100% (1/1)100% (5/5)100% (1/1)
getCreateTime (): Date 100% (1/1)100% (3/3)100% (1/1)
getName (): String 100% (1/1)100% (3/3)100% (1/1)
     
class Domain$10%   (0/1)100% (0/0)100% (0/0)100% (0/0)
     
class Domain$ConcreteBuilder100% (1/1)100% (3/3)100% (8/8)100% (2/2)
Domain$ConcreteBuilder (): void 100% (1/1)100% (3/3)100% (1/1)
Domain$ConcreteBuilder (Domain$1): void 100% (1/1)100% (3/3)100% (1/1)
self (): Domain$ConcreteBuilder 100% (1/1)100% (2/2)100% (1/1)

1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements.  See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License.  You may obtain a copy of the License at
8 *
9 *     http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17package org.jclouds.glesys.domain;
18 
19import static com.google.common.base.Preconditions.checkNotNull;
20 
21import java.beans.ConstructorProperties;
22import java.util.Date;
23 
24import org.jclouds.javax.annotation.Nullable;
25 
26import com.google.common.base.Objects;
27import com.google.common.base.Objects.ToStringHelper;
28 
29/**
30 * Domain data for a Glesys account.
31 *
32 * @author Adam Lowe
33 * @see <a href= "https://customer.glesys.com/api.php?a=doc#domain_list" />
34 */
35public class Domain {
36 
37   public static Builder<?> builder() {
38      return new ConcreteBuilder();
39   }
40 
41   public Builder<?> toBuilder() {
42      return new ConcreteBuilder().fromDomain(this);
43   }
44 
45   public abstract static class Builder<T extends Builder<T>> {
46      protected abstract T self();
47 
48      protected String domainName;
49      protected Date createTime;
50      protected int recordCount;
51      protected boolean useGlesysNameServer;
52      protected String primaryNameServer;
53      protected String responsiblePerson;
54      protected int ttl;
55      protected int refresh;
56      protected int retry;
57      protected int expire;
58      protected int minimum;
59 
60      /**
61       * @see Domain#getName()
62       */
63      public T domainName(String domainName) {
64         this.domainName = checkNotNull(domainName, "domainName");
65         return self();
66      }
67 
68      /**
69       * @see Domain#getCreateTime()
70       */
71      public T createTime(Date createTime) {
72         this.createTime = createTime;
73         return self();
74      }
75 
76      /**
77       * @see Domain#getRecordCount()
78       */
79      public T recordCount(int recordCount) {
80         this.recordCount = recordCount;
81         return self();
82      }
83 
84      /**
85       * @see Domain#isUseGlesysNameServer()
86       */
87      public T useGlesysNameServer(boolean useGlesysNameServer) {
88         this.useGlesysNameServer = useGlesysNameServer;
89         return self();
90      }
91 
92      /**
93       * @see Domain#getPrimaryNameServer()
94       */
95      public T primaryNameServer(String primaryNameServer) {
96         this.primaryNameServer = primaryNameServer;
97         return self();
98      }
99 
100      /**
101       * @see Domain#getResponsiblePerson()
102       */
103      public T responsiblePerson(String responsiblePerson) {
104         this.responsiblePerson = responsiblePerson;
105         return self();
106      }
107 
108      /**
109       * @see Domain#getTtl()
110       */
111      public T ttl(int ttl) {
112         this.ttl = ttl;
113         return self();
114      }
115 
116      /**
117       * @see Domain#getRefresh()
118       */
119      public T refresh(int refresh) {
120         this.refresh = refresh;
121         return self();
122      }
123 
124      /**
125       * @see Domain#getRetry()
126       */
127      public T retry(int retry) {
128         this.retry = retry;
129         return self();
130      }
131 
132      /**
133       * @see Domain#getExpire()
134       */
135      public T expire(int expire) {
136         this.expire = expire;
137         return self();
138      }
139 
140      /**
141       * @see Domain#getMinimum()
142       */
143      public T minimum(int minimum) {
144         this.minimum = minimum;
145         return self();
146      }
147 
148      public Domain build() {
149         return new Domain(domainName, createTime, recordCount, new GleSYSBoolean(useGlesysNameServer), primaryNameServer, responsiblePerson, ttl, refresh, retry, expire, minimum);
150      }
151 
152      public T fromDomain(Domain in) {
153         return this.domainName(in.getName())
154               .createTime(in.getCreateTime())
155               .recordCount(in.getRecordCount())
156               .useGlesysNameServer(in.isUseGlesysNameServer())
157               .primaryNameServer(in.getPrimaryNameServer())
158               .responsiblePerson(in.getResponsiblePerson())
159               .ttl(in.getTtl())
160               .refresh(in.getRefresh())
161               .retry(in.getRetry())
162               .expire(in.getExpire());
163      }
164   }
165 
166   private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
167      @Override
168      protected ConcreteBuilder self() {
169         return this;
170      }
171   }
172 
173   private final String domainName;
174   private final Date createTime;
175   private final int recordCount;
176   private final boolean useGlesysNameServer;
177   private final String primaryNameServer;
178   private final String responsiblePerson;
179   private final int ttl;
180   private final int refresh;
181   private final int retry;
182   private final int expire;
183   private final int minimum;
184 
185   @ConstructorProperties({
186         "domainname", "createtime", "recordcount", "usingglesysnameserver", "primarynameserver", "responsibleperson",
187         "ttl", "refresh", "retry", "expire", "minimum"
188   })
189   protected Domain(String domainName, @Nullable Date createTime, int recordCount, GleSYSBoolean useGlesysNameServer,
190                    @Nullable String primaryNameServer, @Nullable String responsiblePerson,
191                    int ttl, int refresh, int retry, int expire, int minimum) {
192      this.domainName = checkNotNull(domainName, "domainName");
193      this.createTime = createTime;
194      this.recordCount = recordCount;
195      this.useGlesysNameServer = checkNotNull(useGlesysNameServer, "useGlesysNameServer").getValue();
196      this.primaryNameServer = primaryNameServer;
197      this.responsiblePerson = responsiblePerson;
198      this.ttl = ttl;
199      this.refresh = refresh;
200      this.retry = retry;
201      this.expire = expire;
202      this.minimum = minimum;
203   }
204 
205   /**
206    * @return the domain name, ex. "jclouds.org"
207    */
208   public String getName() {
209      return this.domainName;
210   }
211 
212   /**
213    * @return the date the domain was registered with GleSYS
214    */
215   public Date getCreateTime() {
216      return this.createTime;
217   }
218 
219   /**
220    * @return the number of DNS records for this domain
221    */
222   public int getRecordCount() {
223      return this.recordCount;
224   }
225 
226   /**
227    * @return true if a GleSYS nameserver holds the records
228    */
229   public boolean isUseGlesysNameServer() {
230      return this.useGlesysNameServer;
231   }
232 
233   @Nullable
234   public String getPrimaryNameServer() {
235      return primaryNameServer;
236   }
237 
238   /**
239    * The E-mail address of the person responsible for this domain (reformatted with '.' at end).
240    */
241   @Nullable
242   public String getResponsiblePerson() {
243      return responsiblePerson;
244   }
245 
246   /**
247    * TTL (time to live). The number of seconds a domain name is cached locally before expiration and return to authoritative nameServers for updates
248    */
249   public int getTtl() {
250      return ttl;
251   }
252 
253   /**
254    * The number of seconds between update requests from secondary and slave name servers
255    */
256   public int getRefresh() {
257      return refresh;
258   }
259 
260 
261   /**
262    * The number of seconds the secondary/slave will wait before retrying when the last attempt failed
263    */
264   public int getRetry() {
265      return retry;
266   }
267 
268   /**
269    * The number of seconds a master or slave will wait before considering the data stale if it cannot reach the primary name server
270    */
271   public int getExpire() {
272      return expire;
273   }
274 
275   /**
276    * The minimum/default TTL if the domain does not specify ttl
277    *
278    * @see #getTtl()
279    */
280   public int getMinimum() {
281      return minimum;
282   }
283 
284   @Override
285   public int hashCode() {
286      return Objects.hashCode(domainName);
287   }
288 
289   @Override
290   public boolean equals(Object obj) {
291      if (this == obj) return true;
292      if (obj == null || getClass() != obj.getClass()) return false;
293      Domain that = Domain.class.cast(obj);
294      return Objects.equal(this.domainName, that.domainName);
295   }
296 
297   protected ToStringHelper string() {
298      return Objects.toStringHelper("")
299            .add("domainName", domainName).add("createTime", createTime).add("recordCount", recordCount).add("useGlesysNameServer", useGlesysNameServer);
300   }
301 
302   @Override
303   public String toString() {
304      return string().toString();
305   }
306 
307}

[all classes][org.jclouds.glesys.domain]
EMMA 2.0.5312 (C) Vladimir Roubtsov