Merged in rnicoll-direct-request-message (pull request #258)

Add DirectRequestMessage
This commit is contained in:
Ross Nicoll 2016-08-02 13:48:30 +01:00
commit 380233a474

View File

@ -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