/** Reattaches a serialized {@link StoreInfo} to the catalog */ public void attach(StoreInfo storeInfo) { storeInfo = ModificationProxy.unwrap(storeInfo); ((StoreInfoImpl) storeInfo).setCatalog(catalog); }
/** Reattaches a serialized {@link StyleInfo} to the catalog */ public void attach(StyleInfo styleInfo) { styleInfo = ModificationProxy.unwrap(styleInfo); ((StyleInfoImpl) styleInfo).setCatalog(catalog); }
/** Reattaches a serialized {@link ResourceInfo} to the catalog */ public void attach(ResourceInfo resourceInfo) { resourceInfo = ModificationProxy.unwrap(resourceInfo); ((ResourceInfoImpl) resourceInfo).setCatalog(catalog); }
public void save(ResourceInfo resource) { ModificationProxy h = (ModificationProxy) Proxy.getInvocationHandler(resource); // figure out what changed List<String> propertyNames = h.getPropertyNames(); List<Object> newValues = h.getNewValues(); List<Object> oldValues = h.getOldValues(); beforeSaved(resource, propertyNames, oldValues, newValues); resources.update(resource); layers.update(resource); commitProxy(resource); afterSaved(resource, propertyNames, oldValues, newValues); }
protected StoreInfo resolve(StoreInfo store) { resolveCollections(store); StoreInfoImpl s = (StoreInfoImpl) store; s.setCatalog(this); return store; }
@Override public List<LayerInfo> getLayers() { if (useNameDequalifyingProxy()) { return NameDequalifyingProxy.createList(super.getLayers(), LayerInfo.class); } return super.getLayers(); }
/** * Wraps an object in a proxy. * * @throws RuntimeException If creating the proxy fails. */ public static <T> T create(T proxyObject, Class<T> clazz) { return ProxyUtils.createProxy(proxyObject, clazz, new ModificationProxy(proxyObject)); }
<T> T wrap(T obj, Class<T> clazz) { if (obj == null) { return null; } if (useNameDequalifyingProxy()) { return NameDequalifyingProxy.create(obj, clazz); } return obj; }
List<LayerGroupInfo> wrap(List<LayerGroupInfo> layerGroups) { if (useNameDequalifyingProxy()) { return NameDequalifyingProxy.createList(layerGroups, LayerGroupInfo.class); } return layerGroups; }