@Override public HandlerResult handle(ProcessState state, ProcessInstance process) { Map<String, Object> result = new HashMap<String, Object>(); Map<String, Set<Long>> allocationData = new HashMap<String, Set<Long>>(); result.put("_allocationData", allocationData); Volume volume = (Volume) state.getResource(); for (VolumeStoragePoolMap map : mapDao.findNonRemoved(VolumeStoragePoolMap.class, Volume.class, volume.getId())) { CollectionUtils.addToMap(allocationData, "volume:" + volume.getId(), map.getVolumeId(), HashSet.class); create(map, state.getData()); } return new HandlerResult(result); }
CollectionUtils.addToMap(allocationData, "volume:" + v.getId(), map.getVolumeId(), HashSet.class); create(map, state.getData());
/** * {@inheritDoc} */ @Override public void from(io.cattle.platform.core.model.VolumeStoragePoolMap from) { setId(from.getId()); setName(from.getName()); setKind(from.getKind()); setUuid(from.getUuid()); setDescription(from.getDescription()); setState(from.getState()); setCreated(from.getCreated()); setRemoved(from.getRemoved()); setRemoveTime(from.getRemoveTime()); setData(from.getData()); setVolumeId(from.getVolumeId()); setStoragePoolId(from.getStoragePoolId()); }
} else if (obj instanceof VolumeStoragePoolMap) { sendChange(StoragePool.class, accountId, ((VolumeStoragePoolMap) obj).getStoragePoolId(), schedule, context); sendChange(Volume.class, accountId, ((VolumeStoragePoolMap) obj).getVolumeId(), schedule, context); } else if (obj instanceof Mount) { sendChange(Instance.class, accountId, ((Mount) obj).getInstanceId(), schedule, context);