EMMA Coverage Report (generated Mon Oct 17 05:41:20 EDT 2011)
[all classes][org.jclouds.savvis.vpdc.domain]

COVERAGE SUMMARY FOR SOURCE FILE [VDC.java]

nameclass, %method, %block, %line, %
VDC.java100% (3/3)78%  (21/27)69%  (238/345)78%  (36/46)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class VDC100% (1/1)75%  (6/8)48%  (46/96)85%  (11/13)
toBuilder (): VDC$Builder 0%   (0/1)0%   (0/3)0%   (0/1)
toString (): String 0%   (0/1)0%   (0/47)0%   (0/1)
VDC (String, String, String, URI, String, VDC$Status, Set, Set): void 100% (1/1)100% (30/30)100% (6/6)
builder (): VDC$Builder 100% (1/1)100% (4/4)100% (1/1)
getAvailableNetworks (): Set 100% (1/1)100% (3/3)100% (1/1)
getDescription (): String 100% (1/1)100% (3/3)100% (1/1)
getResourceEntities (): Set 100% (1/1)100% (3/3)100% (1/1)
getStatus (): VDC$Status 100% (1/1)100% (3/3)100% (1/1)
     
class VDC$Builder100% (1/1)77%  (10/13)64%  (85/133)76%  (16/21)
availableNetworks (Set): VDC$Builder 0%   (0/1)0%   (0/10)0%   (0/2)
fromVDC (VDC): VDC$Builder 0%   (0/1)0%   (0/28)0%   (0/1)
resourceEntities (Set): VDC$Builder 0%   (0/1)0%   (0/10)0%   (0/2)
VDC$Builder (): void 100% (1/1)100% (9/9)100% (3/3)
availableNetwork (Resource): VDC$Builder 100% (1/1)100% (9/9)100% (2/2)
build (): VDC 100% (1/1)100% (20/20)100% (1/1)
description (String): VDC$Builder 100% (1/1)100% (5/5)100% (2/2)
href (URI): VDC$Builder 100% (1/1)100% (7/7)100% (1/1)
id (String): VDC$Builder 100% (1/1)100% (7/7)100% (1/1)
name (String): VDC$Builder 100% (1/1)100% (7/7)100% (1/1)
resourceEntity (Resource): VDC$Builder 100% (1/1)100% (9/9)100% (2/2)
status (VDC$Status): VDC$Builder 100% (1/1)100% (5/5)100% (2/2)
type (String): VDC$Builder 100% (1/1)100% (7/7)100% (1/1)
     
class VDC$Status100% (1/1)83%  (5/6)92%  (107/116)75%  (9/12)
toString (): String 0%   (0/1)0%   (0/6)0%   (0/1)
fromValue (String): VDC$Status 100% (1/1)75%  (9/12)33%  (1/3)
<static initializer> 100% (1/1)100% (84/84)100% (8/8)
VDC$Status (String, int): void 100% (1/1)100% (5/5)100% (1/1)
valueOf (String): VDC$Status 100% (1/1)100% (5/5)100% (1/1)
values (): VDC$Status [] 100% (1/1)100% (4/4)100% (1/1)

1/**
2 * Licensed to jclouds, Inc. (jclouds) under one or more
3 * contributor license agreements.  See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership.  jclouds licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License.  You may obtain a copy of the License at
9 *
10 *   http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied.  See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19package org.jclouds.savvis.vpdc.domain;
20 
21import static com.google.common.base.Preconditions.checkNotNull;
22 
23import java.net.URI;
24import java.util.Set;
25 
26import org.jclouds.javax.annotation.Nullable;
27 
28import com.google.common.base.CaseFormat;
29import com.google.common.collect.ImmutableSet;
30import com.google.common.collect.Sets;
31 
32/**
33 * VDC is a virtual data center ,the API returns a list of VAPPs own by given bill site Id.
34 * 
35 * @author Adrian Cole
36 */
37public class VDC extends ResourceImpl {
38   public static Builder builder() {
39      return new Builder();
40   }
41 
42   public static class Builder extends ResourceImpl.Builder {
43      private String description;
44      private Status status;
45      private Set<Resource> resourceEntities = Sets.newLinkedHashSet();
46      private Set<Resource> availableNetworks = Sets.newLinkedHashSet();
47 
48      public Builder description(String description) {
49         this.description = description;
50         return this;
51      }
52 
53      public Builder status(Status status) {
54         this.status = status;
55         return this;
56      }
57 
58      public Builder resourceEntity(Resource resourceEntity) {
59         this.resourceEntities.add(checkNotNull(resourceEntity, "resourceEntity"));
60         return this;
61      }
62 
63      public Builder resourceEntities(Set<Resource> resourceEntities) {
64         this.resourceEntities.addAll(checkNotNull(resourceEntities, "resourceEntities"));
65         return this;
66      }
67 
68      public Builder availableNetwork(Resource availableNetwork) {
69         this.availableNetworks.add(checkNotNull(availableNetwork, "availableNetwork"));
70         return this;
71      }
72 
73      public Builder availableNetworks(Set<Resource> availableNetworks) {
74         this.availableNetworks.addAll(checkNotNull(availableNetworks, "availableNetworks"));
75         return this;
76      }
77 
78      @Override
79      public VDC build() {
80         return new VDC(id, name, type, href, description, status, resourceEntities, availableNetworks);
81      }
82 
83      public static Builder fromVDC(VDC in) {
84         return new Builder().id(in.getId()).name(in.getName()).type(in.getType()).href(in.getHref())
85               .status(in.getStatus()).description(in.getDescription()).availableNetworks(in.getAvailableNetworks())
86               .resourceEntities(in.getResourceEntities());
87      }
88 
89      @Override
90      public Builder id(String id) {
91         return Builder.class.cast(super.id(id));
92      }
93 
94      @Override
95      public Builder name(String name) {
96         return Builder.class.cast(super.name(name));
97      }
98 
99      @Override
100      public Builder type(String type) {
101         return Builder.class.cast(super.type(type));
102      }
103 
104      @Override
105      public Builder href(URI href) {
106         return Builder.class.cast(super.href(href));
107      }
108 
109   }
110 
111   public enum Status {
112      /**
113       * Savvis VPDC successfully provisioned and available for use
114       */
115      DEPLOYED,
116      /**
117       * Savvis VPDC need to be provisioned and cannot invoke any of the VCloud (post request method
118       * type) API's
119       */
120      DESIGNING,
121      /**
122       * Savvis VPDC need to be provisioned and cannot invoke any of the VCloud (post request method
123       * type) API's
124       */
125      SAVED,
126      /**
127       * Please wait for the provisioning process to complete and cannot invoke any of the VCloud
128       * (post request method type) API's
129       */
130      INQUEUE,
131      /**
132       * Please wait for the provisioning process to complete and cannot invoke any of the VCloud
133       * (post request method type) API's
134       */
135      PROVISIONING,
136      /**
137       * Please kindly contact Savvis administrator for further clarification/assistance with the
138       * respective request data. and cannot invoke any of the VCloud (post request method type)
139       * API's
140       */
141      PARTIALLY_DEPLOYED,
142      /**
143       * Please kindly contact Savvis administrator for further clarification/assistance with the
144       * respective request data and cannot invoke any of the VCloud (post request method type)
145       * API's
146       */
147      FAILED, UNRECOGNIZED;
148      @Override
149      public String toString() {
150         return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, name());
151      }
152 
153      public static Status fromValue(String status) {
154         try {
155            return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(status, "status")));
156         } catch (IllegalArgumentException e) {
157            return UNRECOGNIZED;
158         }
159      }
160   }
161 
162   @Nullable
163   private final String description;
164   private final VDC.Status status;
165   private final Set<Resource> resourceEntities;
166   private final Set<Resource> availableNetworks;
167 
168   public VDC(String id, String name, String type, URI href, @Nullable String description, VDC.Status status,
169         Set<Resource> resourceEntities, Set<Resource> availableNetworks) {
170      super(id, name, type, href);
171      this.description = description;
172      this.status = checkNotNull(status, "status");
173      this.resourceEntities = ImmutableSet.copyOf(checkNotNull(resourceEntities, "resourceEntities"));
174      this.availableNetworks = ImmutableSet.copyOf(checkNotNull(availableNetworks, "availableNetworks"));
175   }
176 
177   /**
178    * {@inheritDoc}
179    */
180   public String getDescription() {
181      return description;
182   }
183 
184   /**
185    * {@inheritDoc}
186    */
187   public VDC.Status getStatus() {
188      return status;
189   }
190 
191   /**
192    * {@inheritDoc}
193    */
194   public Set<Resource> getResourceEntities() {
195      return resourceEntities;
196   }
197 
198   /**
199    * {@inheritDoc}
200    */
201   public Set<Resource> getAvailableNetworks() {
202      return availableNetworks;
203   }
204 
205   @Override
206   public Builder toBuilder() {
207      return Builder.fromVDC(this);
208   }
209 
210   @Override
211   public String toString() {
212      return "[id=" + id + ", href=" + href + ", name=" + name + ", type=" + type + ", description=" + description
213            + ", status=" + status + ", resourceEntities=" + resourceEntities + ", availableNetworks="
214            + availableNetworks + "]";
215   }
216 
217}

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