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 testGetSameVirtualAppliance()
      {
          VirtualDatacenter vdc = vdcGenerator.createUniqueInstance();
  
          VirtualAppliance vapp = vappGenerator.createInstance(vdc);
          VirtualAppliance vapp1 = vappGenerator.createInstance(vdc);
  
          VolumeManagement volume = eg().createInstance(vdc);
          VolumeManagement volume1 = eg().createInstance(vdc);
          VolumeManagement volume2 = eg().createInstance(vdc);
  
          volume.setVirtualAppliance(vapp);
          volume1.setVirtualAppliance(vapp);
          volume2.setVirtualAppliance(vapp1);
  
          List<Object> entitiesToPersist = new ArrayList<Object>();
          vdcGenerator.addAuxiliaryEntitiesToPersist(vdc, entitiesToPersist);
          persistAll(ds(), entitiesToPersist, vdc.getDatacenter(), vdc.getEnterprise(), vdc, volume
              .getStoragePool().getDevice(), volume.getStoragePool().getTier(),
              volume.getStoragePool(), volume.getRasd(), volume,
              volume1.getStoragePool().getDevice(), volume1.getStoragePool().getTier(),
              volume1.getStoragePool(), volume1.getRasd(), volume1, volume2.getStoragePool()
                  .getDevice(), volume2.getStoragePool().getTier(), volume2.getStoragePool(),
              volume2.getRasd(), volume2, vapp, vapp1);
  
          VolumeManagementDAO dao = createDaoForRollbackTransaction();
  
          List<VolumeManagement> results = dao.getVolumesByVirtualAppliance(vapp);
  
          assertEquals(results.size(), 2);
      }
test_case.class_method_signature: VolumeManagementDAOTest.testGetSameVirtualAppliance()
test_case.full_signature: @Test public void testGetSameVirtualAppliance()
test_case.identifier: testGetSameVirtualAppliance
test_case.invocations: createUniqueInstance createInstance createInstance createInstance eg createInstance eg createInstance eg setVirtualAppliance setVirtualAppliance setVirtualAppliance addAuxiliaryEntitiesToPersist persistAll ds getDatacenter getEnterprise getDevice getStoragePool getTier getStoragePool getStoragePool getRasd getDevice getStoragePool getTier getStoragePool getStoragePool getRasd getDevice getStoragePool getTier getStoragePool getStoragePool getRasd createDaoForRollbackTransaction getVolumesByVirtualAppliance assertEquals size
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetSameVirtualAppliance()
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> getVolumesByVirtualAppliance(final VirtualAppliance vapp)
      {
          Query query = getSession().createQuery(VolumeManagement.BY_VAPP);
          query.setInteger("vappId", vapp.getId());
          return query.list();
      }
focal_method.class_method_signature: VolumeManagementDAO.getVolumesByVirtualAppliance(final VirtualAppliance vapp)
focal_method.full_signature: public List<VolumeManagement> getVolumesByVirtualAppliance(final VirtualAppliance vapp)
focal_method.identifier: getVolumesByVirtualAppliance
focal_method.invocations: createQuery getSession setInteger getId list
focal_method.modifiers: public
focal_method.parameters: (final VirtualAppliance vapp)
focal_method.return: List<VolumeManagement>
focal_method.signature: List<VolumeManagement> getVolumesByVirtualAppliance(final VirtualAppliance vapp)