public synchronized URI getMessageURI() { if (this.messageURI == null) { this.messageURI = findMessageUri(getOuterEnvelopeGraph(), getOuterEnvelopeGraphURI().toString()); } return this.messageURI; }
/** * Adds a property to the message resource in the outermost envelope. * * @param property * @param value */ public synchronized void addMessageProperty(Property property, double value) { addMessageProperty(property, getOuterEnvelopeGraph().createTypedLiteral(value)); }
/** * Adds a property to the message resource in the outermost envelope. * * @param property * @param value */ public synchronized void addMessageProperty(Property property, RDFNode value) { if (logger.isDebugEnabled()) { logger.debug("adding property {}, value {}, to message {} in envelope {}", new Object[]{property, value, getMessageURI(), getOuterEnvelopeGraphURI()}); } getOuterEnvelopeGraph().getResource(getMessageURI().toString()).addProperty(property, value); }
/** * Adds a property to the message resource in the outermost envelope. * * @param property * @param value */ public synchronized void addMessageProperty(Property property, long value) { addMessageProperty(property, getOuterEnvelopeGraph().createTypedLiteral(value)); }
private synchronized List<URI> getEnvelopePropertyURIValues(Property property) { List<URI> values = new ArrayList<URI>(); Model currentEnvelope = getOuterEnvelopeGraph(); URI currentEnvelopeUri = getOuterEnvelopeGraphURI(); //TODO would make sense to order envelope graphs in order from container to containee in the first place while (currentEnvelope != null) { URI currentMessageURI = findMessageUri(currentEnvelope, currentEnvelopeUri.toString()); StmtIterator it = currentEnvelope.listStatements(currentEnvelope.getResource(currentMessageURI.toString()), property, (RDFNode) null); while (it.hasNext()) { values.add(URI.create(it.nextStatement().getObject().asResource().toString())); } currentEnvelopeUri = RdfUtils.findFirstObjectUri(currentEnvelope, WONMSG.CONTAINS_ENVELOPE, null, true, true); currentEnvelope = null; if (currentEnvelopeUri != null) { currentEnvelope = this.completeDataset.getNamedModel(currentEnvelopeUri.toString()); } } return values; }
/** * Adds a property to the message resource in the outermost envelope. * * @param property * @param value */ public synchronized void addMessageProperty(Property property, boolean value) { addMessageProperty(property, getOuterEnvelopeGraph().createTypedLiteral(value)); }
public synchronized URI getEnvelopePropertyURIValue(Property property) { Model currentEnvelope = getOuterEnvelopeGraph(); URI currentEnvelopeUri = getOuterEnvelopeGraphURI(); //TODO would make sense to order envelope graphs in order from container to containee in the first place, //if proper done, we should avoid ending up in infinite loop if someone sends us malformed envelopes that // contain-in-other circular... while (currentEnvelope != null) { URI currentMessageURI = findMessageUri(currentEnvelope, currentEnvelopeUri.toString()); StmtIterator it = currentEnvelope.listStatements(currentEnvelope.getResource(currentMessageURI.toString()), property, (RDFNode) null); if (it.hasNext()) { return URI.create(it.nextStatement().getObject().asResource().toString()); } // move to the next envelope currentEnvelopeUri = RdfUtils.findFirstObjectUri(currentEnvelope, WONMSG.CONTAINS_ENVELOPE, null, true, true); currentEnvelope = null; if (currentEnvelopeUri != null) { currentEnvelope = this.completeDataset.getNamedModel(currentEnvelopeUri.toString()); } } return null; }
/** * Adds a property to the message resource in the outermost envelope. * * @param property * @param uri the object of the property, assumed to be an uri */ public synchronized void addMessageProperty(Property property, String uri) { RDFNode valueAsRdfNode = getOuterEnvelopeGraph().createResource(uri); addMessageProperty(property, valueAsRdfNode); }
/** * Adds a property to the message resource in the outermost envelope. * * @param property * @param value */ public synchronized void addMessageProperty(Property property, int value) { addMessageProperty(property, getOuterEnvelopeGraph().createTypedLiteral(value)); }
/** * Adds a property to the message resource in the outermost envelope. * * @param property * @param value */ public synchronized void addMessageProperty(Property property, float value) { addMessageProperty(property, getOuterEnvelopeGraph().createTypedLiteral(value)); }