EMMA Coverage Report (generated Wed Oct 26 13:47:17 EDT 2011)
[all classes][org.jclouds.compute]

COVERAGE SUMMARY FOR SOURCE FILE [RunNodesException.java]

nameclass, %method, %block, %line, %
RunNodesException.java0%   (0/1)0%   (0/7)0%   (0/94)0%   (0/14)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class RunNodesException0%   (0/1)0%   (0/7)0%   (0/94)0%   (0/14)
RunNodesException (String, int, Template, Set, Map, Map): void 0%   (0/1)0%   (0/76)0%   (0/8)
getCount (): int 0%   (0/1)0%   (0/3)0%   (0/1)
getExecutionErrors (): Map 0%   (0/1)0%   (0/3)0%   (0/1)
getNodeErrors (): Map 0%   (0/1)0%   (0/3)0%   (0/1)
getSuccessfulNodes (): Set 0%   (0/1)0%   (0/3)0%   (0/1)
getTag (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getTemplate (): Template 0%   (0/1)0%   (0/3)0%   (0/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.compute;
20 
21import static org.jclouds.compute.util.ComputeServiceUtils.createExecutionErrorMessage;
22import static org.jclouds.compute.util.ComputeServiceUtils.createNodeErrorMessage;
23 
24import java.util.Map;
25import java.util.Set;
26 
27import org.jclouds.compute.domain.NodeMetadata;
28import org.jclouds.compute.domain.Template;
29 
30/**
31 * 
32 * @author Adrian Cole
33 */
34public class RunNodesException extends Exception {
35 
36   /** The serialVersionUID */
37   private static final long serialVersionUID = -2272965726680821281L;
38   private final String tag;
39   private final int count;
40   private final Template template;
41   private final Set<? extends NodeMetadata> successfulNodes;
42   private final Map<? extends NodeMetadata, ? extends Throwable> failedNodes;
43   private final Map<?, Exception> executionExceptions;
44 
45   public RunNodesException(String tag, int count, Template template,
46            Set<? extends NodeMetadata> successfulNodes, Map<?, Exception> executionExceptions,
47            Map<? extends NodeMetadata, ? extends Throwable> failedNodes) {
48      super(
49               String
50                        .format(
51                                 "error running %d node%s tag(%s) location(%s) image(%s) size(%s) options(%s)%n%s%n%s",
52                                 count, count > 1 ? "s" : "", tag, template.getLocation().getId(),
53                                 template.getImage().getProviderId(), template.getHardware()
54                                          .getProviderId(), template.getOptions(),
55                                 createExecutionErrorMessage(executionExceptions),
56                                 createNodeErrorMessage(failedNodes)));
57      this.tag = tag;
58      this.count = count;
59      this.template = template;
60      this.successfulNodes = successfulNodes;
61      this.failedNodes = failedNodes;
62      this.executionExceptions = executionExceptions;
63   }
64 
65   /**
66    * 
67    * @return Nodes that performed startup without error
68    */
69   public Set<? extends NodeMetadata> getSuccessfulNodes() {
70      return successfulNodes;
71   }
72 
73   /**
74    * 
75    * @return Nodes that performed startup without error, but incurred problems applying options
76    */
77   public Map<?, ? extends Throwable> getExecutionErrors() {
78      return executionExceptions;
79   }
80 
81   /**
82    * 
83    * @return Nodes that performed startup without error, but incurred problems applying options
84    */
85   public Map<? extends NodeMetadata, ? extends Throwable> getNodeErrors() {
86      return failedNodes;
87   }
88 
89   public String getTag() {
90      return tag;
91   }
92 
93   public int getCount() {
94      return count;
95   }
96 
97   public Template getTemplate() {
98      return template;
99   }
100 
101}

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