Object object = deserializer.fudgeMsgToObject(FlexiBean.class, configsMessage);
if (!(object instanceof FlexiBean)) {
s_logger.error("XML Stream deserialised to object of type " + object.getClass() + ": " + object.toString());
return;
}
FlexiBean wrapper = (FlexiBean) object;
if (!wrapper.contains("configs")) {
s_logger.error("File stream does not contain configs element");
return;
}
@SuppressWarnings("unchecked")
List<ConfigEntry> configs = (List<ConfigEntry>) wrapper.get("configs");
if (wrapper.contains("idToPortfolioMap")) {
@SuppressWarnings("unchecked")
Map<UniqueId, String> idToPortfolioMap = (Map<UniqueId, String>) wrapper.get("idToPortfolioMap");
if (idToPortfolioMap == null) {
s_logger.warn("Apparently corrupt portfolio id -> name map, won't attempt to port portfolio ids");
loadConfigs(configs, Collections.<UniqueId, String>emptyMap());
} else {
loadConfigs(configs, idToPortfolioMap);