@Override public String call(PrimaryStorageType arg) { return arg.toString(); } });
@Override public String getPrimaryStorageTypeForRecalculateCapacityExtensionPoint() { return type.toString(); }
@Override public String createTemplateFromVolumeSnapshotPrimaryStorageType() { return type.toString(); }
@Override public String getPrimaryStorageTypeForRecalculateCapacityExtensionPoint() { return type.toString(); }
@Override public boolean equals(Object t) { if (t == null || !(t instanceof PrimaryStorageType)) { return false; } PrimaryStorageType type = (PrimaryStorageType) t; return type.toString().equals(typeName); }
@Override public PrimaryStorageFactory getPrimaryStorageFactory(PrimaryStorageType type) { PrimaryStorageFactory factory = primaryStorageFactories.get(type.toString()); if (factory == null) { throw new CloudRuntimeException(String.format("No PrimaryStorageFactory for type: %s found", type)); } return factory; }
private void populateExtensions() { for (PrimaryStorageAllocatorStrategyFactory f : pluginRgty.getExtensionList(PrimaryStorageAllocatorStrategyFactory.class)) { PrimaryStorageAllocatorStrategyFactory old = allocatorFactories.get(f.getPrimaryStorageAllocatorStrategyType().toString()); if (old != null) { throw new CloudRuntimeException(String.format("duplicate PrimaryStorageAllocatorStrategyFactory[%s, %s] for type[%s]", f.getClass().getName(), old.getClass().getName(), f.getPrimaryStorageAllocatorStrategyType())); } allocatorFactories.put(f.getPrimaryStorageAllocatorStrategyType().toString(), f); } for (PrimaryStorageFactory f : pluginRgty.getExtensionList(PrimaryStorageFactory.class)) { PrimaryStorageFactory old = primaryStorageFactories.get(f.getPrimaryStorageType().toString()); if (old != null) { throw new CloudRuntimeException(String.format("duplicate PrimaryStorageFactory[%s, %s] for type[%s]", f.getClass().getName(), old.getClass().getName(), old.getPrimaryStorageType())); } primaryStorageFactories.put(f.getPrimaryStorageType().toString(), f); } }
private void populateExtensions() { for (NfsPrimaryStorageBackend extp : pluginRgty.getExtensionList(NfsPrimaryStorageBackend.class)) { NfsPrimaryStorageBackend old = backends.get(extp.getHypervisorType().toString()); if (old != null) { throw new CloudRuntimeException(String.format("duplicate NfsPrimaryStorageBackend[%s, %s] for type[%s]", extp.getClass().getName(), old.getClass().getName(), old.getHypervisorType())); } backends.put(extp.getHypervisorType().toString(), extp); } for (NfsPrimaryToBackupStorageMediator extp : pluginRgty.getExtensionList(NfsPrimaryToBackupStorageMediator.class)) { if (extp.getSupportedPrimaryStorageType().equals(type.toString())) { Map<String, NfsPrimaryToBackupStorageMediator> map = mediators.get(extp.getSupportedBackupStorageType()); if (map == null) { map = new HashMap<>(1); } for (String hvType : extp.getSupportedHypervisorTypes()) { map.put(hvType, extp); } mediators.put(extp.getSupportedBackupStorageType(), map); } } }
private Boolean isLocalStorage(String psUuid) { return Q.New(PrimaryStorageVO.class) .eq(PrimaryStorageVO_.type, type.toString()) .eq(PrimaryStorageVO_.uuid, psUuid) .isExists(); }
private Boolean isCephPrimaryStorageVolume(String volumeUuid) { VolumeVO volumeVO = Q.New(VolumeVO.class).eq(VolumeVO_.uuid, volumeUuid).find(); PrimaryStorageVO primaryStorageVO = Q.New(PrimaryStorageVO.class) .eq(PrimaryStorageVO_.uuid, volumeVO.getPrimaryStorageUuid()).find(); return primaryStorageVO.getType().equals(type.toString()); } }
primaryStorageVO.setType(type.toString()); primaryStorageVO.setName(msg.getName()); primaryStorageVO.setDescription(msg.getDescription());