EMMA Coverage Report (generated Wed Aug 10 12:30:04 EDT 2011)
[all classes][org.jclouds.gogrid.compute.options]

COVERAGE SUMMARY FOR SOURCE FILE [GoGridTemplateOptions.java]

nameclass, %method, %block, %line, %
GoGridTemplateOptions.java50%  (1/2)10%  (2/20)5%   (8/161)8%   (2.5/31)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class GoGridTemplateOptions$Builder0%   (0/1)0%   (0/7)0%   (0/69)0%   (0/13)
GoGridTemplateOptions$Builder (): void 0%   (0/1)0%   (0/3)0%   (0/1)
authorizePublicKey (Payload): GoGridTemplateOptions 0%   (0/1)0%   (0/11)0%   (0/2)
blockOnPort (int, int): GoGridTemplateOptions 0%   (0/1)0%   (0/12)0%   (0/2)
inboundPorts (int []): GoGridTemplateOptions 0%   (0/1)0%   (0/11)0%   (0/2)
installPrivateKey (Payload): GoGridTemplateOptions 0%   (0/1)0%   (0/11)0%   (0/2)
runScript (Payload): GoGridTemplateOptions 0%   (0/1)0%   (0/11)0%   (0/2)
withMetadata (): GoGridTemplateOptions 0%   (0/1)0%   (0/10)0%   (0/2)
     
class GoGridTemplateOptions100% (1/1)15%  (2/13)9%   (8/92)16%  (3/19)
authorizePublicKey (Payload): GoGridTemplateOptions 0%   (0/1)0%   (0/7)0%   (0/1)
authorizePublicKey (String): GoGridTemplateOptions 0%   (0/1)0%   (0/7)0%   (0/1)
blockOnPort (int, int): GoGridTemplateOptions 0%   (0/1)0%   (0/8)0%   (0/1)
clone (): GoGridTemplateOptions 0%   (0/1)0%   (0/9)0%   (0/3)
copyTo (TemplateOptions): void 0%   (0/1)0%   (0/12)0%   (0/4)
inboundPorts (int []): GoGridTemplateOptions 0%   (0/1)0%   (0/7)0%   (0/1)
installPrivateKey (Payload): GoGridTemplateOptions 0%   (0/1)0%   (0/7)0%   (0/1)
installPrivateKey (String): GoGridTemplateOptions 0%   (0/1)0%   (0/7)0%   (0/1)
runScript (Payload): GoGridTemplateOptions 0%   (0/1)0%   (0/7)0%   (0/1)
runScript (byte []): GoGridTemplateOptions 0%   (0/1)0%   (0/7)0%   (0/1)
withMetadata (): GoGridTemplateOptions 0%   (0/1)0%   (0/6)0%   (0/1)
<static initializer> 100% (1/1)100% (5/5)100% (1/1)
GoGridTemplateOptions (): void 100% (1/1)100% (3/3)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.gogrid.compute.options;
20 
21import org.jclouds.compute.ComputeService;
22import org.jclouds.compute.options.TemplateOptions;
23import org.jclouds.io.Payload;
24 
25/**
26 * Contains options supported by the {@link ComputeService#createNodesInGroup(String, int, TemplateOptions)}
27 * and {@link ComputeService#runNodesWithTag(String, int, TemplateOptions)} operations on
28 * the <em>gogrid</em> provider.
29 * 
30 * <h2>Usage</h2>
31 * The recommended way to instantiate a {@link GoGridTemplateOptions} object is to statically
32 * import {@code GoGridTemplateOptions.*} and invoke a static creation method followed by an
33 * instance mutator (if needed):
34 * <p>
35 * <pre>
36 * import static org.jclouds.compute.options.GoGridTemplateOptions.Builder.*;
37 * ComputeService client = // get connection
38 * templateBuilder.options(inboundPorts(22, 80, 8080, 443));
39 * Set&lt;? extends NodeMetadata&gt; set = client.runNodesWithTag(tag, 2, templateBuilder.build());
40 * </pre>
41 * 
42 * TODO add GoGrid specific options
43 * 
44 * @author Adrian Cole
45 * @author Andrew Kennedy
46 */
47public class GoGridTemplateOptions extends TemplateOptions implements Cloneable {
48   @Override
49   public GoGridTemplateOptions clone() {
50      GoGridTemplateOptions options = new GoGridTemplateOptions();
51      copyTo(options);
52      return options;
53   }
54 
55   @Override
56   public void copyTo(TemplateOptions to) {
57      super.copyTo(to);
58      if (to instanceof GoGridTemplateOptions) {
59         @SuppressWarnings("unused")
60         GoGridTemplateOptions eTo = GoGridTemplateOptions.class.cast(to);
61      }
62   }
63 
64   public static final GoGridTemplateOptions NONE = new GoGridTemplateOptions();
65 
66   public static class Builder {
67      // methods that only facilitate returning the correct object type
68 
69      /**
70       * @see TemplateOptions#inboundPorts(int...)
71       */
72      public static GoGridTemplateOptions inboundPorts(int... ports) {
73         GoGridTemplateOptions options = new GoGridTemplateOptions();
74         return GoGridTemplateOptions.class.cast(options.inboundPorts(ports));
75      }
76 
77      /**
78       * @see TemplateOptions#blockOnPort(int, int)
79       */
80      public static GoGridTemplateOptions blockOnPort(int port, int seconds) {
81         GoGridTemplateOptions options = new GoGridTemplateOptions();
82         return GoGridTemplateOptions.class.cast(options.blockOnPort(port, seconds));
83      }
84 
85      /**
86       * @see TemplateOptions#runScript(Payload)
87       */
88      public static GoGridTemplateOptions runScript(Payload script) {
89         GoGridTemplateOptions options = new GoGridTemplateOptions();
90         return GoGridTemplateOptions.class.cast(options.runScript(script));
91      }
92 
93      /**
94       * @see TemplateOptions#installPrivateKey(Payload)
95       */
96      @Deprecated
97      public static GoGridTemplateOptions installPrivateKey(Payload rsaKey) {
98         GoGridTemplateOptions options = new GoGridTemplateOptions();
99         return GoGridTemplateOptions.class.cast(options.installPrivateKey(rsaKey));
100      }
101 
102      /**
103       * @see TemplateOptions#authorizePublicKey(Payload)
104       */
105      @Deprecated
106      public static GoGridTemplateOptions authorizePublicKey(Payload rsaKey) {
107         GoGridTemplateOptions options = new GoGridTemplateOptions();
108         return GoGridTemplateOptions.class.cast(options.authorizePublicKey(rsaKey));
109      }
110 
111      /**
112       * @see TemplateOptions#withMetadata()
113       */
114      public static GoGridTemplateOptions withMetadata() {
115         GoGridTemplateOptions options = new GoGridTemplateOptions();
116         return GoGridTemplateOptions.class.cast(options.withMetadata());
117      }
118   }
119 
120   // methods that only facilitate returning the correct object type
121 
122   /**
123    * @see TemplateOptions#blockOnPort(int, int)
124    */
125   @Override
126   public GoGridTemplateOptions blockOnPort(int port, int seconds) {
127      return GoGridTemplateOptions.class.cast(super.blockOnPort(port, seconds));
128   }
129 
130   /**
131    * @see TemplateOptions#inboundPorts(int...)
132    */
133   @Override
134   public GoGridTemplateOptions inboundPorts(int... ports) {
135      return GoGridTemplateOptions.class.cast(super.inboundPorts(ports));
136   }
137 
138   /**
139    * @see TemplateOptions#authorizePublicKey(String)
140    */
141   @Override
142   public GoGridTemplateOptions authorizePublicKey(String publicKey) {
143      return GoGridTemplateOptions.class.cast(super.authorizePublicKey(publicKey));
144   }
145 
146   /**
147    * @see TemplateOptions#authorizePublicKey(Payload)
148    */
149   @Override
150   @Deprecated
151   public GoGridTemplateOptions authorizePublicKey(Payload publicKey) {
152      return GoGridTemplateOptions.class.cast(super.authorizePublicKey(publicKey));
153   }
154 
155   /**
156    * @see TemplateOptions#installPrivateKey(String)
157    */
158   @Override
159   public GoGridTemplateOptions installPrivateKey(String privateKey) {
160      return GoGridTemplateOptions.class.cast(super.installPrivateKey(privateKey));
161   }
162 
163   /**
164    * @see TemplateOptions#installPrivateKey(Payload)
165    */
166   @Override
167   @Deprecated
168   public GoGridTemplateOptions installPrivateKey(Payload privateKey) {
169      return GoGridTemplateOptions.class.cast(super.installPrivateKey(privateKey));
170   }
171 
172   /**
173    * @see TemplateOptions#runScript(Payload)
174    */
175   @Override
176   public GoGridTemplateOptions runScript(Payload script) {
177      return GoGridTemplateOptions.class.cast(super.runScript(script));
178   }
179 
180   /**
181    * @see TemplateOptions#runScript(byte[])
182    */
183   @Override
184   @Deprecated
185   public GoGridTemplateOptions runScript(byte[] script) {
186      return GoGridTemplateOptions.class.cast(super.runScript(script));
187   }
188 
189   /**
190    * @see TemplateOptions#withMetadata()
191    */
192   @Override
193   public GoGridTemplateOptions withMetadata() {
194      return GoGridTemplateOptions.class.cast(super.withMetadata());
195   }
196}

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