com.r3corda.protocols / TwoPartyDealProtocol

# TwoPartyDealProtocol

`object TwoPartyDealProtocol`

Classes for manipulating a two party deal or agreement.

TODO: The subclasses should probably be broken out into individual protocols rather than making this an ever expanding collection of subclasses.

TODO: Also, the term Deal is used here where we might prefer Agreement.

TODO: Consider whether we can merge this with TwoPartyTradeProtocol

### Types

Acceptor | `class Acceptor<T : DealState> : Secondary<T>` One side of the protocol for inserting a pre-agreed deal.
Fixer | `class Fixer : Secondary<StateRef>` One side of the fixing protocol for an interest rate swap, but could easily be generalised further.
FixingRoleDecider | `class FixingRoleDecider : ProtocolLogic<Unit>` This protocol looks at the deal and decides whether to be the Fixer or Floater role in agreeing a fixing.
FixingSessionInitiation | `data class FixingSessionInitiation` Used to set up the session between Floater and Fixer
Floater | `class Floater : Primary<StateRef>` One side of the fixing protocol for an interest rate swap, but could easily be generalised furher
Handshake | `data class Handshake<T>`
Instigator | `class Instigator<T : DealState> : Primary<T>` One side of the protocol for inserting a pre-agreed deal.
Primary | `abstract class Primary<U> : ProtocolLogic<SignedTransaction>` Abstracted bilateral deal protocol participant that initiates communication/handshake.
Secondary | `abstract class Secondary<U> : ProtocolLogic<SignedTransaction>` Abstracted bilateral deal protocol participant that is recipient of initial communication.
SignaturesFromPrimary | `class SignaturesFromPrimary`

### Exceptions

DealMismatchException | `class DealMismatchException : Exception`
DealRefMismatchException | `class DealRefMismatchException : Exception`

### Properties

DEAL_TOPIC | `val DEAL_TOPIC: String`
FIX_INITIATE_TOPIC | `val FIX_INITIATE_TOPIC: String` This topic exists purely for FixingSessionInitiation to be sent from FixingRoleDecider to FixingSessionInitiationHandler