/**
* Abiquo community edition
* cloud management application for hybrid clouds
* Copyright (C) 2008-2010 - Abiquo Holdings S.L.
*
* This application is free software; you can redistribute it and/or
* modify it under the terms of the GNU LESSER GENERAL PUBLIC
* LICENSE as published by the Free Software Foundation under
* version 3 of the License
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* LESSER GENERAL PUBLIC LICENSE v.3 for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
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.pojo.infrastructure.Rack;
import com.abiquo.abiserver.pojo.networking.VlanNetworkParameters;
/**
* Rack generated by hbm2java
*/
public class RackHB implements java.io.Serializable, IPojoHB<Rack>
{
private static final long serialVersionUID = 6425447787740392277L;
private Integer idRack;
private DatacenterHB datacenter;
private String name;
private String shortDescription;
private String largeDescription;
private Boolean haEnabled;
private Set<PhysicalmachineHB> physicalmachines = new HashSet<PhysicalmachineHB>(0);
/**
* The VLAN id min
*/
private Integer vlan_id_min;
/**
* The VLAN id max
*/
private Integer vlan_id_max;
/**
* The VLAN's id to avoid
*/
private String vlans_id_avoided;
/**
* The VLAN's per VDC
*/
private Integer vlan_per_vdc_expected;
/**
* The VLAN's networking resource security quotient
*/
private Integer NRSQ;
public RackHB()
{
}
public RackHB(DatacenterHB datacenter, String name)
{
this.datacenter = datacenter;
this.name = name;
}
public RackHB(DatacenterHB datacenter, String name, String shortDescription,
String largeDescription, Set<PhysicalmachineHB> physicalmachines)
{
this.datacenter = datacenter;
this.name = name;
this.shortDescription = shortDescription;
this.largeDescription = largeDescription;
this.physicalmachines = physicalmachines;
}
public Integer getIdRack()
{
return idRack;
}
public void setIdRack(Integer idRack)
{
this.idRack = idRack;
}
public DatacenterHB getDatacenter()
{
return datacenter;
}
public void setDatacenter(DatacenterHB datacenter)
{
this.datacenter = datacenter;
}
public String getName()
{
return name;
}
public void setName(String name)
{
this.name = name;
}
public String getShortDescription()
{
return shortDescription;
}
public void setShortDescription(String shortDescription)
{
this.shortDescription = shortDescription;
}
public String getLargeDescription()
{
return largeDescription;
}
public void setLargeDescription(String largeDescription)
{
this.largeDescription = largeDescription;
}
public Set<PhysicalmachineHB> getPhysicalmachines()
{
return physicalmachines;
}
public void setPhysicalmachines(Set<PhysicalmachineHB> physicalmachines)
{
this.physicalmachines = physicalmachines;
}
/**
* @return the vlan_id_min
*/
public Integer getVlan_id_min()
{
return vlan_id_min;
}
/**
* @param vlanIdMin the vlan_id_min to set
*/
public void setVlan_id_min(Integer vlanIdMin)
{
vlan_id_min = vlanIdMin;
}
/**
* @return the vlan_id_max
*/
public Integer getVlan_id_max()
{
return vlan_id_max;
}
/**
* @param vlanIdMax the vlan_id_max to set
*/
public void setVlan_id_max(Integer vlanIdMax)
{
vlan_id_max = vlanIdMax;
}
/**
* @return the vlans_id_avoided
*/
public String getVlans_id_avoided()
{
return vlans_id_avoided;
}
/**
* @param vlansIdAvoided the vlans_id_avoided to set
*/
public void setVlans_id_avoided(String vlansIdAvoided)
{
vlans_id_avoided = vlansIdAvoided;
}
/**
* @return the vlan_per_vdc_expected
*/
public Integer getVlan_per_vdc_expected()
{
return vlan_per_vdc_expected;
}
/**
* @param vlanPerVdcExpected the vlan_per_vdc_expected to set
*/
public void setVlan_per_vdc_expected(Integer vlanPerVdcExpected)
{
vlan_per_vdc_expected = vlanPerVdcExpected;
}
/**
* @return the nRSQ
*/
public Integer getNRSQ()
{
return NRSQ;
}
/**
* @param nRSQ the nRSQ to set
*/
public void setNRSQ(Integer nRSQ)
{
NRSQ = nRSQ;
}
public void setHaEnabled(Boolean haEnabled)
{
this.haEnabled = haEnabled;
}
public Boolean getHaEnabled()
{
return haEnabled;
}
public Rack toPojo()
{
Rack rack = new Rack();
rack.setDataCenter(datacenter.toPojo());
rack.setId(idRack);
rack.setLargeDescription(largeDescription);
rack.setName(name);
rack.setShortDescription(shortDescription);
VlanNetworkParameters vlanNetworkParameters =
new VlanNetworkParameters(getVlan_id_min(),
getVlan_id_max(),
getVlans_id_avoided(),
getNRSQ(),
getVlan_per_vdc_expected());
vlanNetworkParameters.setVlans_id_avoided(getVlans_id_avoided());
rack.setVlanNetworkParameters(vlanNetworkParameters);
rack.setHaEnabled(haEnabled);
return rack;
}
}