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