is-registry/src/org/gcube/informationsystem/registry/impl/persistence/RegistryPersistenceDelegate...

26 lines
837 B
Java

package org.gcube.informationsystem.registry.impl.persistence;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import org.gcube.common.core.persistence.GCUBEWSFilePersistenceDelegate;
import org.gcube.informationsystem.registry.impl.state.ProfileResource;
import org.w3c.dom.Document;
public class RegistryPersistenceDelegate extends GCUBEWSFilePersistenceDelegate<ProfileResource> {
protected void onLoad(ProfileResource resource, ObjectInputStream ois) throws Exception {
super.onLoad(resource, ois);
resource.setProfile((Document)ois.readObject());
resource.setNotificationProfile(resource.getProfile());
}
protected void onStore(ProfileResource resource,ObjectOutputStream oos) throws Exception {
super.onStore(resource, oos);
oos.writeObject((Document)resource.getProfile());
}
}