2008-05-06 00:44:24 +02:00
|
|
|
package org.gcube.informationsystem.registry.impl.persistence;
|
2008-04-15 19:28:28 +02:00
|
|
|
|
|
|
|
import java.io.ObjectInputStream;
|
|
|
|
import java.io.ObjectOutputStream;
|
|
|
|
import org.gcube.common.core.persistence.GCUBEWSFilePersistenceDelegate;
|
2008-05-06 00:44:24 +02:00
|
|
|
import org.gcube.informationsystem.registry.impl.state.ProfileResource;
|
2008-04-15 19:28:28 +02:00
|
|
|
import org.w3c.dom.Document;
|
|
|
|
|
|
|
|
public class RegistryPersistenceDelegate extends GCUBEWSFilePersistenceDelegate<ProfileResource> {
|
|
|
|
|
|
|
|
|
2008-11-14 14:05:05 +01:00
|
|
|
protected void onLoad(ProfileResource resource, ObjectInputStream ois) throws Exception {
|
2008-04-15 19:28:28 +02:00
|
|
|
|
|
|
|
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());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|