EMMA Coverage Report (generated Mon Oct 17 05:41:20 EDT 2011)
[all classes][org.jclouds.rimuhosting.miro.data]

COVERAGE SUMMARY FOR SOURCE FILE [CreateOptions.java]

nameclass, %method, %block, %line, %
CreateOptions.java100% (1/1)15%  (2/13)22%  (18/80)21%  (5.8/27)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class CreateOptions100% (1/1)15%  (2/13)22%  (18/80)21%  (5.8/27)
CreateOptions (): void 0%   (0/1)0%   (0/3)0%   (0/1)
CreateOptions (String, String, Image): void 0%   (0/1)0%   (0/15)0%   (0/6)
getControlPanel (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getImageId (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getName (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getPassword (): String 0%   (0/1)0%   (0/3)0%   (0/1)
setControlPanel (String): void 0%   (0/1)0%   (0/4)0%   (0/2)
setImageId (String): void 0%   (0/1)0%   (0/4)0%   (0/2)
setName (String): void 0%   (0/1)0%   (0/4)0%   (0/2)
setPassword (String): void 0%   (0/1)0%   (0/4)0%   (0/2)
validate (): void 0%   (0/1)0%   (0/14)0%   (0/2)
<static initializer> 100% (1/1)75%  (6/8)75%  (0.8/1)
CreateOptions (String, String, String): void 100% (1/1)100% (12/12)100% (5/5)

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.rimuhosting.miro.data;
20 
21import com.google.gson.annotations.SerializedName;
22import org.jclouds.rimuhosting.miro.domain.Image;
23 
24/**
25 * Some options we need to create a new server/VPS.
26 *
27 * @author Ivan Meredith
28 */
29public class CreateOptions implements PostData{
30   public CreateOptions(){}
31   
32   public CreateOptions(String name, String password, Image image){
33           this.name = name;
34           this.password = password;
35           if(image != null){
36                   this.imageId = image.getId();
37           }
38   }
39   public CreateOptions(String name, String password, String imageId){
40           this.name = name;
41           this.password = password;
42           this.imageId = imageId;
43   }
44        /**
45    * The control panel to install on the VPS.  Currently only webmin is installable manually.
46    * Currently null/empty string works.  For none.  Or webmin.
47    * TODO: Control panels need a rest @GET interface. Or enum
48    */
49   @SerializedName("control_panel")
50   private String controlPanel;
51   /**
52    * Must be a valid Image id.
53    */
54   @SerializedName("distro")
55   private String imageId;
56   /**
57    * Must be FQDN.
58    */
59   @SerializedName("domain_name")
60   private String name;
61   /**
62    * The password to use when setting up the server.  If not provided we will set a random one.
63    */
64   private String password;
65 
66   public String getControlPanel() {
67      return controlPanel;
68   }
69 
70   public void setControlPanel(String controlPanel) {
71      this.controlPanel = controlPanel;
72   }
73 
74   public String getImageId() {
75      return imageId;
76   }
77 
78   public void setImageId(String imageId) {
79      this.imageId = imageId;
80   }
81 
82   public String getName() {
83      return name;
84   }
85 
86   public void setName(String name) {
87      this.name = name;
88   }
89 
90   public String getPassword() {
91      return password;
92   }
93 
94   public void setPassword(String password) {
95      this.password = password;
96   }
97 
98        @Override
99        public void validate() {
100                assert(imageId != null && imageId.length() != 0);
101                //TODO validation of FQDN
102        }
103}

[all classes][org.jclouds.rimuhosting.miro.data]
EMMA 2.0.5312 (C) Vladimir Roubtsov