HierarchicalStreamReader reader, UnmarshallingContext context) {
StoreInfo store = (StoreInfo) super.doUnmarshal(result, reader, context);
// 2.1.3+ backwards compatibility check
if (store instanceof WMSStoreInfo) {
WMSStoreInfo wmsStore = (WMSStoreInfo) store;
MetadataMap metadata = wmsStore.getMetadata();
Integer maxConnections = null;
Integer connectTimeout = null;
Integer readTimeout = null;
if (metadata != null) {
maxConnections = metadata.get("maxConnections", Integer.class);
connectTimeout = metadata.get("connectTimeout", Integer.class);
readTimeout = metadata.get("readTimeout", Integer.class);
metadata.remove("maxConnections");
metadata.remove("connectTimeout");
metadata.remove("readTimeout");
}
if (wmsStore.getMaxConnections() <= 0) {
wmsStore.setMaxConnections(maxConnections != null
&& maxConnections.intValue() > 0 ? maxConnections
: WMSStoreInfoImpl.DEFAULT_MAX_CONNECTIONS);
}
if (wmsStore.getConnectTimeout() <= 0) {
wmsStore.setConnectTimeout(connectTimeout != null
&& connectTimeout.intValue() > 0 ? connectTimeout
: WMSStoreInfoImpl.DEFAULT_CONNECT_TIMEOUT);
}
if (wmsStore.getReadTimeout() <= 0) {
wmsStore.setReadTimeout(readTimeout != null && readTimeout.intValue() > 0 ? readTimeout
: WMSStoreInfoImpl.DEFAULT_READ_TIMEOUT);
}
}
//process any parameters that require decryption