View Javadoc

1   /*
2    * JBoss, Home of Professional Open Source.
3    * Copyright 2013, Red Hat Middleware LLC, and individual contributors
4    * as indicated by the @author tags. See the copyright.txt file in the
5    * distribution for a full listing of individual contributors.
6    *
7    * This is free software; you can redistribute it and/or modify it
8    * under the terms of the GNU Lesser General Public License as
9    * published by the Free Software Foundation; either version 2.1 of
10   * the License, or (at your option) any later version.
11   *
12   * This software is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15   * Lesser General Public License for more details.
16   *
17   * You should have received a copy of the GNU Lesser General Public
18   * License along with this software; if not, write to the Free
19   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21   */
22  package org.redhat.vmtruckloader.service;
23  
24  import lombok.Data;
25  
26  
27  /**
28   * A simple POJO to hold the specification of a Virtual Machine.
29   * @author Romain Pelisse - belaran@gmail.com
30   *
31   */
32  @Data
33  public class MachineSpecification {
34  
35  	public MachineSpecification() {}
36  	
37  	public MachineSpecification(String machineName) {
38  		this.hostname = machineName;
39  	}
40  	private String env;
41  	private String hostname;
42  	private String role;
43  	private String MAC;
44  	private String ipAddress;
45  	private String VLAN;
46  	private String resourcePoolName;
47  	private String datastoreName;
48  	private String folder;
49  	private int nbCpu;
50  	private int vRAM;
51  	private int diskSize = 20;
52  	
53  	public String getVmName() {
54  		return hostname;
55  	}
56  
57  	public MachineSpecification addVLAN(String string) {
58  		this.VLAN = string;
59  		return this;		
60  	}
61  
62  	public MachineSpecification addRole(String string) {
63  		role = string;
64  		return this;
65  	}
66  	
67  	public MachineSpecification addEnv(String env) {
68  		this.env = env;
69  		return this;
70  	}
71  
72  	public MachineSpecification addIpAddress(String string) {
73  		ipAddress = string;
74  		return this;
75  	}
76  
77  	public MachineSpecification addResourcePool(String string) {
78  		resourcePoolName = string;
79  		return this;
80  	}
81  
82  	public MachineSpecification addDatastore(String datastoreName) {
83  		this.datastoreName = datastoreName;
84  		return this;
85  	}
86  
87  	public MachineSpecification addCpus(int i) {
88  		this.nbCpu = i;
89  		return this;
90  	}
91  
92  	public MachineSpecification addRam(int ram) {
93  		this.vRAM = ram;
94  		return this;
95  	}
96  
97  	public MachineSpecification addMacAddress(String macAddress) {
98  		this.MAC = macAddress;
99  		return this;
100 	}
101 }