/*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is available at http://www.abiquo.com/.....
*
* The Initial Developer of the Original Code is Soluciones Grid, S.L. (www.abiquo.com),
* Consell de Cent 296, Principal 2�, 08007 Barcelona, Spain.
*
* No portions of the Code have been created by third parties.
* All Rights Reserved.
*
* Contributor(s): ______________________________________.
*
* Graphical User Interface of this software may be used under the terms
* of the Common Public Attribution License Version 1.0 (the "CPAL License",
* available at http://cpal.abiquo.com/), in which case the
* provisions of CPAL License are applicable instead of those above. In relation
* of this portions of the Code, a Legal Notice according to Exhibits A and B of
* CPAL Licence should be provided in any distribution of the corresponding Code
* to Graphical User Interface.
*/
package com.abiquo.abiserver.business.hibernate.pojohb.infrastructure;
// Generated 16-oct-2008 16:52:14 by Hibernate Tools 3.2.1.GA
import java.util.HashSet;
import java.util.Set;
import com.abiquo.abiserver.business.hibernate.pojohb.IPojoHB;
import com.abiquo.abiserver.business.hibernate.pojohb.virtualimage.VirtualimageHB;
import com.abiquo.abiserver.pojo.IPojo;
import com.abiquo.abiserver.pojo.infrastructure.HyperVisor;
import com.abiquo.abiserver.pojo.infrastructure.State;
import com.abiquo.abiserver.pojo.infrastructure.VirtualMachine;
import com.abiquo.abiserver.pojo.virtualimage.VirtualImage;
/**
* Virtualmachine generated by hbm2java
*/
public class VirtualmachineHB implements java.io.Serializable, IPojoHB
{
private static final long serialVersionUID = 8024546400260681298L;
private Integer idVm;
private HypervisorHB hypervisor;
private StateHB state;
private VirtualimageHB image;
private String uuid;
private String name;
private String description;
private Integer ram;
private Integer cpu;
private Long hd;
private Integer vdrpPort;
private String vdrpIp;
private int highDisponibility;
private Set<VirtualmachinenetworkmoduleHB> virtualmachinenetworkmodules = new HashSet<VirtualmachinenetworkmoduleHB>(0);
public VirtualmachineHB()
{
state = new StateHB();
}
public Integer getIdVm()
{
return this.idVm;
}
public void setIdVm(Integer idVm)
{
this.idVm = idVm;
}
public StateHB getState()
{
return this.state;
}
public void setState(StateHB state)
{
this.state = state;
}
public String getUuid()
{
return this.uuid;
}
public void setUuid(String uuid)
{
this.uuid = uuid;
}
public String getName()
{
return this.name;
}
public void setName(String name)
{
this.name = name;
}
public String getDescription()
{
return this.description;
}
public void setDescription(String description)
{
this.description = description;
}
public Integer getRam()
{
return this.ram;
}
public void setRam(Integer ram)
{
this.ram = ram;
}
public Integer getCpu()
{
return this.cpu;
}
public void setCpu(Integer cpu)
{
this.cpu = cpu;
}
public Long getHd()
{
return this.hd;
}
public void setHd(Long hd)
{
this.hd = hd;
}
public Integer getVdrpPort()
{
return this.vdrpPort;
}
public void setVdrpPort(Integer vdrpPort)
{
this.vdrpPort = vdrpPort;
}
public String getVdrpIp()
{
return this.vdrpIp;
}
public void setVdrpIp(String vdrpIp)
{
this.vdrpIp = vdrpIp;
}
public int getHighDisponibility()
{
return this.highDisponibility;
}
public void setHighDisponibility(int highDisponibility)
{
this.highDisponibility = highDisponibility;
}
public Set<VirtualmachinenetworkmoduleHB> getVirtualmachinenetworkmodules()
{
return this.virtualmachinenetworkmodules;
}
public void setVirtualmachinenetworkmodules(Set<VirtualmachinenetworkmoduleHB> virtualmachinenetworkmodules)
{
this.virtualmachinenetworkmodules = virtualmachinenetworkmodules;
}
public VirtualimageHB getImage()
{
return image;
}
public void setImage(VirtualimageHB image)
{
this.image = image;
}
public HypervisorHB getHypervisor()
{
return hypervisor;
}
public void setHypervisor(HypervisorHB hypervisor)
{
this.hypervisor = hypervisor;
}
public IPojo toPojo()
{
VirtualMachine virtualMachine = new VirtualMachine();
virtualMachine.setId(this.idVm);
virtualMachine.setName(this.name);
virtualMachine.setAssignedTo((HyperVisor) this.hypervisor.toPojo() );
virtualMachine.setVirtualImage((VirtualImage) this.image.toPojo());
virtualMachine.setUUID(this.uuid);
virtualMachine.setDescription(this.description);
virtualMachine.setRam(this.ram);
virtualMachine.setCpu(this.cpu);
virtualMachine.setHd(this.hd);
virtualMachine.setVdrpIP(this.vdrpIp);
virtualMachine.setVdrpPort(this.vdrpPort);
virtualMachine.setState((State) this.state.toPojo());
virtualMachine.setHighDisponibility(this.highDisponibility == 1 ? true:false);
return virtualMachine;
}
}