@Override public String getName() { return imageDataStoreVO.getName(); }
public ImageStoreVO createImageStore(Map<String, Object> params) { ImageStoreVO store = imageStoreDao.findByName((String)params.get("name")); if (store != null) { return store; } store = new ImageStoreVO(); store.setProtocol((String)params.get("protocol")); store.setProviderName((String)params.get("providerName")); store.setScope((ScopeType)params.get("scope")); store.setDataCenterId((Long)params.get("zoneId")); String uuid = (String)params.get("uuid"); if (uuid != null) { store.setUuid(uuid); } else { store.setUuid(UUID.randomUUID().toString()); } store.setName((String)params.get("name")); if (store.getName() == null) { store.setName(store.getUuid()); } store.setUrl((String)params.get("url")); store.setRole((DataStoreRole)params.get("role")); store = imageStoreDao.persist(store); return store; }
if (store.getName() == null) { store.setName(store.getUuid());
@Override public boolean configure(String name, Map<String, Object> params) throws ConfigurationException { super.configure(name, params); nameSearch = createSearchBuilder(); nameSearch.and("name", nameSearch.entity().getName(), SearchCriteria.Op.EQ); nameSearch.and("role", nameSearch.entity().getRole(), SearchCriteria.Op.EQ); nameSearch.done(); providerSearch = createSearchBuilder(); providerSearch.and("providerName", providerSearch.entity().getProviderName(), SearchCriteria.Op.EQ); providerSearch.and("role", providerSearch.entity().getRole(), SearchCriteria.Op.EQ); providerSearch.done(); regionSearch = createSearchBuilder(); regionSearch.and("scope", regionSearch.entity().getScope(), SearchCriteria.Op.EQ); regionSearch.and("role", regionSearch.entity().getRole(), SearchCriteria.Op.EQ); regionSearch.done(); return true; }