test_class.declarator: vdcGenerator
test_class.modifier: private
test_class.original_string: private VirtualDatacenterGenerator vdcGenerator;
test_class.type: VirtualDatacenterGenerator
test_class.var_name: vdcGenerator
test_class.declarator: poolGenerator
test_class.modifier: private
test_class.original_string: private StoragePoolGenerator poolGenerator;
test_class.type: StoragePoolGenerator
test_class.var_name: poolGenerator
test_class.declarator: vmGenerator
test_class.modifier: private
test_class.original_string: private VirtualMachineGenerator vmGenerator;
test_class.type: VirtualMachineGenerator
test_class.var_name: vmGenerator
test_class.declarator: vappGenerator
test_class.modifier: private
test_class.original_string: private VirtualApplianceGenerator vappGenerator;
test_class.type: VirtualApplianceGenerator
test_class.var_name: vappGenerator
test_class.file: model/src/test/java/com/abiquo/server/core/infrastructure/storage/VolumeManagementDAOTest.java
test_class.identifier: VolumeManagementDAOTest
test_class.superclass: extends
      DefaultDAOTestBase<VolumeManagementDAO, VolumeManagement>
test_case.body: @Test
      public void testGetStatefulCandidatesWithNormalPool()
      {
          StoragePool pool = poolGenerator.createUniqueInstance();
          VolumeManagement volume = eg().createInstance(pool);
  
          pool.getDevice().setStorageTechnology(StorageTechnologyType.NEXENTA);
  
          List<Object> entitiesToPersist = new ArrayList<Object>();
          eg().addAuxiliaryEntitiesToPersist(volume, entitiesToPersist);
          persistAll(ds(), entitiesToPersist, volume);
  
          VolumeManagementDAO dao = createDaoForRollbackTransaction();
  
          List<VolumeManagement> results = dao.getStatefulCandidates(volume.getVirtualDatacenter());
  
          assertEmpty(results);
      }
test_case.class_method_signature: VolumeManagementDAOTest.testGetStatefulCandidatesWithNormalPool()
test_case.full_signature: @Test public void testGetStatefulCandidatesWithNormalPool()
test_case.identifier: testGetStatefulCandidatesWithNormalPool
test_case.invocations: createUniqueInstance createInstance eg setStorageTechnology getDevice addAuxiliaryEntitiesToPersist eg persistAll ds createDaoForRollbackTransaction getStatefulCandidates getVirtualDatacenter assertEmpty
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetStatefulCandidatesWithNormalPool()
focal_class.declarator: SQL_VOLUME_MANAGEMENT_GET_VOLUMES_FROM_ENTERPRISE =
          "select volman.idManagement as idman, vdc.name as vdcname, virtualapp.name as vaname, "
              + "virtualmachine.name as vmname, rasd.limitResource as size, "
              + "rasd.reservation as available, volman.usedSize as used, "
              + "rasd.elementName as elementname, volman.state as state, tier.name as tier "
              + "from (volume_management volman, virtualdatacenter vdc, rasd, rasd_management rasdm) "
              + "left join virtualmachine on rasdm.idVM = virtualmachine.idVM "
              + "left join virtualapp on rasdm.idVirtualApp = virtualapp.idVirtualApp "
              + "left join storage_pool on volman.idStorage = storage_pool.idStorage "
              + "left join tier on storage_pool.idTier = tier.id "
              + "where "
              + "volman.idManagement = rasdm.idManagement "
              + "and rasdm.idResource = rasd.instanceID "
              + "and rasdm.idVirtualDataCenter = vdc.idVirtualDataCenter "
              + "and vdc.idEnterprise = :idEnterprise "
              + "and ( "
              + "rasd.elementName like :filterLike "
              + "or virtualmachine.name like :filterLike "
              + "or virtualapp.name like :filterLike "
              + "or vdc.name like :filterLike "
              + "or tier.name like :filterLike "
              + ") "
              + "union "
              + "select volman.idManagement as idman, '' as vdcname, '' as vaname, '' as vmname, "
              + "rasd.limitResource as size, rasd.reservation as available, volman.usedSize as used, "
              + "rasd.elementName as elementname, volman.state as state, tier.name as tier "
              + "from (volume_management volman, virtualimage vi, rasd, rasd_management rasdm) "
              + "left join storage_pool on volman.idStorage = storage_pool.idStorage "
              + "left join tier on storage_pool.idTier = tier.id " + "where "
              + "volman.idImage = vi.idImage " + "and volman.idManagement = rasdm.idManagement "
              + "and rasdm.idResource = rasd.instanceID " + "and rasdm.idVirtualDataCenter is null "
              + "and rasdm.idVirtualApp is null " + "and rasdm.idVM is null "
              + "and vi.idEnterprise = :idEnterprise " + "and (rasd.elementName like :filterLike "
              + "or tier.name like :filterLike )"
focal_class.modifier: private final
focal_class.original_string: private final String SQL_VOLUME_MANAGEMENT_GET_VOLUMES_FROM_ENTERPRISE =
          "select volman.idManagement as idman, vdc.name as vdcname, virtualapp.name as vaname, "
              + "virtualmachine.name as vmname, rasd.limitResource as size, "
              + "rasd.reservation as available, volman.usedSize as used, "
              + "rasd.elementName as elementname, volman.state as state, tier.name as tier "
              + "from (volume_management volman, virtualdatacenter vdc, rasd, rasd_management rasdm) "
              + "left join virtualmachine on rasdm.idVM = virtualmachine.idVM "
              + "left join virtualapp on rasdm.idVirtualApp = virtualapp.idVirtualApp "
              + "left join storage_pool on volman.idStorage = storage_pool.idStorage "
              + "left join tier on storage_pool.idTier = tier.id "
              + "where "
              + "volman.idManagement = rasdm.idManagement "
              + "and rasdm.idResource = rasd.instanceID "
              + "and rasdm.idVirtualDataCenter = vdc.idVirtualDataCenter "
              + "and vdc.idEnterprise = :idEnterprise "
              + "and ( "
              + "rasd.elementName like :filterLike "
              + "or virtualmachine.name like :filterLike "
              + "or virtualapp.name like :filterLike "
              + "or vdc.name like :filterLike "
              + "or tier.name like :filterLike "
              + ") "
              + "union "
              + "select volman.idManagement as idman, '' as vdcname, '' as vaname, '' as vmname, "
              + "rasd.limitResource as size, rasd.reservation as available, volman.usedSize as used, "
              + "rasd.elementName as elementname, volman.state as state, tier.name as tier "
              + "from (volume_management volman, virtualimage vi, rasd, rasd_management rasdm) "
              + "left join storage_pool on volman.idStorage = storage_pool.idStorage "
              + "left join tier on storage_pool.idTier = tier.id " + "where "
              + "volman.idImage = vi.idImage " + "and volman.idManagement = rasdm.idManagement "
              + "and rasdm.idResource = rasd.instanceID " + "and rasdm.idVirtualDataCenter is null "
              + "and rasdm.idVirtualApp is null " + "and rasdm.idVM is null "
              + "and vi.idEnterprise = :idEnterprise " + "and (rasd.elementName like :filterLike "
              + "or tier.name like :filterLike )";
focal_class.type: String
focal_class.var_name: SQL_VOLUME_MANAGEMENT_GET_VOLUMES_FROM_ENTERPRISE
focal_class.file: model/src/main/java/com/abiquo/server/core/infrastructure/storage/VolumeManagementDAO.java
focal_class.identifier: VolumeManagementDAO
focal_class.class_method_signature: VolumeManagementDAO.VolumeManagementDAO()
focal_class.full_signature: public  VolumeManagementDAO()
focal_class.identifier: VolumeManagementDAO
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  VolumeManagementDAO()
focal_class.class_method_signature: VolumeManagementDAO.VolumeManagementDAO(final EntityManager entityManager)
focal_class.full_signature: public  VolumeManagementDAO(final EntityManager entityManager)
focal_class.identifier: VolumeManagementDAO
focal_class.modifiers: public
focal_class.parameters: (final EntityManager entityManager)
focal_class.signature:  VolumeManagementDAO(final EntityManager entityManager)
focal_class.class_method_signature: VolumeManagementDAO.getVolumesByPool(final StoragePool sp)
focal_class.full_signature: public List<VolumeManagement> getVolumesByPool(final StoragePool sp)
focal_class.identifier: getVolumesByPool
focal_class.modifiers: public
focal_class.parameters: (final StoragePool sp)
focal_class.return: List<VolumeManagement>
focal_class.signature: List<VolumeManagement> getVolumesByPool(final StoragePool sp)
focal_class.class_method_signature: VolumeManagementDAO.getVolumesByVirtualDatacenter(final VirtualDatacenter vdc)
focal_class.full_signature: public List<VolumeManagement> getVolumesByVirtualDatacenter(final VirtualDatacenter vdc)
focal_class.identifier: getVolumesByVirtualDatacenter
focal_class.modifiers: public
focal_class.parameters: (final VirtualDatacenter vdc)
focal_class.return: List<VolumeManagement>
focal_class.signature: List<VolumeManagement> getVolumesByVirtualDatacenter(final VirtualDatacenter vdc)
focal_class.class_method_signature: VolumeManagementDAO.getVolumeByVirtualDatacenter(final VirtualDatacenter vdc,
          final Integer volumeId)
focal_class.full_signature: public VolumeManagement getVolumeByVirtualDatacenter(final VirtualDatacenter vdc,
          final Integer volumeId)
focal_class.identifier: getVolumeByVirtualDatacenter
focal_class.modifiers: public
focal_class.parameters: (final VirtualDatacenter vdc,
          final Integer volumeId)
focal_class.return: VolumeManagement
focal_class.signature: VolumeManagement getVolumeByVirtualDatacenter(final VirtualDatacenter vdc,
          final Integer volumeId)
focal_class.class_method_signature: VolumeManagementDAO.getStatefulCandidates(final VirtualDatacenter vdc)
focal_class.full_signature: public List<VolumeManagement> getStatefulCandidates(final VirtualDatacenter vdc)
focal_class.identifier: getStatefulCandidates
focal_class.modifiers: public
focal_class.parameters: (final VirtualDatacenter vdc)
focal_class.return: List<VolumeManagement>
focal_class.signature: List<VolumeManagement> getStatefulCandidates(final VirtualDatacenter vdc)
focal_class.class_method_signature: VolumeManagementDAO.getVolumesFromEnterprise(final Integer idEnterprise)
focal_class.full_signature: public List<VolumeManagement> getVolumesFromEnterprise(final Integer idEnterprise)
focal_class.identifier: getVolumesFromEnterprise
focal_class.modifiers: public
focal_class.parameters: (final Integer idEnterprise)
focal_class.return: List<VolumeManagement>
focal_class.signature: List<VolumeManagement> getVolumesFromEnterprise(final Integer idEnterprise)
focal_class.class_method_signature: VolumeManagementDAO.getVolumesByPool(final StoragePool sp, final FilterOptions filters)
focal_class.full_signature: @SuppressWarnings("unchecked") public List<VolumeManagement> getVolumesByPool(final StoragePool sp, final FilterOptions filters)
focal_class.identifier: getVolumesByPool
focal_class.modifiers: @SuppressWarnings("unchecked") public
focal_class.parameters: (final StoragePool sp, final FilterOptions filters)
focal_class.return: List<VolumeManagement>
focal_class.signature: List<VolumeManagement> getVolumesByPool(final StoragePool sp, final FilterOptions filters)
focal_class.class_method_signature: VolumeManagementDAO.getVolumesByVirtualDatacenter(final VirtualDatacenter vdc,
          final FilterOptions filters)
focal_class.full_signature: @SuppressWarnings("unchecked") public List<VolumeManagement> getVolumesByVirtualDatacenter(final VirtualDatacenter vdc,
          final FilterOptions filters)
focal_class.identifier: getVolumesByVirtualDatacenter
focal_class.modifiers: @SuppressWarnings("unchecked") public
focal_class.parameters: (final VirtualDatacenter vdc,
          final FilterOptions filters)
focal_class.return: List<VolumeManagement>
focal_class.signature: List<VolumeManagement> getVolumesByVirtualDatacenter(final VirtualDatacenter vdc,
          final FilterOptions filters)
focal_class.class_method_signature: VolumeManagementDAO.getVolumesByEnterprise(final Integer id,
          final FilterOptions filters)
focal_class.full_signature: public List<VolumeManagement> getVolumesByEnterprise(final Integer id,
          final FilterOptions filters)
focal_class.identifier: getVolumesByEnterprise
focal_class.modifiers: public
focal_class.parameters: (final Integer id,
          final FilterOptions filters)
focal_class.return: List<VolumeManagement>
focal_class.signature: List<VolumeManagement> getVolumesByEnterprise(final Integer id,
          final FilterOptions filters)
focal_class.class_method_signature: VolumeManagementDAO.getAvailableVolumes(final VirtualDatacenter vdc,
          final FilterOptions filters)
focal_class.full_signature: @SuppressWarnings("unchecked") public List<VolumeManagement> getAvailableVolumes(final VirtualDatacenter vdc,
          final FilterOptions filters)
focal_class.identifier: getAvailableVolumes
focal_class.modifiers: @SuppressWarnings("unchecked") public
focal_class.parameters: (final VirtualDatacenter vdc,
          final FilterOptions filters)
focal_class.return: List<VolumeManagement>
focal_class.signature: List<VolumeManagement> getAvailableVolumes(final VirtualDatacenter vdc,
          final FilterOptions filters)
focal_class.class_method_signature: VolumeManagementDAO.getVolumeFromImage(final Integer idImage)
focal_class.full_signature: public VolumeManagement getVolumeFromImage(final Integer idImage)
focal_class.identifier: getVolumeFromImage
focal_class.modifiers: public
focal_class.parameters: (final Integer idImage)
focal_class.return: VolumeManagement
focal_class.signature: VolumeManagement getVolumeFromImage(final Integer idImage)
focal_class.class_method_signature: VolumeManagementDAO.getSQLQueryResults(final Session session, final Query query,
          final Class<T> objectClass, final int idFieldPosition)
focal_class.full_signature: @SuppressWarnings("unchecked") private List<T> getSQLQueryResults(final Session session, final Query query,
          final Class<T> objectClass, final int idFieldPosition)
focal_class.identifier: getSQLQueryResults
focal_class.modifiers: @SuppressWarnings("unchecked") private
focal_class.parameters: (final Session session, final Query query,
          final Class<T> objectClass, final int idFieldPosition)
focal_class.return: List<T>
focal_class.signature: List<T> getSQLQueryResults(final Session session, final Query query,
          final Class<T> objectClass, final int idFieldPosition)
focal_class.class_method_signature: VolumeManagementDAO.defineOrderBy(final String orderBy, final Boolean asc)
focal_class.full_signature: private String defineOrderBy(final String orderBy, final Boolean asc)
focal_class.identifier: defineOrderBy
focal_class.modifiers: private
focal_class.parameters: (final String orderBy, final Boolean asc)
focal_class.return: String
focal_class.signature: String defineOrderBy(final String orderBy, final Boolean asc)
focal_class.class_method_signature: VolumeManagementDAO.sameVirtualDatacenter(final VirtualDatacenter vdc)
focal_class.full_signature: private static Criterion sameVirtualDatacenter(final VirtualDatacenter vdc)
focal_class.identifier: sameVirtualDatacenter
focal_class.modifiers: private static
focal_class.parameters: (final VirtualDatacenter vdc)
focal_class.return: Criterion
focal_class.signature: Criterion sameVirtualDatacenter(final VirtualDatacenter vdc)
focal_class.class_method_signature: VolumeManagementDAO.samePool(final StoragePool pool)
focal_class.full_signature: private static Criterion samePool(final StoragePool pool)
focal_class.identifier: samePool
focal_class.modifiers: private static
focal_class.parameters: (final StoragePool pool)
focal_class.return: Criterion
focal_class.signature: Criterion samePool(final StoragePool pool)
focal_class.class_method_signature: VolumeManagementDAO.sameId(final Integer id)
focal_class.full_signature: private static Criterion sameId(final Integer id)
focal_class.identifier: sameId
focal_class.modifiers: private static
focal_class.parameters: (final Integer id)
focal_class.return: Criterion
focal_class.signature: Criterion sameId(final Integer id)
focal_class.class_method_signature: VolumeManagementDAO.getVolumesByVirtualMachine(final VirtualMachine vm)
focal_class.full_signature: @Deprecated // use vm.getVolumes public List<VolumeManagement> getVolumesByVirtualMachine(final VirtualMachine vm)
focal_class.identifier: getVolumesByVirtualMachine
focal_class.modifiers: @Deprecated // use vm.getVolumes public
focal_class.parameters: (final VirtualMachine vm)
focal_class.return: List<VolumeManagement>
focal_class.signature: List<VolumeManagement> getVolumesByVirtualMachine(final VirtualMachine vm)
focal_class.class_method_signature: VolumeManagementDAO.getVolumesByVirtualMachine(final VirtualMachine vm,
          final FilterOptions filters)
focal_class.full_signature: public List<VolumeManagement> getVolumesByVirtualMachine(final VirtualMachine vm,
          final FilterOptions filters)
focal_class.identifier: getVolumesByVirtualMachine
focal_class.modifiers: public
focal_class.parameters: (final VirtualMachine vm,
          final FilterOptions filters)
focal_class.return: List<VolumeManagement>
focal_class.signature: List<VolumeManagement> getVolumesByVirtualMachine(final VirtualMachine vm,
          final FilterOptions filters)
focal_class.class_method_signature: VolumeManagementDAO.getAttachedVolumes(final VirtualDatacenter vdc)
focal_class.full_signature: public List<VolumeManagement> getAttachedVolumes(final VirtualDatacenter vdc)
focal_class.identifier: getAttachedVolumes
focal_class.modifiers: public
focal_class.parameters: (final VirtualDatacenter vdc)
focal_class.return: List<VolumeManagement>
focal_class.signature: List<VolumeManagement> getAttachedVolumes(final VirtualDatacenter vdc)
focal_class.class_method_signature: VolumeManagementDAO.getDetachedVolumes(final VirtualDatacenter vdc)
focal_class.full_signature: public List<VolumeManagement> getDetachedVolumes(final VirtualDatacenter vdc)
focal_class.identifier: getDetachedVolumes
focal_class.modifiers: public
focal_class.parameters: (final VirtualDatacenter vdc)
focal_class.return: List<VolumeManagement>
focal_class.signature: List<VolumeManagement> getDetachedVolumes(final VirtualDatacenter vdc)
focal_class.class_method_signature: VolumeManagementDAO.sameVirtualMachine(final VirtualMachine vm)
focal_class.full_signature: private static Criterion sameVirtualMachine(final VirtualMachine vm)
focal_class.identifier: sameVirtualMachine
focal_class.modifiers: private static
focal_class.parameters: (final VirtualMachine vm)
focal_class.return: Criterion
focal_class.signature: Criterion sameVirtualMachine(final VirtualMachine vm)
focal_class.class_method_signature: VolumeManagementDAO.sameState(final VolumeState state)
focal_class.full_signature: private static Criterion sameState(final VolumeState state)
focal_class.identifier: sameState
focal_class.modifiers: private static
focal_class.parameters: (final VolumeState state)
focal_class.return: Criterion
focal_class.signature: Criterion sameState(final VolumeState state)
focal_class.class_method_signature: VolumeManagementDAO.getVolumesByVirtualAppliance(final VirtualAppliance vapp)
focal_class.full_signature: public List<VolumeManagement> getVolumesByVirtualAppliance(final VirtualAppliance vapp)
focal_class.identifier: getVolumesByVirtualAppliance
focal_class.modifiers: public
focal_class.parameters: (final VirtualAppliance vapp)
focal_class.return: List<VolumeManagement>
focal_class.signature: List<VolumeManagement> getVolumesByVirtualAppliance(final VirtualAppliance vapp)
focal_class.superclass: extends DefaultDAOBase<Integer, VolumeManagement>
focal_method.body: public List<VolumeManagement> getStatefulCandidates(final VirtualDatacenter vdc)
      {
          // Filters on the VolumeManagement entity
          Criteria crit = createCriteria();
          crit.createAlias(VolumeManagement.STORAGE_POOL_PROPERTY, "pool");
          crit.createAlias("pool." + StoragePool.DEVICE_PROPERTY, "device");
  
          crit.add(sameVirtualDatacenter(vdc));
          crit.add(Restrictions.isNull(VolumeManagement.VIRTUAL_MACHINE_TEMPLATE_PROPERTY));
          crit.add(Restrictions.eq(VolumeManagement.STATE_PROPERTY, VolumeState.DETACHED));
  
          crit.add(Restrictions.eq("device." + StorageDevice.STORAGE_TECHNOLOGY_PROPERTY,
              StorageTechnologyType.GENERIC_ISCSI));
  
          return getResultList(crit);
      }
focal_method.class_method_signature: VolumeManagementDAO.getStatefulCandidates(final VirtualDatacenter vdc)
focal_method.full_signature: public List<VolumeManagement> getStatefulCandidates(final VirtualDatacenter vdc)
focal_method.identifier: getStatefulCandidates
focal_method.invocations: createCriteria createAlias createAlias add sameVirtualDatacenter add isNull add eq add eq getResultList
focal_method.modifiers: public
focal_method.parameters: (final VirtualDatacenter vdc)
focal_method.return: List<VolumeManagement>
focal_method.signature: List<VolumeManagement> getStatefulCandidates(final VirtualDatacenter vdc)