git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/information-system/gCubeIS/Registry@19619 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
ee357f7018
commit
6e71f45970
|
@ -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>
|
||||
|
|
|
@ -82,6 +82,7 @@
|
|||
<xsd:complexType name="RegistryProperty">
|
||||
<xsd:sequence>
|
||||
<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>
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue