@Override
protected void handleObjectPut(Object object) throws Exception {
String workspace = getAttribute("workspace");
String datastore = getAttribute("datastore");
DataStoreInfo ds = (DataStoreInfo) object;
DataStoreInfo original = catalog.getDataStoreByName(workspace, datastore);
//ensure this is not a name or workspace change
if ( ds.getName() != null && !ds.getName().equals( original.getName() ) ) {
throw new RestletException( "Can't change name of data store.", Status.CLIENT_ERROR_FORBIDDEN );
}
if ( ds.getWorkspace() != null && !ds.getWorkspace().equals( original.getWorkspace() ) ) {
throw new RestletException( "Can't change workspace of data store.", Status.CLIENT_ERROR_FORBIDDEN );
}
new CatalogBuilder( catalog ).updateDataStore( original, ds );