added field invocationScope to the Registry Factory property

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/information-system/gCubeIS/Registry@60418 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Lucio Lelii 2012-10-24 15:47:54 +00:00
parent e592963fa2
commit 44a54c9150
6 changed files with 15 additions and 12 deletions

View File

@ -4,9 +4,6 @@
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="test"/>
<classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry exported="true" kind="con" path="org.eclipse.jdt.USER_LIBRARY/GCORELIBS"/>
<classpathentry kind="lib" path="/Users/manuele/work/test/gCore/lib/org.gcube.informationsystem.registry.stubs.jar"/>
<classpathentry kind="lib" path="/Users/manuele/work/test/gCore/lib/org.gcube.informationsystem.collector.stubs.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/gcf.TRUNK"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/GCORELIB"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -1,4 +1,7 @@
<ReleaseNotes>
<Changeset component="org.gcube.information-system.registry.2-1-4" date="2012-10-24">
<Change>Adding new field in the factory property for the caller scope</Change>
</Changeset>
<Changeset component="org.gcube.information-system.registry.2-1-3" date="2012-04-05">
<Change>Adding WS-Topic for the new Runtime Resource</Change>
</Changeset>

View File

@ -18,7 +18,7 @@
<Main>
<Description>IS-Registry: validate, register and unregister gCube resources to/from the IS. It exposes WS-Topics for notifications about gCube resources' lifecycle</Description>
<Name>IS-Registry-service</Name>
<Version>2.1.3</Version>
<Version>2.1.4</Version>
<Mandatory level="VO"/>
<Shareable level="VO"/>
<GHNRequirements>
@ -32,7 +32,7 @@
<Version>1.0.0</Version>
</Service>
<Package>IS-Registry-stubs</Package>
<Version>2.1.0</Version>
<Version>2.1.4</Version>
<Scope level="GHN"/>
<Optional>false</Optional>
</Dependency>
@ -52,7 +52,7 @@
<Software>
<Description>Stub classes for interfacing the IS-Registry</Description>
<Name>IS-Registry-stubs</Name>
<Version>2.1.3</Version>
<Version>2.1.4</Version>
<MultiVersion value="true"/>
<Mandatory level="GHN"/>
<Shareable level="VO"/>

View File

@ -84,7 +84,8 @@
<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:element name="changeTime" type="xsd:dateTime" nillable="true"/>
<xsd:element name="invocationScope" type="xsd:string" nillable="true"/>
</xsd:sequence>
</xsd:complexType>

View File

@ -43,7 +43,7 @@ public class LocalResourceRegistration {
resource.store(writer);
RegistryFactory.updateCounterInfo(resource.getID(), ResourceMappings.valueOf(
resource.getType()), OperationType.create,
Calendar.getInstance(), writer.toString());
Calendar.getInstance(), writer.toString(), ServiceContext.getContext().getScope());
}
/**
*
@ -71,7 +71,7 @@ public class LocalResourceRegistration {
GCUBEResource resource = ResourceMappings.valueOf(type).getResourceImplementation();
resource.setID(id);
LocalNotifier.notifyEvent(resource, RegistryTopic.REMOVE);
RegistryFactory.updateCounterInfo(id, ResourceMappings.valueOf(type),OperationType.destroy, Calendar.getInstance(), null);
RegistryFactory.updateCounterInfo(id, ResourceMappings.valueOf(type),OperationType.destroy, Calendar.getInstance(), null, ServiceContext.getContext().getScope());
}
public void update(GCUBEResource resource) throws Exception {
@ -93,7 +93,7 @@ public class LocalResourceRegistration {
StringWriter writer = new StringWriter();
resource.store(writer);
RegistryFactory.updateCounterInfo(resource.getID(), ResourceMappings.valueOf(resource.getType()),
OperationType.update, Calendar.getInstance(), writer.toString());
OperationType.update, Calendar.getInstance(), writer.toString(), ServiceContext.getContext().getScope());
}
}

View File

@ -182,13 +182,15 @@ public class RegistryFactory extends GCUBEPortType {
*/
protected static synchronized void updateCounterInfo(String ID,
ResourceMappings resType, OperationType opType, Calendar updateTime,
String profile) throws Exception {
String profile, GCUBEScope scope) throws Exception {
//return;
RegistryProperty property = new RegistryProperty();
property.setUniqueID(ID);
property.setProfile(profile);
property.setOperationType(opType.name());
property.setChangeTime(updateTime);
property.setInvocationScope(scope.toString());
// select the type of the resource to update
logger.trace("Notifying about resource " + ID +", event: " + opType);
for (Method method : getResource().getClass().getDeclaredMethods()) {