From 9672168f64e3ab5db8b6c22da29ddc8e1ef834c9 Mon Sep 17 00:00:00 2001 From: Ross Nicoll Date: Tue, 2 Aug 2016 13:28:00 +0100 Subject: [PATCH] Add DirectRequestMessage Add DirectRequestMessage for addressing specific endpoints rather than parties. --- .../com/r3corda/protocols/ServiceRequestMessage.kt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/src/main/kotlin/com/r3corda/protocols/ServiceRequestMessage.kt b/core/src/main/kotlin/com/r3corda/protocols/ServiceRequestMessage.kt index 3f878b3ce7..b8391acf90 100644 --- a/core/src/main/kotlin/com/r3corda/protocols/ServiceRequestMessage.kt +++ b/core/src/main/kotlin/com/r3corda/protocols/ServiceRequestMessage.kt @@ -2,6 +2,7 @@ package com.r3corda.protocols import com.r3corda.core.crypto.Party import com.r3corda.core.messaging.MessageRecipients +import com.r3corda.core.messaging.SingleMessageRecipient import com.r3corda.core.node.services.NetworkMapCache /** @@ -13,6 +14,17 @@ interface ServiceRequestMessage { fun getReplyTo(networkMapCache: NetworkMapCache): MessageRecipients } +/** + * A message which specifies reply destination as a specific endpoint such as a monitoring client. This is of particular + * use where we want to address a specific endpoint, not necessarily a specific user (for example if the same user logs + * in on two machines, we want to consistently deliver messages as part of a session, to the same machine the session + * started on). + */ +interface DirectRequestMessage: ServiceRequestMessage { + val replyToRecipient: SingleMessageRecipient + override fun getReplyTo(networkMapCache: NetworkMapCache): MessageRecipients = replyToRecipient +} + interface PartyRequestMessage : ServiceRequestMessage { val replyToParty: Party