Package com.cloud.storage

Examples of com.cloud.storage.VMTemplateZoneVO


        }
        VMTemplateSwiftVO tmpltSwiftRef = _vmTmpltSwiftlDao.findOneByTemplateId(tmpltId);
        if (tmpltSwiftRef != null) {
            List<DataCenterVO> dcs = _dcDao.listAll();
            for (DataCenterVO dc : dcs) {
                VMTemplateZoneVO tmpltZoneVO = new VMTemplateZoneVO(dc.getId(), tmpltId, new Date());
                try {
                    _vmTmpltZoneDao.persist(tmpltZoneVO);
                } catch (Exception e) {
                }
            }
View Full Code Here


        }
        for (VMTemplateSwiftVO tmpltSwiftRef : tmpltSwiftRefs) {
            Long tmpltId = tmpltSwiftRef.getTemplateId();
            if (!tmpltIds.contains(tmpltId)) {
                tmpltIds.add(tmpltId);
                VMTemplateZoneVO tmpltZoneVO = new VMTemplateZoneVO(zoneId, tmpltId, new Date());
                try {
                    _vmTmpltZoneDao.persist(tmpltZoneVO);
                } catch (Exception e) {
                }
            }
View Full Code Here

            LOGGER.info(format("Propagating %1$s templates to zone %2$s.",
                    s3VMTemplateRefs.size(), zone.getName()));
        }

        for (final VMTemplateS3VO templateS3VO : s3VMTemplateRefs) {
            this.vmTemplateZoneDao.persist(new VMTemplateZoneVO(zone.getId(),
                    templateS3VO.getTemplateId(), now()));
        }

    }
View Full Code Here

        }

        if (vmTemplateS3VO != null) {
            final List<DataCenterVO> dataCenters = dataCenterDao.listAll();
            for (DataCenterVO dataCenter : dataCenters) {
                final VMTemplateZoneVO tmpltZoneVO = new VMTemplateZoneVO(
                        dataCenter.getId(), templateId, now());
                vmTemplateZoneDao.persist(tmpltZoneVO);
            }
        }
View Full Code Here

    }
   
  }
 
    private void associateTemplatesToZone(long hostId, long dcId){
      VMTemplateZoneVO tmpltZone;

      List<VMTemplateVO> allTemplates = _vmTemplateDao.listAll();
      for (VMTemplateVO vt: allTemplates){
        if (vt.isCrossZones()) {
          tmpltZone = _vmTemplateZoneDao.findByZoneTemplate(dcId, vt.getId());
          if (tmpltZone == null) {
            VMTemplateZoneVO vmTemplateZone = new VMTemplateZoneVO(dcId, vt.getId(), new Date());
            _vmTemplateZoneDao.persist(vmTemplateZone);
          }
        }
      }
    }
View Full Code Here

      }
      if(tmplt.getDetails() != null) {
        _templateDetailsDao.persist(tmplt.getId(), tmplt.getDetails());
      }
    }
    VMTemplateZoneVO tmpltZoneVO = _templateZoneDao.findByZoneTemplate(zoneId, tmplt.getId());
    if (tmpltZoneVO == null ) {
        tmpltZoneVO = new VMTemplateZoneVO(zoneId, tmplt.getId(), new Date());
        _templateZoneDao.persist(tmpltZoneVO);
    } else {
        tmpltZoneVO.setRemoved(null);
        tmpltZoneVO.setLastUpdated(new Date());
        _templateZoneDao.update(tmpltZoneVO.getId(), tmpltZoneVO);
    }
    txn.commit();
   
    return tmplt.getId();
  }
View Full Code Here

    }

  }

    private void associateTemplatesToZone(long hostId, long dcId){
      VMTemplateZoneVO tmpltZone;

      List<VMTemplateVO> allTemplates = _vmTemplateDao.listAll();
      for (VMTemplateVO vt: allTemplates){
        if (vt.isCrossZones()) {
          tmpltZone = _vmTemplateZoneDao.findByZoneTemplate(dcId, vt.getId());
          if (tmpltZone == null) {
            VMTemplateZoneVO vmTemplateZone = new VMTemplateZoneVO(dcId, vt.getId(), new Date());
            _vmTemplateZoneDao.persist(vmTemplateZone);
          }
        }
      }
    }
View Full Code Here

                // create entries in template_zone_ref table
                if (_dataStoreMgr.isRegionStore(store)) {
                    // template created on region store
                    _tmpltSvr.associateTemplateToZone(templateId, null);
                } else {
                    VMTemplateZoneVO templateZone = new VMTemplateZoneVO(zoneId, templateId, new Date());
                    _tmpltZoneDao.persist(templateZone);
                }

                privateTemplate = _tmpltDao.findById(templateId);
                if (snapshotId != null) {
View Full Code Here

            for (DataCenterVO zone : zones) {
                dcs.add(zone.getId());
            }
        }
        for (Long id : dcs) {
            VMTemplateZoneVO tmpltZoneVO = _vmTemplateZoneDao.findByZoneTemplate(id, templateId);
            if (tmpltZoneVO == null) {
                tmpltZoneVO = new VMTemplateZoneVO(id, templateId, new Date());
                _vmTemplateZoneDao.persist(tmpltZoneVO);
            } else {
                tmpltZoneVO.setLastUpdated(new Date());
                _vmTemplateZoneDao.update(tmpltZoneVO.getId(), tmpltZoneVO);
            }
        }
    }
View Full Code Here

    }

    // update template_zone_ref for cross-zone template for newly added zone
    @Override
    public void associateCrosszoneTemplatesToZone(long dcId){
        VMTemplateZoneVO tmpltZone;

        List<VMTemplateVO> allTemplates = _templateDao.listAll();
        for (VMTemplateVO vt: allTemplates){
            if (vt.isCrossZones()) {
                tmpltZone = _vmTemplateZoneDao.findByZoneTemplate(dcId, vt.getId());
                if (tmpltZone == null) {
                    VMTemplateZoneVO vmTemplateZone = new VMTemplateZoneVO(dcId, vt.getId(), new Date());
                    _vmTemplateZoneDao.persist(vmTemplateZone);
                }
            }
        }
    }
View Full Code Here

TOP

Related Classes of com.cloud.storage.VMTemplateZoneVO

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.