merging from branch 3.0

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/information-system/gCubeIS/Collector@35556 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Manuele Simi 2011-03-02 20:52:06 +00:00
parent 1dac9144c7
commit 097e1a5483
18 changed files with 286 additions and 61 deletions

View File

@ -7,8 +7,8 @@
<classpathentry exported="true" kind="con" path="org.eclipse.jdt.USER_LIBRARY/GCORELIBS"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/EXISTLIBS"/>
<classpathentry kind="lib" path="/Dependencies/ISCollector/org.gcube.informationsystem.collector.stubs.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/GCF.TRUNK"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry combineaccessrules="false" kind="src" path="/DISTRO.RESOURCES"/>
<classpathentry combineaccessrules="false" kind="src" path="/DISTRO.RESOURCES.1.1"/>
<classpathentry combineaccessrules="false" kind="src" path="/GCF.1.1.0"/>
<classpathentry kind="output" path="bin"/>
</classpath>

6
README
View File

@ -16,7 +16,7 @@ Authors
Version and Release Date
------------------------
v. 2.2.0 (30-11-2009)
v. 3.0.0 (07-02-2011)
Description
-----------
@ -29,14 +29,14 @@ Source code is available from SVN:
http://svn.d4science.research-infrastructures.eu/gcube/trunk/
Binaries can be downloaded from:
http://software.d4science.research-infrastructures.eu/
https://www.gcube-system.org/index.php?option=com_content&view=article&id=290&Itemid=48
Documentation
-------------
Documentation is available on-line from the Projects Documentation Wiki:
https://technical.wiki.d4science.research-infrastructures.eu/documentation/index.php/IS-Collector
https://gcube.wiki.gcube-system.org/gcube/index.php/IS-Collector
Licensing
---------

View File

@ -26,7 +26,7 @@
<environment name="resourceExpirationTimeInMillis" value="240000"
type="java.lang.String" override="false" />
<environment name="deleteRPsOnStartup" value="true"
<environment name="deleteRPsOnStartup" value="false"
type="java.lang.String" override="false" />
<environment name="maxOperationsPerConnection" value="5000" type="java.lang.String"

View File

@ -142,11 +142,12 @@ public class XMLCollectionAccess extends GCUBEPortType {
*/
public AddDocumentsResponse addDocuments(AddDocumentsRequest addDocumentsRequest)
throws RemoteException, ServiceBusyFaultType, InvalidResourceNameFaultType, InvalidCollectionNameFaultType {
logger.debug("Adding documents to collection");
AddDocumentRequestWrapper[] docs = addDocumentsRequest.getAddDocumentRequestWrapper();
AddDocumentResponseWrapper[] responseWrappers = new AddDocumentResponseWrapper[docs.length];
String targetCollection = this.URItoCollection(addDocumentsRequest.getCollectionName());
logger.debug("Adding " +docs.length + " documents to collection " + targetCollection);
//response wrapper values
//1 - <xsd:enumeration value="Success"/>
//2 - <xsd:enumeration value="DocumentNotAdded-DocumentDoesNotValidate"/>
@ -200,7 +201,9 @@ public class XMLCollectionAccess extends GCUBEPortType {
}
try {
//logger.trace("resource to wrap " + resource.toString());
GCUBEXMLResource xmlResource = wrap(resource, metadataReader);
//logger.trace("wrapped resource " + xmlResource.toString());
boolean exist = false;
if ( State.getDataManager().resourceExists(xmlResource) ) {
exist = true;
@ -267,6 +270,8 @@ public class XMLCollectionAccess extends GCUBEPortType {
xmlResource.setGroupKey(metadataReader.getGroupKey());
xmlResource.setEntryKey(metadataReader.getEntryKey());
xmlResource.setSourceKey(metadataReader.getKey());
xmlResource.setNamespace(metadataReader.getNamespace());
xmlResource.setPublicationMode(metadataReader.getPublicationMode());
}
return xmlResource;
}

View File

@ -102,6 +102,7 @@ public class BaseDAIXResource implements DAIXResource {
} else if (this.dataAsString.compareToIgnoreCase("") != 0) {
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(false);
DocumentBuilder builder = factory.newDocumentBuilder();
StringReader reader = new StringReader(this.dataAsString);
InputSource source = new InputSource(reader);
@ -168,6 +169,7 @@ public class BaseDAIXResource implements DAIXResource {
return this.toString();
Node targetNode = nodelist.item(0);
TransformerFactory transFactory = TransformerFactory.newInstance();
Transformer transformer = transFactory.newTransformer();
StringBuilder ret = new StringBuilder();
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
@ -177,8 +179,8 @@ public class BaseDAIXResource implements DAIXResource {
StringWriter buffer = new StringWriter();
transformer.transform(new DOMSource(node), new StreamResult(buffer));
ret.append(buffer.toString().trim());
node = targetNode.getChildNodes().item(index++);
}
node = targetNode.getChildNodes().item(++index);
}
return ret.toString();
} catch (Exception e) {

View File

@ -2,8 +2,10 @@ package org.gcube.informationsystem.collector.impl.resources;
import java.io.StringReader;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.TimeZone;
import javax.xml.parsers.DocumentBuilder;
@ -14,13 +16,16 @@ import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathFactory;
import org.gcube.common.core.state.GCUBEWSResourcePropertySet;
import org.gcube.common.core.utils.logging.GCUBELog;
import org.gcube.informationsystem.collector.impl.resources.DAIXResource.MalformedResourceException;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
@ -45,13 +50,17 @@ public class GCUBEXMLResource {
protected Calendar terminationTime = null, lastUpdateTime = null;
protected String entryKey, groupKey, source, sourceKey = "", completeSourceKey = "";
protected String entryKey, groupKey, source, sourceKey = "", namespace = "";
// xpath factory to evaluate Xpath expressions
private XPath path = XPathFactory.newInstance().newXPath();
static protected XPath path = XPathFactory.newInstance().newXPath();
static protected Transformer transformer;
private DAIXResource resource;
private String publicationMode = "";
public GCUBEXMLResource(DAIXResource resource) throws MalformedXMLResourceException {
this.resource = resource;
this.terminationTime = new GregorianCalendar();
@ -185,6 +194,15 @@ public class GCUBEXMLResource {
public String getSource() {
return this.source;
}
/**
* The mode in which the resource was published
*
* @return the mode
*/
public String getPublicationMode() {
return this.publicationMode;
}
/**
* Sets the key of the WS-Resource that published the data
@ -206,24 +224,28 @@ public class GCUBEXMLResource {
}
/**
* Sets the complete source key
* Sets the namespace
*
* @param completeKey
* the new complete key
* @param namamespace
* the namespace
*/
public void setCompleteSourceKey(String completeKey) {
this.completeSourceKey = completeKey;
public void setNamespace(String namespace) {
this.namespace = namespace;
}
/**
* Gets the complete source key
* Gets the namespace
*
* @return the complete source key
* @return the namespace
*/
public String getCompleteSourceKey() {
return this.completeSourceKey;
public String getNamespace() {
return this.namespace;
}
public void setPublicationMode(String publicationMode) {
this.publicationMode = publicationMode;
}
/**
* Sets the content of the resource
* @param content the content
@ -233,6 +255,7 @@ public class GCUBEXMLResource {
try {
if (enveloped != null && enveloped.length > 0 && enveloped[0]) {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(false);
DocumentBuilder builder = factory.newDocumentBuilder();
StringReader reader = new StringReader(content);
InputSource source = new InputSource(reader);
@ -263,11 +286,15 @@ public class GCUBEXMLResource {
value = path.evaluate("Document/Source", doc);
this.setSource(value);
value = path.evaluate("Document/SourceKey", doc);
this.setCompleteSourceKey(value);
this.setSourceKey(value);
value = path.evaluate("Document/EntryKey", doc);
this.setEntryKey(value);
value = path.evaluate("Document/GroupKey", doc);
this.setGroupKey(value);
value = path.evaluate("Document/Namespace", doc);
this.setNamespace(value);
value = path.evaluate("Document/PublicationMode", doc);
this.setPublicationMode(value);
} catch (Exception xpee) {
logger.error("" + xpee.getMessage());
logger.error("" + xpee.getStackTrace());
@ -280,16 +307,26 @@ public class GCUBEXMLResource {
// we do not use an XML parser for performance reasons
StringBuilder resource = new StringBuilder("<Document>\n");
try {
resource.append("<ID>" + this.resource.getResourceName() + "</ID>\n");
resource.append("<Source>" + this.getSource() + "</Source>\n");
resource.append("<SourceKey>" + this.getSourceKey() + "</SourceKey>\n");
resource.append("<CompleteSourceKey>" + this.getCompleteSourceKey() + "</CompleteSourceKey>\n");
if (this.getNamespace()!=null && this.getNamespace().length() > 0) {
String completeKey = "<ns1:ResourceKey xmlns:ns1=\"NS\">KEY</ns1:ResourceKey>";
completeKey = completeKey.replace("NS", this.getNamespace());
completeKey = completeKey.replace("KEY", this.getSourceKey());
resource.append("<CompleteSourceKey>" + completeKey + "</CompleteSourceKey>\n");
} else {
resource.append("<CompleteSourceKey></CompleteSourceKey>\n");
}
resource.append("<EntryKey>" + this.getEntryKey() + "</EntryKey>\n");
resource.append("<GroupKey>" + this.getGroupKey() + "</GroupKey>\n");
resource.append("<TerminationTime>" + this.getTerminationTime().getTimeInMillis() + "</TerminationTime>\n");
resource.append("<TerminationTimeHuman>" + this.getTerminationTime().getTime().toString() + "</TerminationTimeHuman>\n");
resource.append("<LastUpdateMs>" + this.lastUpdateTime.getTimeInMillis() + "</LastUpdateMs>\n");
resource.append("<LastUpdateHuman>" + this.lastUpdateTime.getTime().toString() + "</LastUpdateHuman>\n");
resource.append("<PublicationMode>" + this.publicationMode + "</PublicationMode>\n");
resource.append("<Data>\n");
if (this.resource instanceof GCUBEInstanceStateResource) {
//this check is to avoid a stupid message ("[Fatal Error] :1:83: The markup in the document following the root element must be well-formed.") in the nohup.out from the sax parser
@ -378,6 +415,7 @@ public class GCUBEXMLResource {
resource.append(this.resource.toString() + "\n");
resource.append("</Data>\n");
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(false);
DocumentBuilder builder = factory.newDocumentBuilder();
StringReader reader = new StringReader(resource.toString());
InputSource source = new InputSource(reader);
@ -396,20 +434,20 @@ public class GCUBEXMLResource {
* @param content the content to trim
* @return the trimmed content
*/
private String trimProperties(final String content) {
String trimmedContent = content;
String elem = "<"+GCUBEInstanceStateResource.INSTANCESTATE_ROOT_ELEMENT +">";
if (content.startsWith(elem)) {
trimmedContent=trimmedContent.substring(elem.length(), trimmedContent.length());
}
elem = "</"+GCUBEInstanceStateResource.INSTANCESTATE_ROOT_ELEMENT +">";
if (content.endsWith(elem)) {
//trimmedContent=trimmedContent.replace(, "");
trimmedContent=trimmedContent.substring(0, trimmedContent.length() - elem.length());
}
return trimmedContent;
}
// private String trimProperties(final String content) {
// String trimmedContent = content;
// String elem = "<"+GCUBEInstanceStateResource.INSTANCESTATE_ROOT_ELEMENT +">";
// if (content.startsWith(elem)) {
// trimmedContent=trimmedContent.substring(elem.length(), trimmedContent.length());
// }
//
// elem = "</"+GCUBEInstanceStateResource.INSTANCESTATE_ROOT_ELEMENT +">";
// if (content.endsWith(elem)) {
// //trimmedContent=trimmedContent.replace(, "");
// trimmedContent=trimmedContent.substring(0, trimmedContent.length() - elem.length());
// }
// return trimmedContent;
// }
/**
*
@ -430,5 +468,27 @@ public class GCUBEXMLResource {
}
}
public String getSourceRunningInstance() throws Exception {
try {
if (transformer==null) {
transformer = TransformerFactory.newInstance().newTransformer();
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,"yes");
}
List<String> results = new ArrayList<String>();
NodeList set = (NodeList) path.evaluate("/"+GCUBEWSResourcePropertySet.RP_RIID_NAME+"/text()",
this.resource.getContent(), XPathConstants.NODESET);
for (int i=0;i<set.getLength();i++) {
StreamResult sr = new StreamResult(new StringWriter());
try {transformer.transform(new DOMSource(set.item(i)),sr);}catch(Exception ignore) {continue;}
results.add(sr.getWriter().toString());
}
return results.get(0);
} catch(Exception e) {
logger.error("Unable to get RIID",e); throw e;
}
}
}

View File

@ -203,8 +203,8 @@ public class AggregatorRegisteredResource extends AggregatorServiceGroupResource
res.setSource(entryparser.getSourceURI());
res.setSourceKey(entryparser.getSourceKey());
logger.debug("Qualified Source Key: " + entryparser.getQualifiedSourceKey());
res.setCompleteSourceKey(entryparser.getQualifiedSourceKey());
//res.setCompleteSourceKey(entryparser.getQualifiedSourceKey());
res.setNamespace("");
//if the resource is in the to-be-removed list, raise an exception
synchronized (State.deletedResources) {
if (State.deletedResources.contains(res)) {

View File

@ -21,33 +21,57 @@ public class MetadataReader {
this.metadata = metadata;
}
public String getType(){
return this.metadata.getElementsByTagName("Type").item(0).getTextContent();
public String getType() {
try {
return this.metadata.getElementsByTagName("Type").item(0).getTextContent();
}catch (Exception e) {return "";}
}
public String getSource() {
return this.metadata.getElementsByTagName("Source").item(0).getTextContent();
try {
return this.metadata.getElementsByTagName("Source").item(0).getTextContent();
}catch (Exception e) {return "";}
}
public Calendar getTerminationTime() {
//value is in seconds
String value = this.metadata.getElementsByTagName("TimeToLive").item(0).getTextContent();
Calendar now = new GregorianCalendar();
now.setTimeZone(TimeZone.getTimeZone("GMT"));
//add seconds to obtain the effective termination time
now.add(Calendar.SECOND, Integer.valueOf(value));
return now;
try {
//value is in seconds
String value = this.metadata.getElementsByTagName("TimeToLive").item(0).getTextContent();
Calendar now = new GregorianCalendar();
now.setTimeZone(TimeZone.getTimeZone("GMT"));
//add seconds to obtain the effective termination time
now.add(Calendar.SECOND, Integer.valueOf(value));
return now;
}catch (Exception e) {return null;}
}
public String getGroupKey() {
return this.metadata.getElementsByTagName("GroupKey").item(0).getTextContent();
try {
return this.metadata.getElementsByTagName("GroupKey").item(0).getTextContent();
}catch (Exception e) {return "";}
}
public String getEntryKey() {
return this.metadata.getElementsByTagName("EntryKey").item(0).getTextContent();
try {
return this.metadata.getElementsByTagName("EntryKey").item(0).getTextContent();
}catch (Exception e) {return "";}
}
public String getKey() {
return this.metadata.getElementsByTagName("Key").item(0).getTextContent();
try {
return this.metadata.getElementsByTagName("Key").item(0).getTextContent();
}catch (Exception e) {return "";}
}
public String getPublicationMode() {
try {
return this.metadata.getElementsByTagName("PublicationMode").item(0).getTextContent();
}catch (Exception e) {return "";}
}
public String getNamespace() {
try {
return this.metadata.getElementsByTagName("Namespace").item(0).getTextContent();
}catch (Exception e) {return "";}
}
}

View File

@ -4,6 +4,7 @@ import org.gcube.common.core.utils.logging.GCUBELog;
import org.gcube.informationsystem.collector.impl.contexts.ICServiceContext;
import org.gcube.informationsystem.collector.impl.xmlstorage.exist.XMLStorage.STATUS;
import org.gcube.informationsystem.collector.impl.xmlstorage.exist.XMLStorage.XMLStorageNotAvailableException;
import org.gcube.informationsystem.collector.impl.xmlstorage.exist.sweep.Sweeper;
import org.gcube.informationsystem.collector.impl.resources.GCUBEInstanceStateResource;
import org.gcube.informationsystem.collector.impl.resources.GCUBEXMLResource;

View File

@ -367,8 +367,16 @@ public class XMLStorage {
} catch (XMLDBException edb) {
logger.error("Failed to store resource " + resource.getResourceName());
logger.error("" + edb.errorCode + " " + edb.getMessage(), edb);
this.resetCollection(currentCollection);
operationsCounter++;
this.unlock();
throw new MalformedXMLResourceException(edb);
} catch (Exception e) {
logger.error("" + e.getMessage(), e);
this.resetCollection(currentCollection);
operationsCounter++;
this.unlock();
throw new MalformedXMLResourceException(e);
} finally {
this.resetCollection(currentCollection);
operationsCounter++;

View File

@ -0,0 +1,87 @@
package org.gcube.informationsystem.collector.impl.xmlstorage.exist.sweep;
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.TimeZone;
import org.gcube.informationsystem.collector.impl.xmlstorage.exist.XQuery;
import org.gcube.common.core.utils.logging.GCUBELog;
import org.gcube.informationsystem.collector.impl.resources.GCUBEXMLResource;
import org.gcube.informationsystem.collector.impl.xmlstorage.exist.State;
import org.xmldb.api.base.ResourceSet;
import org.xmldb.api.modules.XMLResource;
/**
*
* A resource filter for registered WS-Resources. It decides when a resource is expired or not, depending on its publication mode and
* other criteria.
*
* @author Manuele Simi (ISTI-CNR)
*
*/
class ResourceFilter {
static protected GCUBELog logger = new GCUBELog(ResourceFilter.class);
static boolean isExpired(GCUBEXMLResource resource) {
if (resource.getPublicationMode().compareToIgnoreCase("pull") == 0) {
return isPullExpired(resource);
} else if (resource.getPublicationMode().compareToIgnoreCase("push") == 0) {
return isPushExpired(resource);
}
// default
return false;
}
private static boolean isPushExpired(GCUBEXMLResource resource) {
logger.trace("Checking push resource...");
try {
String status = getRIStatus(resource.getSourceRunningInstance());
logger.trace("The related running instance is in status " + status);
if ((status.compareToIgnoreCase("ready") == 0) || (status.compareToIgnoreCase("started") == 0))
return false;
return true;
} catch (Exception e) {
logger.warn("Unable to detect if the resource is expired",e);
return false;
}
}
static boolean isPullExpired(GCUBEXMLResource resource) {
logger.trace("Checking pull resource...");
Calendar now = new GregorianCalendar();
now.setTimeZone(TimeZone.getTimeZone("GMT"));
logger.trace("Now is " + now.getTimeInMillis());
logger.trace("Resource expires at " + resource.getTerminationTime().getTimeInMillis());
if (now.getTimeInMillis() > resource.getTerminationTime().getTimeInMillis())
return true;
else
return false;
}
private static String readInputStreamAsString(InputStream in) throws IOException {
BufferedInputStream bis = new BufferedInputStream(in);
ByteArrayOutputStream buf = new ByteArrayOutputStream();
int result = bis.read();
while(result != -1) {
byte b = (byte)result;
buf.write(b);
result = bis.read();
}
return buf.toString();
}
private static String getRIStatus(String id)throws Exception {
InputStream statusquery = ResourceFilter.class.getResourceAsStream("XQuery-RIStatus.xml");
XQuery q = new XQuery(readInputStreamAsString(statusquery).replace("$1",id));
ResourceSet result = State.getQueryManager().executeXQuery(q);
XMLResource xmlres = (XMLResource) result.getResource((long) 0);
return ((String) xmlres.getContent()).trim();
}
}

View File

@ -1,7 +1,7 @@
/**
*
*/
package org.gcube.informationsystem.collector.impl.xmlstorage.exist;
package org.gcube.informationsystem.collector.impl.xmlstorage.exist.sweep;
import java.lang.InterruptedException;
import java.util.GregorianCalendar;
@ -12,8 +12,8 @@ import java.util.List;
import org.gcube.common.core.utils.logging.GCUBELog;
import org.gcube.informationsystem.collector.impl.xmlstorage.exist.State;
import org.gcube.informationsystem.collector.impl.xmlstorage.exist.Sweeper;
import org.gcube.informationsystem.collector.impl.xmlstorage.exist.XMLStorage.XMLStorageNotAvailableException;
import org.gcube.informationsystem.collector.impl.xmlstorage.exist.sweep.Sweeper;
import org.gcube.informationsystem.collector.impl.resources.GCUBEInstanceStateResource;
import org.gcube.informationsystem.collector.impl.resources.GCUBEXMLResource;
@ -86,9 +86,7 @@ public class Sweeper implements Runnable {
GCUBEXMLResource xmlresource = new GCUBEXMLResource(tempresource);
State.getDataManager().retrieveResourceContent(xmlresource);
logger.trace("Checking resource " + id);
logger.trace("Now is " + now.getTimeInMillis());
logger.trace("Resource expires at " + xmlresource.getTerminationTime().getTimeInMillis());
if (now.getTimeInMillis() > xmlresource.getTerminationTime().getTimeInMillis()) {
if (ResourceFilter.isExpired(xmlresource)) {
// removes the resources from the database
State.getDataManager().deleteResource(xmlresource);
logger.info("Resource " + xmlresource.getResourceName() + " deleted");

View File

@ -0,0 +1,4 @@
for $RIs in collection("/db/Profiles/RunningInstance")//Document/Data/child::*[local-name()='Profile']/Resource
where $RIs/ID eq '$1'
return
$RIs/Profile/DeploymentData/Status/string()

View File

@ -30,6 +30,8 @@ public final class MetadataRecord {
};
static GCUBELog logger = new GCUBELog(MetadataRecord.class);
private Calendar terminationTime;
private Integer time;
@ -37,6 +39,10 @@ public final class MetadataRecord {
private String source, key, groupKey, entryKey;
private TYPE type;
private String publicationMode = "";
private String namespace = "";
protected MetadataRecord() {}
@ -147,8 +153,10 @@ public final class MetadataRecord {
*/
public Document getAsDocument()
throws SAXException, IOException, ParserConfigurationException {
return DocumentBuilderFactory
.newInstance()
DocumentBuilderFactory factory = DocumentBuilderFactory
.newInstance();
factory.setNamespaceAware(false);
return factory
.newDocumentBuilder()
.parse(new ByteArrayInputStream(getAsBuilder().toString().getBytes("UTF-8")));
}
@ -173,8 +181,30 @@ public final class MetadataRecord {
builder.append("<TimeToLive>").append(this.getTimeToLive()).append("</TimeToLive>");
builder.append("<GroupKey>").append(this.getGroupKey()).append("</GroupKey>");
builder.append("<EntryKey>").append(this.getEntryKey()).append("</EntryKey>");
builder.append("<Namespace>").append(this.getNamespace()).append("</Namespace>");
builder.append("<Key>").append(this.getKey()).append("</Key>");
builder.append("<PublicationMode>").append(this.getPublicationMode()).append("</PublicationMode>");
builder.append("</Metadata>");
//logger.info("Metadata document " + builder.toString());
return builder;
}
private Object getNamespace() {
return this.namespace;
}
public String getPublicationMode() {
return this.publicationMode;
}
public void setPublicationMode(String publicationMode) {
this.publicationMode = publicationMode;
}
public void setNamespace(String namespace) {
this.namespace = namespace;
}
}

View File

@ -23,9 +23,10 @@ public final class MetadataWriter {
* @param groupkey
* @param key
* @param entrykey
* @param publicationMode the mode in which the resource is published
*/
public MetadataWriter(TYPE type, String source,
Integer timeToLive, String groupkey, String key, String entrykey) {
Integer timeToLive, String groupkey, String key, String entrykey, String namespace, String publicationMode) {
this.metadata = new MetadataRecord();
this.metadata.setType(type);
this.metadata.setSource(source);
@ -33,6 +34,8 @@ public final class MetadataWriter {
this.metadata.setGroupKey(groupkey);
this.metadata.setKey(key);
this.metadata.setTimeToLive(timeToLive);
this.metadata.setPublicationMode(publicationMode);
this.metadata.setNamespace(namespace);
}
public MetadataRecord getRecord() {

View File

@ -97,7 +97,7 @@ public class AddDocumentsTester {
MessageElement msgElement = new MessageElement(documents[i].getDocumentElement());
MessageElement msgElement2;
MetadataWriter writer = new MetadataWriter(TYPE.INSTANCESTATE, "http://source",
600, "MyGroupKey", "MyKey", "MyEntryKey");
600, "MyGroupKey", "MyKey", "MyEntryKey","","push");
try {
msgElement2 = new MessageElement(writer.getRecord().getAsDocument().getDocumentElement());
} catch (Exception e) {

View File

@ -0,0 +1,4 @@
for $RIs in collection("/db/Profiles/RunningInstance")//Document/Data/child::*[local-name()='Profile']/Resource
where $RIs/ID eq '3037b1c0-180e-11e0-b6c4-d7845129cab1'
return
$RIs/Profile/DeploymentData/Status/string()

View File

@ -1,6 +1,5 @@
package org.gcube.informationsystem.collector;
import ise.antelope.tasks.util.Base64.InputStream;
import java.io.BufferedReader;
import java.io.IOException;