test_class.declarator: rackGenerator
test_class.modifier: private
test_class.original_string: private RackGenerator rackGenerator;
test_class.type: RackGenerator
test_class.var_name: rackGenerator
test_class.declarator: enterpriseGenerator
test_class.modifier: private
test_class.original_string: private EnterpriseGenerator enterpriseGenerator;
test_class.type: EnterpriseGenerator
test_class.var_name: enterpriseGenerator
test_class.file: model/src/test/java/com/abiquo/server/core/infrastructure/DatacenterDAOTest.java
test_class.identifier: DatacenterDAOTest
test_class.superclass: extends DefaultDAOTestBase<DatacenterDAO, Datacenter>
test_case.body: @Test
      public void test_existsAnyWithName()
      {
          Assert.assertFalse(createDaoForRollbackTransaction().existsAnyWithName("INEXISTENT_NAME"));
  
          Datacenter datacenter = createUniqueEntity();
          datacenter.setName("A name");
          ds().persistAll(datacenter);
  
          Assert.assertTrue(createDaoForRollbackTransaction().existsAnyWithName("A name"));
      }
test_case.class_method_signature: DatacenterDAOTest.test_existsAnyWithName()
test_case.full_signature: @Test public void test_existsAnyWithName()
test_case.identifier: test_existsAnyWithName
test_case.invocations: assertFalse existsAnyWithName createDaoForRollbackTransaction createUniqueEntity setName persistAll ds assertTrue existsAnyWithName createDaoForRollbackTransaction
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void test_existsAnyWithName()
focal_class.declarator: BY_ENT_WITH_NETWORK =
          " select distinct ent from  VirtualDatacenter vdc, " + " VLANNetwork vn, "
              + " DatacenterLimits dcl join dcl.enterprise ent join dcl.datacenter dc"
              + " WHERE vn.network.id = vdc.network.id" + " and vdc.enterprise.id = ent.id"
              + " and vdc.datacenter.id = dc.id " + " and dc.id = :datacenter_id "
focal_class.modifier: public static final
focal_class.original_string: public static final String BY_ENT_WITH_NETWORK =
          " select distinct ent from  VirtualDatacenter vdc, " + " VLANNetwork vn, "
              + " DatacenterLimits dcl join dcl.enterprise ent join dcl.datacenter dc"
              + " WHERE vn.network.id = vdc.network.id" + " and vdc.enterprise.id = ent.id"
              + " and vdc.datacenter.id = dc.id " + " and dc.id = :datacenter_id ";
focal_class.type: String
focal_class.var_name: BY_ENT_WITH_NETWORK
focal_class.declarator: BY_ENT =
          " select distinct ent from DatacenterLimits dcl join dcl.enterprise ent join dcl.datacenter dc"
              + " WHERE dc.id = :datacenter_id "
focal_class.modifier: public static final
focal_class.original_string: public static final String BY_ENT =
          " select distinct ent from DatacenterLimits dcl join dcl.enterprise ent join dcl.datacenter dc"
              + " WHERE dc.id = :datacenter_id ";
focal_class.type: String
focal_class.var_name: BY_ENT
focal_class.declarator: SUM_VM_RESOURCES =
          "select sum(vm.cpu), sum(vm.ram), sum(vm.hd) from virtualmachine vm, hypervisor hy, physicalmachine pm "
              + " where hy.id = vm.idHypervisor and pm.idPhysicalMachine = hy.idPhysicalMachine "//
              // and pm.idState != 7" // not HA_DISABLED
              + " and pm.idDatacenter = :datacenterId and vm.idEnterprise = :enterpriseId and vm.state != 'NOT_ALLOCATED' and vm.idHypervisor is not null"
focal_class.modifier: private static final
focal_class.original_string: private static final String SUM_VM_RESOURCES =
          "select sum(vm.cpu), sum(vm.ram), sum(vm.hd) from virtualmachine vm, hypervisor hy, physicalmachine pm "
              + " where hy.id = vm.idHypervisor and pm.idPhysicalMachine = hy.idPhysicalMachine "//
              // and pm.idState != 7" // not HA_DISABLED
              + " and pm.idDatacenter = :datacenterId and vm.idEnterprise = :enterpriseId and vm.state != 'NOT_ALLOCATED' and vm.idHypervisor is not null";
focal_class.type: String
focal_class.var_name: SUM_VM_RESOURCES
focal_class.declarator: SUM_EXTRA_HD_RESOURCES =
          "select sum(r.limitResource) from rasd r, rasd_management rm, virtualdatacenter vdc, virtualmachine vm where r.instanceID = rm.idResource "
              + "and rm.idResourceType = '17' and rm.idVirtualDatacenter = vdc.idVirtualDatacenter and vdc.idDatacenter=:datacenterId "
              + "and  rm.idVM = vm.idVM and vm.state != 'NOT_ALLOCATED' and vm.idHypervisor is not null"
focal_class.modifier: private static final
focal_class.original_string: private static final String SUM_EXTRA_HD_RESOURCES =
          "select sum(r.limitResource) from rasd r, rasd_management rm, virtualdatacenter vdc, virtualmachine vm where r.instanceID = rm.idResource "
              + "and rm.idResourceType = '17' and rm.idVirtualDatacenter = vdc.idVirtualDatacenter and vdc.idDatacenter=:datacenterId "
              + "and  rm.idVM = vm.idVM and vm.state != 'NOT_ALLOCATED' and vm.idHypervisor is not null";
focal_class.type: String
focal_class.var_name: SUM_EXTRA_HD_RESOURCES
focal_class.declarator: SUM_STORAGE_RESOURCES =
          "select sum(r.limitResource) "
              + "from volume_management vm, storage_pool sp, storage_device sd, rasd_management rm, virtualdatacenter vdc, rasd r "
              + "where " + "vm.idManagement = rm.idManagement " + "and rm.idResource = r.instanceID "
              + "and vm.idStorage = sp.idStorage " + "and sp.idStorageDevice = sd.id "
              + "and sd.idDataCenter = :datacenterId "
              + "and rm.idVirtualDataCenter = vdc.idVirtualDataCenter "
              + "and vdc.idEnterprise = :enterpriseId"
focal_class.modifier: private static final
focal_class.original_string: private static final String SUM_STORAGE_RESOURCES =
          "select sum(r.limitResource) "
              + "from volume_management vm, storage_pool sp, storage_device sd, rasd_management rm, virtualdatacenter vdc, rasd r "
              + "where " + "vm.idManagement = rm.idManagement " + "and rm.idResource = r.instanceID "
              + "and vm.idStorage = sp.idStorage " + "and sp.idStorageDevice = sd.id "
              + "and sd.idDataCenter = :datacenterId "
              + "and rm.idVirtualDataCenter = vdc.idVirtualDataCenter "
              + "and vdc.idEnterprise = :enterpriseId";
focal_class.type: String
focal_class.var_name: SUM_STORAGE_RESOURCES
focal_class.declarator: COUNT_IP_RESOURCES =
          "select count(*) from ip_pool_management ipm, rasd_management rm, vlan_network vn, datacenter dc, virtualdatacenter vdc, enterprise_limits_by_datacenter el "
              + " where ipm.vlan_network_id = vn.vlan_network_id "
              + " and vn.network_id = dc.network_id "
              + " and rm.idManagement = ipm.idManagement "
              + " and rm.idVirtualDataCenter = vdc.idVirtualDataCenter "
              + " and dc.idDataCenter = :datacenterId and vdc.idEnterprise = :enterpriseId "
              + " and el.idEnterprise = vdc.idEnterprise "
              + " and el.idDataCenter = dc.idDataCenter " + " and vn.networktype = 'PUBLIC' "
focal_class.modifier: private static final
focal_class.original_string: private static final String COUNT_IP_RESOURCES =
          "select count(*) from ip_pool_management ipm, rasd_management rm, vlan_network vn, datacenter dc, virtualdatacenter vdc, enterprise_limits_by_datacenter el "
              + " where ipm.vlan_network_id = vn.vlan_network_id "
              + " and vn.network_id = dc.network_id "
              + " and rm.idManagement = ipm.idManagement "
              + " and rm.idVirtualDataCenter = vdc.idVirtualDataCenter "
              + " and dc.idDataCenter = :datacenterId and vdc.idEnterprise = :enterpriseId "
              + " and el.idEnterprise = vdc.idEnterprise "
              + " and el.idDataCenter = dc.idDataCenter " + " and vn.networktype = 'PUBLIC' ";
focal_class.type: String
focal_class.var_name: COUNT_IP_RESOURCES
focal_class.declarator: COUNT_VLAN_RESOURCES =
          "select count(*) from vlan_network vn, virtualdatacenter vdc, enterprise_limits_by_datacenter el "
              + "where vn.network_id = vdc.networktypeId and el.idDatacenter = :datacenterId and el.idEnterprise = :enterpriseId "
              + "and vdc.idEnterprise = el.idEnterprise"
focal_class.modifier: private static final
focal_class.original_string: private static final String COUNT_VLAN_RESOURCES =
          "select count(*) from vlan_network vn, virtualdatacenter vdc, enterprise_limits_by_datacenter el "
              + "where vn.network_id = vdc.networktypeId and el.idDatacenter = :datacenterId and el.idEnterprise = :enterpriseId "
              + "and vdc.idEnterprise = el.idEnterprise";
focal_class.type: String
focal_class.var_name: COUNT_VLAN_RESOURCES
focal_class.file: model/src/main/java/com/abiquo/server/core/infrastructure/DatacenterDAO.java
focal_class.identifier: DatacenterDAO
focal_class.class_method_signature: DatacenterDAO.DatacenterDAO()
focal_class.full_signature: public  DatacenterDAO()
focal_class.identifier: DatacenterDAO
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  DatacenterDAO()
focal_class.class_method_signature: DatacenterDAO.DatacenterDAO(final EntityManager entityManager)
focal_class.full_signature: public  DatacenterDAO(final EntityManager entityManager)
focal_class.identifier: DatacenterDAO
focal_class.modifiers: public
focal_class.parameters: (final EntityManager entityManager)
focal_class.signature:  DatacenterDAO(final EntityManager entityManager)
focal_class.class_method_signature: DatacenterDAO.equalName(final String name)
focal_class.full_signature: private static Criterion equalName(final String name)
focal_class.identifier: equalName
focal_class.modifiers: private static
focal_class.parameters: (final String name)
focal_class.return: Criterion
focal_class.signature: Criterion equalName(final String name)
focal_class.class_method_signature: DatacenterDAO.existsAnyWithName(final String name)
focal_class.full_signature: public boolean existsAnyWithName(final String name)
focal_class.identifier: existsAnyWithName
focal_class.modifiers: public
focal_class.parameters: (final String name)
focal_class.return: boolean
focal_class.signature: boolean existsAnyWithName(final String name)
focal_class.class_method_signature: DatacenterDAO.existsAnyOtherWithName(final Datacenter datacenter, final String name)
focal_class.full_signature: public boolean existsAnyOtherWithName(final Datacenter datacenter, final String name)
focal_class.identifier: existsAnyOtherWithName
focal_class.modifiers: public
focal_class.parameters: (final Datacenter datacenter, final String name)
focal_class.return: boolean
focal_class.signature: boolean existsAnyOtherWithName(final Datacenter datacenter, final String name)
focal_class.class_method_signature: DatacenterDAO.getCurrentResourcesAllocated(final int datacenterId,
          final int enterpriseId)
focal_class.full_signature: public DefaultEntityCurrentUsed getCurrentResourcesAllocated(final int datacenterId,
          final int enterpriseId)
focal_class.identifier: getCurrentResourcesAllocated
focal_class.modifiers: public
focal_class.parameters: (final int datacenterId,
          final int enterpriseId)
focal_class.return: DefaultEntityCurrentUsed
focal_class.signature: DefaultEntityCurrentUsed getCurrentResourcesAllocated(final int datacenterId,
          final int enterpriseId)
focal_class.class_method_signature: DatacenterDAO.findEnterprisesByDatacenters(final Datacenter datacenter,
          final Integer firstElem, final Integer numElem, final Boolean network)
focal_class.full_signature: public List<Enterprise> findEnterprisesByDatacenters(final Datacenter datacenter,
          final Integer firstElem, final Integer numElem, final Boolean network)
focal_class.identifier: findEnterprisesByDatacenters
focal_class.modifiers: public
focal_class.parameters: (final Datacenter datacenter,
          final Integer firstElem, final Integer numElem, final Boolean network)
focal_class.return: List<Enterprise>
focal_class.signature: List<Enterprise> findEnterprisesByDatacenters(final Datacenter datacenter,
          final Integer firstElem, final Integer numElem, final Boolean network)
focal_class.superclass: extends DefaultDAOBase<Integer, Datacenter>
focal_method.body: public boolean existsAnyWithName(final String name)
      {
          assert !StringUtils.isEmpty(name);
  
          return this.existsAnyByCriterions(equalName(name));
      }
focal_method.class_method_signature: DatacenterDAO.existsAnyWithName(final String name)
focal_method.full_signature: public boolean existsAnyWithName(final String name)
focal_method.identifier: existsAnyWithName
focal_method.invocations: isEmpty existsAnyByCriterions equalName
focal_method.modifiers: public
focal_method.parameters: (final String name)
focal_method.return: boolean
focal_method.signature: boolean existsAnyWithName(final String name)