diff --git a/.project b/.project index db224a5..01b4101 100644 --- a/.project +++ b/.project @@ -1,6 +1,6 @@ - InformationCollector_branched + InformationCollector diff --git a/CHANGELOG b/CHANGELOG index ecd8d60..6660329 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,9 @@ +v. 2.1.0 (30-10-2009) + * GetProfileLastModificationTimeMs and GetResourceLastModificationTimeMs operations +v. 2.1.0 (15-10-2009) + * GetProfile and GetResource operations + v. 2.0.0 (30-08-2009) * test-suite * Data e Query specialized managers diff --git a/etc/profile.xml b/etc/profile.xml index 1c4128e..2173788 100644 --- a/etc/profile.xml +++ b/etc/profile.xml @@ -20,7 +20,7 @@ sink by collecting and exposing the information published by the registered gCube services IS-Collector-service - 2.1.0 + 2.2.0 @@ -29,7 +29,7 @@ 1.0.0 IS-Collector-stubs - [2.1.0] + [2.2.0] false @@ -76,7 +76,7 @@ InformationCollector Stubs IS-Collector-stubs - 2.1.0 + 2.2.0 @@ -88,7 +88,7 @@ Test-suite for IS-Collector: provide sample usages of interaction with a IS-Collector instance IS-Collector-test-suite - 2.1.0 + 2.2.0 application diff --git a/schema/XMLCollectionAccess.wsdl b/schema/XMLCollectionAccess.wsdl index 2fcaeef..159c7df 100755 --- a/schema/XMLCollectionAccess.wsdl +++ b/schema/XMLCollectionAccess.wsdl @@ -49,6 +49,10 @@ + + + + @@ -58,6 +62,23 @@ + + + + + + + + + + + + + + + + + @@ -115,6 +136,14 @@ + + + + + + + + @@ -131,6 +160,13 @@ + + + + + + + @@ -157,6 +193,16 @@ + + + + + + + + + + diff --git a/src/org/gcube/informationsystem/collector/impl/porttypes/XMLCollectionAccess.java b/src/org/gcube/informationsystem/collector/impl/porttypes/XMLCollectionAccess.java index ffeba99..7a20dbc 100755 --- a/src/org/gcube/informationsystem/collector/impl/porttypes/XMLCollectionAccess.java +++ b/src/org/gcube/informationsystem/collector/impl/porttypes/XMLCollectionAccess.java @@ -15,7 +15,9 @@ import org.gcube.informationsystem.collector.impl.xmlstorage.exist.Sweeper; import org.gcube.informationsystem.collector.stubs.DeleteProfileParams; import org.gcube.informationsystem.collector.stubs.DocumentNotFoundFaultType; import org.gcube.informationsystem.collector.stubs.GetProfileCriteria; +import org.gcube.informationsystem.collector.stubs.GetProfileLastModificationTimeMsCriteria; import org.gcube.informationsystem.collector.stubs.GetResourceCriteria; +import org.gcube.informationsystem.collector.stubs.GetResourceLastModificationTimeMsCriteria; import org.globus.wsrf.utils.FaultHelper; @@ -131,8 +133,7 @@ public class XMLCollectionAccess extends GCUBEPortType { /** * Deletes the entire set of registered RPs from the storage * - * @throws BaseFaultType - * if an error occurs when deleting the resources + * @throws BaseFaultType if an error occurs when deleting the resources */ public void deleteAllRPs() throws BaseFaultType { try { @@ -149,10 +150,15 @@ public class XMLCollectionAccess extends GCUBEPortType { } } + /** + * Retrieves the given Resource + * @param criteria the Resource ID + * @return the XML serialization of the Resource + * @throws DocumentNotFoundFaultType if the Resource does not exist + */ public String getResource(GetResourceCriteria criteria) throws DocumentNotFoundFaultType { try { - AggregatorPersistentResource aresource = State.getDataManager().retrievePropertyResourceFromID(criteria.getID()); - logger.debug("Returning resource:" + aresource.getData()); + AggregatorPersistentResource aresource = State.getDataManager().retrievePropertyResourceFromID(criteria.getID()); return aresource.getData(); } catch (Exception e) { logger.warn("Unable to find Resource with ID=" + criteria.getID(), e); @@ -161,10 +167,15 @@ public class XMLCollectionAccess extends GCUBEPortType { } + /** + * Retrieves the given Profile + * @param criteria the Profile ID and Type + * @return the XML serialization of the Profile + * @throws DocumentNotFoundFaultType if the Profile does not exist + */ public String getProfile(GetProfileCriteria criteria) throws DocumentNotFoundFaultType { try { - AggregatorPersistentResource aresource = State.getDataManager().retrieveProfile(criteria.getID(), criteria.getProfileType()); - logger.debug("Returning profile:" + aresource.getData()); + AggregatorPersistentResource aresource = State.getDataManager().retrieveProfile(criteria.getID(), criteria.getProfileType()); return aresource.getData(); } catch (Exception e) { logger.warn("Unable to find Profile with ID=" + criteria.getID(), e); @@ -172,6 +183,39 @@ public class XMLCollectionAccess extends GCUBEPortType { } } + /** + * Gets the last modification time in milliseconds of the given Profile + * @param criteria the Profile ID and Type + * @return the last update time in milliseconds + * @throws DocumentNotFoundFaultType if the Profile does not exist + */ + public long getProfileLastModificationTimeMs(GetProfileLastModificationTimeMsCriteria criteria) throws DocumentNotFoundFaultType { + try { + AggregatorPersistentResource aresource = State.getDataManager().retrieveProfile(criteria.getID(), criteria.getProfileType()); + return aresource.getLastUpdateTimeinMills(); + } catch (Exception e) { + logger.warn("Unable to find Profile with ID=" + criteria.getID(), e); + throw new DocumentNotFoundFaultType(); + } + } + + /** + * Gets the last modification time in milliseconds of the given Resource + * @param criteria the Resource ID + * @return the last update time in milliseconds + * @throws DocumentNotFoundFaultType if the Resource does not exist + */ + public long getResourceLastModificationTimeMs(GetResourceLastModificationTimeMsCriteria criteria) throws DocumentNotFoundFaultType { + try { + AggregatorPersistentResource aresource = State.getDataManager().retrievePropertyResourceFromID(criteria.getID()); + return aresource.getLastUpdateTimeinMills(); + } catch (Exception e) { + logger.warn("Unable to find Resource with ID=" + criteria.getID(), e); + throw new DocumentNotFoundFaultType(); + } + + } + /** {@inheritDoc} */ @Override protected GCUBEServiceContext getServiceContext() { diff --git a/test-suite/samples/ServiceMap_CNRPrivate.xml b/test-suite/samples/ServiceMap_CNRPrivate.xml index 97f7047..59f63eb 100644 --- a/test-suite/samples/ServiceMap_CNRPrivate.xml +++ b/test-suite/samples/ServiceMap_CNRPrivate.xml @@ -1,5 +1,7 @@ + +