store.setWorkspace( newWorkspace );
}
else if( store instanceof CoverageStoreInfo){
CoverageStoreInfo info = (CoverageStoreInfo) store;
if("connection".equals(prop)){
JSONObj connection = obj.object(prop);
if(!connection.has("raster") && connection.str("raster") != null){
throw new IllegalArgumentException("Property connection.raster required for coverage store");
}
for( String param : connection.keys()){
if("raster".equals(param)){
String url = connection.str(param);
reconnect = reconnect || url == null || !url.equals(info.getURL());
info.setURL(url);
}
}
}
}
else if( store instanceof WMSStoreInfo){
WMSStoreInfo info = (WMSStoreInfo) store;
if("connection".equals(prop)){
JSONObj connection = obj.object(prop);
if(!connection.has("url") && connection.str("url") != null){
throw new IllegalArgumentException("Property connection.url required for wms store");
}
for( String param : connection.keys()){
if("url".equals(param)){
String url = connection.str(param);
reconnect = reconnect || url == null || !url.equals(info.getCapabilitiesURL());
info.setCapabilitiesURL(url);
}
}
}
}
if( store instanceof DataStoreInfo){
DataStoreInfo info = (DataStoreInfo) store;
if("connection".equals(prop)){
JSONObj connection = obj.object(prop);
info.getConnectionParameters().clear();
info.getConnectionParameters().putAll( connection.raw() );
reconnect = true;
}
}
}