EMMA Coverage Report (generated Wed Jun 22 19:47:49 EDT 2011)
[all classes][org.jclouds.ec2.options]

COVERAGE SUMMARY FOR SOURCE FILE [DescribeImagesOptions.java]

nameclass, %method, %block, %line, %
DescribeImagesOptions.java100% (2/2)67%  (8/12)78%  (54/69)81%  (14.5/18)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class DescribeImagesOptions100% (1/1)62%  (5/8)71%  (30/42)75%  (9/12)
getExecutableBy (): String 0%   (0/1)0%   (0/4)0%   (0/1)
getImageIds (): Set 0%   (0/1)0%   (0/4)0%   (0/1)
getOwners (): Set 0%   (0/1)0%   (0/4)0%   (0/1)
<static initializer> 100% (1/1)100% (5/5)100% (1/1)
DescribeImagesOptions (): void 100% (1/1)100% (3/3)100% (2/2)
executableBy (String): DescribeImagesOptions 100% (1/1)100% (10/10)100% (2/2)
imageIds (String []): DescribeImagesOptions 100% (1/1)100% (6/6)100% (2/2)
ownedBy (String []): DescribeImagesOptions 100% (1/1)100% (6/6)100% (2/2)
     
class DescribeImagesOptions$Builder100% (1/1)75%  (3/4)89%  (24/27)86%  (6/7)
DescribeImagesOptions$Builder (): void 0%   (0/1)0%   (0/3)0%   (0/1)
executableBy (String): DescribeImagesOptions 100% (1/1)100% (8/8)100% (2/2)
imageIds (String []): DescribeImagesOptions 100% (1/1)100% (8/8)100% (2/2)
ownedBy (String []): DescribeImagesOptions 100% (1/1)100% (8/8)100% (2/2)

1/**
2 *
3 * Copyright (C) 2011 Cloud Conscious, LLC. <info@cloudconscious.com>
4 *
5 * ====================================================================
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * 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, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 * ====================================================================
18 */
19package org.jclouds.ec2.options;
20 
21import static com.google.common.base.Preconditions.checkNotNull;
22 
23import java.util.Set;
24 
25import org.jclouds.ec2.options.internal.BaseEC2RequestOptions;
26 
27/**
28 * Contains options supported in the Form API for the DescribeImages operation. <h2>
29 * Usage</h2> The recommended way to instantiate a DescribeImagesOptions object is to statically
30 * import DescribeImagesOptions.Builder.* and invoke a static creation method followed by an
31 * instance mutator (if needed):
32 * <p/>
33 * <code>
34 * import static org.jclouds.ec2.options.DescribeImagesOptions.Builder.*
35 * <p/>
36 * EC2Client connection = // get connection
37 * Future<Set<ImageMetadata>> images = connection.getAMIServices().describeImages(executableBy("123125").imageIds(1000, 1004));
38 * <code>
39 * 
40 * @author Adrian Cole
41 * @see <a
42 *      href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/index.html?ApiReference-form-DescribeImages.html"
43 *      />
44 */
45public class DescribeImagesOptions extends BaseEC2RequestOptions {
46   public static final DescribeImagesOptions NONE = new DescribeImagesOptions();
47 
48   /**
49    * AMIs for which the specified user has explicit launch permissions.
50    * 
51    */
52   public DescribeImagesOptions executableBy(String identityId) {
53      formParameters.put("ExecutableBy", checkNotNull(identityId, "identityId"));
54      return this;
55   }
56 
57   public String getExecutableBy() {
58      return getFirstFormOrNull("ExecutableBy");
59   }
60 
61   /**
62    * AMI IDs to describe.
63    */
64   public DescribeImagesOptions imageIds(String... imageIds) {
65      indexFormValuesWithPrefix("ImageId", imageIds);
66      return this;
67   }
68 
69   public Set<String> getImageIds() {
70      return getFormValuesWithKeysPrefixedBy("ImageId.");
71   }
72 
73   /**
74    * Returns AMIs owned by the specified owner. Multiple owners can be specified.
75    */
76   public DescribeImagesOptions ownedBy(String... owners) {
77      indexFormValuesWithPrefix("Owner", owners);
78      return this;
79   }
80 
81   public Set<String> getOwners() {
82      return getFormValuesWithKeysPrefixedBy("Owner.");
83   }
84 
85   public static class Builder {
86 
87      /**
88       * @see DescribeImagesOptions#executableBy(String )
89       */
90      public static DescribeImagesOptions executableBy(String identityId) {
91         DescribeImagesOptions options = new DescribeImagesOptions();
92         return options.executableBy(identityId);
93      }
94 
95      /**
96       * @see DescribeImagesOptions#imageIds(String[] )
97       */
98      public static DescribeImagesOptions imageIds(String... imageIds) {
99         DescribeImagesOptions options = new DescribeImagesOptions();
100         return options.imageIds(imageIds);
101      }
102 
103      /**
104       * @see DescribeImagesOptions#ownedBy(String[] )
105       */
106      public static DescribeImagesOptions ownedBy(String... owners) {
107         DescribeImagesOptions options = new DescribeImagesOptions();
108         return options.ownedBy(owners);
109      }
110 
111   }
112}

[all classes][org.jclouds.ec2.options]
EMMA 2.0.5312 (C) Vladimir Roubtsov