throw new RuntimeException(e);
}
HashMap h = (HashMap) decoder.readObject();
decoder.close();
// Handle Base64 encoded string values
HashMap data = new Base64GetHashMap(h);
float oldversion = ((Float) data.get(UpgradeableDataHashMap.VERSION)).floatValue();
ServiceConfiguration serviceConfiguration = new ServiceConfiguration();
serviceConfiguration.loadData(data);
if ( ((serviceConfiguration != null) && (Float.compare(oldversion, serviceConfiguration.getVersion()) != 0))) {
// Upgrade in version 4 of ServiceConfiguration. If we do not have nextRunTimeStamp and runTimeStamp set in
// the database, but we have them in serviceConfiguration, we will simply copy the values over.
// After this we will not use the values in ServiceConfiguration any more
final String NEXTRUNTIMESTAMP = "NEXTRUNTIMESTAMP";
final String OLDRUNTIMESTAMP = "OLDRUNTIMESTAMP";
if ((getNextRunTimeStamp() == 0) && (data.get(NEXTRUNTIMESTAMP) != null)) {
final long nextRunTs = ((Long) data.get(NEXTRUNTIMESTAMP)).longValue();
log.debug("Upgrading nextRunTimeStamp to "+nextRunTs);
setNextRunTimeStamp(nextRunTs);
}
if ((getRunTimeStamp() == 0) && (data.get(OLDRUNTIMESTAMP) != null)) {
final long runTs = ((Long) data.get(OLDRUNTIMESTAMP)).longValue();
log.debug("Upgrading runTimeStamp to "+runTs);
setRunTimeStamp(runTs);
}
setServiceConfiguration(serviceConfiguration);
}