@Override public void entityLifeCycleEvent(EntityEvent evt, Object o) { ImageCacheVO img = (ImageCacheVO) o; String info = String.format("[ImageCache:Delete][uuid=%s]: -%s", img.getImageUuid(), img.getSize()); logger.debug(info); loggerd.debug(info); printCallTrace(); } });
@Override public void entityLifeCycleEvent(EntityEvent evt, Object o) { ImageCacheVO img = (ImageCacheVO) o; String info = String.format("[ImageCache:Create][uuid=%s]: %s", img.getImageUuid(), img.getSize()); logger.debug(info); loggerd.debug(info); printCallTrace(); } });
public ImageCacheShadowVO(ImageCacheVO c) { primaryStorageUuid = c.getPrimaryStorageUuid(); imageUuid = c.getImageUuid(); installUrl = c.getInstallUrl(); mediaType = c.getMediaType(); size = c.getSize(); state = c.getState(); md5sum = c.getMd5sum(); createDate = c.getCreateDate(); lastOpDate = c.getLastOpDate(); }
@Override public void success(Boolean returnValue) { if (returnValue) { logger.debug(String.format("found image[uuid:%s] in image cache[id:%s, path:%s]", image.getInventory().getUuid(), cvo.getId(), cvo.getInstallUrl())); completion.success(ImageCacheInventory.valueOf(cvo)); return; } // return capacity and re-download IncreasePrimaryStorageCapacityMsg rmsg = new IncreasePrimaryStorageCapacityMsg(); rmsg.setPrimaryStorageUuid(cvo.getPrimaryStorageUuid()); rmsg.setDiskSize(cvo.getSize()); bus.makeLocalServiceId(rmsg, PrimaryStorageConstant.SERVICE_ID); bus.send(rmsg); dbf.remove(cvo); download(completion); }
public static ImageCacheInventory valueOf(ImageCacheVO vo) { ImageCacheInventory inv = new ImageCacheInventory(); inv.setCreateDate(vo.getCreateDate()); inv.setId(vo.getId()); inv.setImageUuid(vo.getImageUuid()); inv.setInstallUrl(vo.getInstallUrl()); inv.setLastOpDate(vo.getLastOpDate()); inv.setMd5sum(vo.getMd5sum()); inv.setMediaType(vo.getMediaType().toString()); inv.setPrimaryStorageUuid(vo.getPrimaryStorageUuid()); inv.setSize(vo.getSize()); inv.setState(vo.getState().toString()); return inv; }