use of won.protocol.service.WonNodeInformationService in project webofneeds by researchstudio-sat.
the class RespondWithEchoToMessageAction method createWonMessage.
private WonMessage createWonMessage(URI connectionURI, String textMessage) throws WonMessageBuilderException {
WonNodeInformationService wonNodeInformationService = getEventListenerContext().getWonNodeInformationService();
Dataset connectionRDF = getEventListenerContext().getLinkedDataSource().getDataForResource(connectionURI);
URI remoteNeed = WonRdfUtils.ConnectionUtils.getRemoteNeedURIFromConnection(connectionRDF, connectionURI);
URI localNeed = WonRdfUtils.ConnectionUtils.getLocalNeedURIFromConnection(connectionRDF, connectionURI);
URI wonNode = WonRdfUtils.ConnectionUtils.getWonNodeURIFromConnection(connectionRDF, connectionURI);
Dataset remoteNeedRDF = getEventListenerContext().getLinkedDataSource().getDataForResource(remoteNeed);
URI messageURI = wonNodeInformationService.generateEventURI(wonNode);
return WonMessageBuilder.setMessagePropertiesForConnectionMessage(messageURI, connectionURI, localNeed, wonNode, WonRdfUtils.ConnectionUtils.getRemoteConnectionURIFromConnection(connectionRDF, connectionURI), remoteNeed, WonRdfUtils.NeedUtils.getWonNodeURIFromNeed(remoteNeedRDF, remoteNeed), textMessage).build();
}
use of won.protocol.service.WonNodeInformationService in project webofneeds by researchstudio-sat.
the class ExecuteCloseCommandAction method createWonMessage.
protected WonMessage createWonMessage(CloseCommandEvent connectCommandEvent) throws WonMessageBuilderException {
URI connectionURI = connectCommandEvent.getConnectionURI();
WonNodeInformationService wonNodeInformationService = getEventListenerContext().getWonNodeInformationService();
Dataset connectionRDF = getEventListenerContext().getLinkedDataSource().getDataForResource(connectionURI);
URI remoteNeed = WonRdfUtils.ConnectionUtils.getRemoteNeedURIFromConnection(connectionRDF, connectionURI);
URI localNeed = WonRdfUtils.ConnectionUtils.getLocalNeedURIFromConnection(connectionRDF, connectionURI);
URI wonNode = WonRdfUtils.ConnectionUtils.getWonNodeURIFromConnection(connectionRDF, connectionURI);
Dataset remoteNeedRDF = getEventListenerContext().getLinkedDataSource().getDataForResource(remoteNeed);
return WonMessageBuilder.setMessagePropertiesForClose(wonNodeInformationService.generateEventURI(wonNode), connectionURI, localNeed, wonNode, WonRdfUtils.ConnectionUtils.getRemoteConnectionURIFromConnection(connectionRDF, connectionURI), remoteNeed, WonRdfUtils.NeedUtils.getWonNodeURIFromNeed(remoteNeedRDF, remoteNeed), connectCommandEvent.getCloseMessage()).build();
}
use of won.protocol.service.WonNodeInformationService in project webofneeds by researchstudio-sat.
the class ConnectFromListToListAction method createWonMessage.
private WonMessage createWonMessage(URI fromUri, URI toUri) throws WonMessageBuilderException {
WonNodeInformationService wonNodeInformationService = getEventListenerContext().getWonNodeInformationService();
Dataset localNeedRDF = getEventListenerContext().getLinkedDataSource().getDataForResource(fromUri);
Dataset remoteNeedRDF = getEventListenerContext().getLinkedDataSource().getDataForResource(toUri);
URI localWonNode = WonRdfUtils.NeedUtils.getWonNodeURIFromNeed(localNeedRDF, fromUri);
URI remoteWonNode = WonRdfUtils.NeedUtils.getWonNodeURIFromNeed(remoteNeedRDF, toUri);
return WonMessageBuilder.setMessagePropertiesForConnect(wonNodeInformationService.generateEventURI(localWonNode), fromFacet, fromUri, localWonNode, toFacet, toUri, remoteWonNode, welcomeMessage).build();
}
use of won.protocol.service.WonNodeInformationService in project webofneeds by researchstudio-sat.
the class BATestScriptListener method createWonMessageForOpen.
private WonMessage createWonMessageForOpen(URI fromConUri, URI fromNeedUri, URI toConUri, URI toNeedUri) throws WonMessageBuilderException {
WonNodeInformationService wonNodeInformationService = getEventListenerContext().getWonNodeInformationService();
Dataset localNeedRDF = getEventListenerContext().getLinkedDataSource().getDataForResource(fromNeedUri);
Dataset remoteNeedRDF = getEventListenerContext().getLinkedDataSource().getDataForResource(toNeedUri);
URI localWonNode = WonRdfUtils.NeedUtils.getWonNodeURIFromNeed(localNeedRDF, fromNeedUri);
URI remoteWonNode = WonRdfUtils.NeedUtils.getWonNodeURIFromNeed(remoteNeedRDF, toNeedUri);
return WonMessageBuilder.setMessagePropertiesForOpen(wonNodeInformationService.generateEventURI(localWonNode), fromConUri, fromNeedUri, localWonNode, toConUri, toNeedUri, remoteWonNode, null).build();
}
use of won.protocol.service.WonNodeInformationService in project webofneeds by researchstudio-sat.
the class BATestScriptListener method createWonMessageForConnectionMessage.
private WonMessage createWonMessageForConnectionMessage(URI fromConUri, URI fromNeedUri, URI toConUri, URI toNeedUri, Model content) throws WonMessageBuilderException {
WonNodeInformationService wonNodeInformationService = getEventListenerContext().getWonNodeInformationService();
Dataset localNeedRDF = getEventListenerContext().getLinkedDataSource().getDataForResource(fromNeedUri);
Dataset remoteNeedRDF = getEventListenerContext().getLinkedDataSource().getDataForResource(toNeedUri);
URI localWonNode = WonRdfUtils.NeedUtils.getWonNodeURIFromNeed(localNeedRDF, fromNeedUri);
URI remoteWonNode = WonRdfUtils.NeedUtils.getWonNodeURIFromNeed(remoteNeedRDF, toNeedUri);
return WonMessageBuilder.setMessagePropertiesForConnectionMessage(wonNodeInformationService.generateEventURI(localWonNode), fromConUri, fromNeedUri, localWonNode, toConUri, toNeedUri, remoteWonNode, content).build();
}
Aggregations