int storeVersion = 0;
JsonNode storeVersionNode = node.get(Broker.STORE_VERSION);
if (storeVersionNode == null || storeVersionNode.isNull())
{
throw new IllegalConfigurationException("Broker " + Broker.STORE_VERSION + " attribute must be specified");
}
else
{
storeVersion = storeVersionNode.getIntValue();
}
if (storeVersion != STORE_VERSION)
{
throw new IllegalConfigurationException("The data of version " + storeVersion
+ " can not be loaded by store of version " + STORE_VERSION);
}
ConfigurationEntry brokerEntry = toEntry(node, Broker.class, _entries);
_rootId = brokerEntry.getId();
}
catch (IOException e)
{
throw new IllegalConfigurationException("Cannot load store from: " + url, e);
}
finally
{
if (is != null)
{
if (is != null)
{
try
{
is.close();
}
catch (IOException e)
{
throw new IllegalConfigurationException("Cannot close input stream for: " + url, e);
}
}
}
}
}