This commit is contained in:
Lucio Lelii 2010-05-13 16:25:40 +00:00
parent ee357f7018
commit 6e71f45970
3 changed files with 10 additions and 7 deletions

View File

@ -109,7 +109,7 @@
<!--
<resource name="publicationProfile" type="org.gcube.common.core.state.GCUBEPublicationProfile">
<resourceParams>
<parameter>
@ -125,7 +125,7 @@
<value>registrationFactory.xml</value>
</parameter>
</resourceParams>
</resource>
</resource> -->
<resource name="home" type="org.gcube.informationsystem.registry.impl.state.RegistryFactoryResourceHome">
<resourceParams>

View File

@ -81,7 +81,8 @@
<xsd:complexType name="RegistryProperty">
<xsd:sequence>
<xsd:element name="uniqueID" type="xsd:string" nillable="true"/>
<xsd:element name="uniqueID" type="xsd:string" nillable="true"/>
<xsd:element name="profile" type="xsd:string" nillable="true"/>
<xsd:element name="operationType" type="xsd:string" nillable="true"/>
<xsd:element name="changeTime" type="xsd:dateTime" nillable="true"/>
</xsd:sequence>

View File

@ -172,7 +172,8 @@ public class RegistryFactory extends GCUBEPortType {
throw new RemoteException(msg);
}
try {
updateCounterInfo(resource.getID(), ResourceType.valueOf(mess.getType()), OperationType.create, Calendar.getInstance());
updateCounterInfo(resource.getID(), ResourceType.valueOf(mess.getType()), OperationType.create, Calendar.getInstance(), mess.getProfile());
GCUBEEvent<ServiceContext.RegistryTopic, GCUBEResource> event = new GCUBEEvent<ServiceContext.RegistryTopic, GCUBEResource>();
event.setPayload(resource);
ServiceContext.getContext().getTopicProducer().notify(
@ -284,7 +285,7 @@ public class RegistryFactory extends GCUBEPortType {
}
try {
this.updateCounterInfo(ID, ResourceType.valueOf(mess.getType()), OperationType.update, Calendar.getInstance());
this.updateCounterInfo(ID, ResourceType.valueOf(mess.getType()), OperationType.update, Calendar.getInstance(), xmlProfile);
GCUBEEvent<ServiceContext.RegistryTopic, GCUBEResource> event = new GCUBEEvent<ServiceContext.RegistryTopic, GCUBEResource>();
event.setPayload(resource);
ServiceContext.getContext().getTopicProducer().notify(ServiceContext.RegistryTopic.UPDATE, event);
@ -350,7 +351,7 @@ public class RegistryFactory extends GCUBEPortType {
resource.setID(ID);
event.setPayload(resource);
ServiceContext.getContext().getTopicProducer().notify(ServiceContext.RegistryTopic.REMOVE, event);
updateCounterInfo(ID, ResourceType.valueOf(type),OperationType.destroy, Calendar.getInstance());
updateCounterInfo(ID, ResourceType.valueOf(type),OperationType.destroy, Calendar.getInstance(),null);
} catch (Exception e) {
logger.warn("Error updating counting info for resource with ID " + ID, e);
}
@ -409,11 +410,12 @@ public class RegistryFactory extends GCUBEPortType {
*/
private synchronized void updateCounterInfo(String ID,
ResourceType resType, OperationType opType, Calendar updateTime)
ResourceType resType, OperationType opType, Calendar updateTime, String profile)
throws Exception {
RegistryProperty property = new RegistryProperty();
property.setUniqueID(ID);
property.setProfile(profile);
property.setOperationType(opType.name());
property.setChangeTime(updateTime);
// select the type of the resource to update