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

COVERAGE SUMMARY FOR SOURCE FILE [Org.java]

nameclass, %method, %block, %line, %
Org.java100% (2/2)55%  (11/20)67%  (139/208)61%  (19/31)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class Org$Builder100% (1/1)67%  (8/12)56%  (69/123)63%  (12/19)
fromOrg (Org): Org$Builder 0%   (0/1)0%   (0/25)0%   (0/1)
image (Link): Org$Builder 0%   (0/1)0%   (0/9)0%   (0/2)
images (Set): Org$Builder 0%   (0/1)0%   (0/10)0%   (0/2)
vDCs (Set): Org$Builder 0%   (0/1)0%   (0/10)0%   (0/2)
Org$Builder (): void 100% (1/1)100% (9/9)100% (3/3)
build (): Org 100% (1/1)100% (18/18)100% (1/1)
description (String): Org$Builder 100% (1/1)100% (5/5)100% (2/2)
href (URI): Org$Builder 100% (1/1)100% (7/7)100% (1/1)
id (String): Org$Builder 100% (1/1)100% (7/7)100% (1/1)
name (String): Org$Builder 100% (1/1)100% (7/7)100% (1/1)
type (String): Org$Builder 100% (1/1)100% (7/7)100% (1/1)
vDC (Link): Org$Builder 100% (1/1)100% (9/9)100% (2/2)
     
class Org100% (1/1)38%  (3/8)82%  (70/85)58%  (7/12)
getDescription (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getImages (): Set 0%   (0/1)0%   (0/3)0%   (0/1)
getName (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getVDCs (): Set 0%   (0/1)0%   (0/3)0%   (0/1)
toBuilder (): Org$Builder 0%   (0/1)0%   (0/3)0%   (0/1)
Org (String, String, String, URI, String, Set, Set): void 100% (1/1)100% (24/24)100% (5/5)
builder (): Org$Builder 100% (1/1)100% (4/4)100% (1/1)
toString (): String 100% (1/1)100% (42/42)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.collect.ImmutableSet;
29import com.google.common.collect.Sets;
30 
31/**
32 * A cloud can contain one or more Organizations. There are two types of Organizations, hard-walled
33 * and soft-walled.
34 * <ul>
35 * <li>A hard-walled Organization provides a secure environment for a single tenant of a
36 * multi-tenant cloud.All resources in a hard-walled Organization are isolated from other
37 * Organizations, hard- or soft-walled,in the cloud.</li>
38 * <li>A soft-walled Organization supports access, by users who have appropriate privileges, to
39 * other soft-walled Organizations in a cloud. Soft-walled Organizations have boundaries similar to
40 * those that separate departments of a corporate entity. In such environments, the Organization
41 * controls the resources owned by a single department. Most users are restricted to the resources
42 * available in a single Organization but a few might have privileges in other Organizations, if
43 * allowed by the administrators of those Organizations.</li>
44 * </ul>
45 * 
46 * @author Adrian Cole
47 */
48public class Org extends ResourceImpl {
49   public static Builder builder() {
50      return new Builder();
51   }
52 
53   public static class Builder extends ResourceImpl.Builder {
54      private String description;
55      private Set<Link> vDCs = Sets.newLinkedHashSet();
56      private Set<Link> images = Sets.newLinkedHashSet();
57 
58      public Builder description(String description) {
59         this.description = description;
60         return this;
61      }
62 
63      public Builder vDC(Link vDC) {
64         this.vDCs.add(checkNotNull(vDC, "vDC"));
65         return this;
66      }
67 
68      public Builder vDCs(Set<Link> vDCs) {
69         this.vDCs.addAll(checkNotNull(vDCs, "vDCs"));
70         return this;
71      }
72 
73      public Builder image(Link image) {
74         this.images.add(checkNotNull(image, "image"));
75         return this;
76      }
77 
78      public Builder images(Set<Link> images) {
79         this.images.addAll(checkNotNull(images, "images"));
80         return this;
81      }
82 
83      @Override
84      public Org build() {
85         return new Org(id, name, type, href, description, vDCs, images);
86      }
87 
88      public static Builder fromOrg(Org in) {
89         return new Builder().id(in.getId()).name(in.getName()).type(in.getType()).href(in.getHref())
90               .description(in.getDescription()).images(in.getImages()).vDCs(in.getVDCs());
91      }
92 
93      @Override
94      public Builder id(String id) {
95         return Builder.class.cast(super.id(id));
96      }
97 
98      @Override
99      public Builder name(String name) {
100         return Builder.class.cast(super.name(name));
101      }
102 
103      @Override
104      public Builder type(String type) {
105         return Builder.class.cast(super.type(type));
106      }
107 
108      @Override
109      public Builder href(URI href) {
110         return Builder.class.cast(super.href(href));
111      }
112 
113   }
114 
115   @Nullable
116   private final String description;
117   private final Set<Link> vDCs;
118   private final Set<Link> images;
119 
120   public Org(String id, String name, String type, URI href, @Nullable String description, Set<Link> vDCs,
121         Set<Link> images) {
122      super(id, name, type, href);
123      this.description = description;
124      this.vDCs = ImmutableSet.copyOf(checkNotNull(vDCs, "vDCs"));
125      this.images = ImmutableSet.copyOf(checkNotNull(images, "images"));
126   }
127 
128   /**
129    * {@inheritDoc}
130    */
131   public String getName() {
132      return name;
133   }
134 
135   /**
136    * {@inheritDoc}
137    */
138   public String getDescription() {
139      return description;
140   }
141 
142   /**
143    * {@inheritDoc}
144    */
145   public Set<Link> getVDCs() {
146      return vDCs;
147   }
148 
149   /**
150    * {@inheritDoc}
151    */
152   public Set<Link> getImages() {
153      return images;
154   }
155 
156   @Override
157   public Builder toBuilder() {
158      return Builder.fromOrg(this);
159   }
160 
161   @Override
162   public String toString() {
163      return "[id=" + id + ", href=" + href + ", name=" + name + ", type=" + type + ", description=" + description
164            + ", vDCs=" + vDCs + ", images=" + images + "]";
165   }
166 
167}

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