@Override public void decRefCount() { if (dataStore == null) { return; } if (dataStore.getRole() == DataStoreRole.Image || dataStore.getRole() == DataStoreRole.ImageCache) { TemplateDataStoreVO store = templateStoreDao.findByStoreTemplate(dataStore.getId(), getId()); store.decrRefCnt(); store.setLastUpdated(new Date()); templateStoreDao.update(store.getId(), store); } }
@Override public void incRefCount() { if (dataStore == null) { return; } if (dataStore.getRole() == DataStoreRole.Image || dataStore.getRole() == DataStoreRole.ImageCache) { TemplateDataStoreVO store = templateStoreDao.findByStoreTemplate(dataStore.getId(), getId()); store.incrRefCnt(); store.setLastUpdated(new Date()); templateStoreDao.update(store.getId(), store); } }
_templateStoreDao.update(templateOnImageStore.getId(), templateOnImageStore); } catch (Throwable th) { s_logger.warn("caught exception while deleting download url " + templateOnImageStore.getExtractUrl() + " for template id " + templateOnImageStore.getTemplateId(), th);
_tmpltStoreDao.update(vo.getId(), vo);
_vmTemplateStoreDao.update(tmpltStore.getId(), tmpltStore); } else { tmpltStore = new TemplateDataStoreVO(storeId, tmplt.getId(), new Date(), 100, Status.DOWNLOADED, null, null, null, tmpltInfo.getInstallPath(), tmplt.getUrl()); tmpltStore.setErrorString(msg); tmpltStore.setState(State.Failed); _vmTemplateStoreDao.update(tmpltStore.getId(), tmpltStore); try { stateMachine.transitTo(tmplt, VirtualMachineTemplate.Event.OperationFailed, null, _templateDao);
_templateDataStoreDao.update(tmpTemplateDataStore.getId(), tmpTemplateDataStore); } catch (NoTransitionException e) { s_logger.error("Unexpected error " + e.getMessage());
updateBuilder.setSize(answer.getTemplateSize()); updateBuilder.setPhysicalSize(answer.getTemplatePhySicalSize()); _templateStoreDao.update(tmpltStoreVO.getId(), updateBuilder);
templateStoreRef.setPhysicalSize(newTemplate.getPhysicalSize()); templateStoreDao.update(templateStoreRef.getId(), templateStoreRef); if (getDataStore().getRole() == DataStoreRole.Image) { VMTemplateVO templateVO = imageDao.findById(getId()); templateStoreRef.setSize(dataDiskTemplate.getSize()); templateStoreRef.setPhysicalSize(dataDiskTemplate.getPhysicalSize()); templateStoreDao.update(templateStoreRef.getId(), templateStoreRef);
tmpltStoreRef.setExtractUrl(extractUrl); tmpltStoreRef.setExtractUrlCreated(DateUtil.now()); _tmplStoreDao.update(tmpltStoreRef.getId(), tmpltStoreRef); return extractUrl;