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

COVERAGE SUMMARY FOR SOURCE FILE [DescribeSnapshotsOptions.java]

nameclass, %method, %block, %line, %
DescribeSnapshotsOptions.java100% (2/2)64%  (7/11)75%  (45/60)79%  (13.5/17)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class DescribeSnapshotsOptions100% (1/1)57%  (4/7)64%  (21/33)73%  (8/11)
getOwners (): Set 0%   (0/1)0%   (0/4)0%   (0/1)
getRestorableBy (): String 0%   (0/1)0%   (0/4)0%   (0/1)
getSnapshotIds (): Set 0%   (0/1)0%   (0/4)0%   (0/1)
DescribeSnapshotsOptions (): void 100% (1/1)100% (3/3)100% (2/2)
ownedBy (String []): DescribeSnapshotsOptions 100% (1/1)100% (6/6)100% (2/2)
restorableBy (String []): DescribeSnapshotsOptions 100% (1/1)100% (6/6)100% (2/2)
snapshotIds (String []): DescribeSnapshotsOptions 100% (1/1)100% (6/6)100% (2/2)
     
class DescribeSnapshotsOptions$Builder100% (1/1)75%  (3/4)89%  (24/27)86%  (6/7)
DescribeSnapshotsOptions$Builder (): void 0%   (0/1)0%   (0/3)0%   (0/1)
ownedBy (String []): DescribeSnapshotsOptions 100% (1/1)100% (8/8)100% (2/2)
restorableBy (String []): DescribeSnapshotsOptions 100% (1/1)100% (8/8)100% (2/2)
snapshotIds (String []): DescribeSnapshotsOptions 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 java.util.Set;
22 
23import org.jclouds.ec2.options.internal.BaseEC2RequestOptions;
24 
25/**
26 * Contains options supported in the Form API for the DescribeSnapshots operation. <h2>
27 * Usage</h2> The recommended way to instantiate a DescribeSnapshotsOptions object is to statically
28 * import DescribeSnapshotsOptions.Builder.* and invoke a static creation method followed by an
29 * instance mutator (if needed):
30 * <p/>
31 * <code>
32 * import static org.jclouds.ec2.options.DescribeSnapshotsOptions.Builder.*
33 * <p/>
34 * EC2Client connection = // get connection
35 * Set<Snapshot> snapshots = connection.getElasticBlockStoreServices().describeSnapshots(restorableBy("123125").snapshotIds(1000, 1004));
36 * <code>
37 * 
38 * @author Adrian Cole
39 * @see <a
40 *      href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/index.html?ApiReference-form-DescribeSnapshots.html"
41 *      />
42 */
43public class DescribeSnapshotsOptions extends BaseEC2RequestOptions {
44 
45   /**
46    * Account ID of a user that can create volumes from the snapshot.
47    * 
48    */
49   public DescribeSnapshotsOptions restorableBy(String... accountIds) {
50      indexFormValuesWithPrefix("RestorableBy", accountIds);
51      return this;
52   }
53 
54   public String getRestorableBy() {
55      return getFirstFormOrNull("RestorableBy");
56   }
57 
58   /**
59    * The ID of the Amazon EBS snapshot.
60    */
61   public DescribeSnapshotsOptions snapshotIds(String... snapshotIds) {
62      indexFormValuesWithPrefix("SnapshotId", snapshotIds);
63      return this;
64   }
65 
66   public Set<String> getSnapshotIds() {
67      return getFormValuesWithKeysPrefixedBy("SnapshotId.");
68   }
69 
70   /**
71    * Returns snapshots owned by the specified owner. Multiple owners can be specified.
72    * <p/>
73    * Valid Values: self | amazon | AWS Account ID
74    */
75   public DescribeSnapshotsOptions ownedBy(String... owners) {
76      indexFormValuesWithPrefix("Owner", owners);
77      return this;
78   }
79 
80   public Set<String> getOwners() {
81      return getFormValuesWithKeysPrefixedBy("Owner.");
82   }
83 
84   public static class Builder {
85 
86      /**
87       * @see DescribeSnapshotsOptions#restorableBy(String[] )
88       */
89      public static DescribeSnapshotsOptions restorableBy(String... accountIds) {
90         DescribeSnapshotsOptions options = new DescribeSnapshotsOptions();
91         return options.restorableBy(accountIds);
92      }
93 
94      /**
95       * @see DescribeSnapshotsOptions#snapshotIds(String[] )
96       */
97      public static DescribeSnapshotsOptions snapshotIds(String... snapshotIds) {
98         DescribeSnapshotsOptions options = new DescribeSnapshotsOptions();
99         return options.snapshotIds(snapshotIds);
100      }
101 
102      /**
103       * @see DescribeSnapshotsOptions#ownedBy(String[] )
104       */
105      public static DescribeSnapshotsOptions ownedBy(String... owners) {
106         DescribeSnapshotsOptions options = new DescribeSnapshotsOptions();
107         return options.ownedBy(owners);
108      }
109 
110   }
111}

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