EMMA Coverage Report (generated Fri Apr 27 15:03:37 EDT 2012)
[all classes][org.jclouds.ec2.options]

COVERAGE SUMMARY FOR SOURCE FILE [CreateImageOptions.java]

nameclass, %method, %block, %line, %
CreateImageOptions.java100% (2/2)67%  (6/9)73%  (41/56)81%  (10.5/13)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class CreateImageOptions100% (1/1)67%  (4/6)68%  (26/38)78%  (7/9)
getDescription (): String 0%   (0/1)0%   (0/4)0%   (0/1)
getNoReboot (): boolean 0%   (0/1)0%   (0/8)0%   (0/1)
<static initializer> 100% (1/1)100% (5/5)100% (1/1)
CreateImageOptions (): void 100% (1/1)100% (3/3)100% (2/2)
noReboot (): CreateImageOptions 100% (1/1)100% (8/8)100% (2/2)
withDescription (String): CreateImageOptions 100% (1/1)100% (10/10)100% (2/2)
     
class CreateImageOptions$Builder100% (1/1)67%  (2/3)83%  (15/18)80%  (4/5)
CreateImageOptions$Builder (): void 0%   (0/1)0%   (0/3)0%   (0/1)
noReboot (): CreateImageOptions 100% (1/1)100% (7/7)100% (2/2)
withDescription (String): CreateImageOptions 100% (1/1)100% (8/8)100% (2/2)

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.ec2.options;
20 
21import static com.google.common.base.Preconditions.checkNotNull;
22 
23import org.jclouds.ec2.options.internal.BaseEC2RequestOptions;
24 
25/**
26 * Contains options supported in the Form API for the CreateImage operation. <h2>
27 * Usage</h2> The recommended way to instantiate a CreateImageOptions object is to statically import
28 * CreateImageOptions.Builder.* and invoke a static creation method followed by an instance mutator
29 * (if needed):
30 * <p/>
31 * <code>
32 * import static org.jclouds.ec2.options.CreateImageOptions.Builder.*
33 * <p/>
34 * EC2Client connection = // get connection
35 * Future<Set<ImageMetadata>> images = connection.getAMIServices().createImage(withDescription("123125").noReboot());
36 * <code>
37 * 
38 * @author Adrian Cole
39 * @see <a
40 *      href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/index.html?ApiReference-form-CreateImage.html"
41 *      />
42 */
43public class CreateImageOptions extends BaseEC2RequestOptions {
44   public static final CreateImageOptions NONE = new CreateImageOptions();
45 
46   /**
47    * The description of the AMI that was provided during image creation.
48    * <p/>
49    * 
50    * Up to 255 characters
51    */
52   public CreateImageOptions withDescription(String description) {
53      formParameters.put("Description", checkNotNull(description, "description"));
54      return this;
55   }
56 
57   public String getDescription() {
58      return getFirstFormOrNull("Description");
59 
60   }
61 
62   /**
63    * By default this property is set to false, which means Amazon EC2 attempts to cleanly shut down
64    * the instance before image creation and reboots the instance afterwards. When set to true,
65    * Amazon EC2 does not shut down the instance before creating the image. When this option is
66    * used, file system integrity on the created image cannot be guaranteed.
67    */
68   public CreateImageOptions noReboot() {
69      formParameters.put("NoReboot", "true");
70      return this;
71   }
72 
73   public boolean getNoReboot() {
74      return getFirstFormOrNull("NoReboot") != null;
75   }
76 
77   public static class Builder {
78 
79      /**
80       * @see CreateImageOptions#withDescription(String )
81       */
82      public static CreateImageOptions withDescription(String description) {
83         CreateImageOptions options = new CreateImageOptions();
84         return options.withDescription(description);
85      }
86 
87      /**
88       * @see CreateImageOptions#noReboot()
89       */
90      public static CreateImageOptions noReboot() {
91         CreateImageOptions options = new CreateImageOptions();
92         return options.noReboot();
93      }
94 
95   }
96}

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