Interface LegAction
The LegAction interface represents a change to the legs that make up a trade. During the lifecycle of a trade legs
can be added, removed or updated - these operations are represented by the LegAction.LegActionType
enumeration.
Trade events can be sent between the client and the server in either direction and each TradeEvent
will
contain zero or more leg actions.
In the case of a trade event being received from the client using the TradeListener
interface, the TradeEvent.getLegActions()
method can be used by the TradingDataSource API developer to determine what leg actions the client has performed on
the trade.
In the case of a trade event being sent to the client using the Trade.sendEvent(TradeEvent)
method, the
TradeEvent.addLegAction(LegAction)
method can be used by the TradingDataSource API developer to add leg actions
to the trade.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
An enumeration of possible actions that can be performed on a leg. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a field that relates to this leg, for example the bid price for this transaction.void
Adds a field that relates to this leg, for example the base currency of this transaction.Gets the value of a field on this leg action.Gets an unmodifiable copy of all the fields on this leg action.getLeg()
Gets the underlyingLeg
that this action relates to.getType()
Gets the type of action that this instance represents.
-
Method Details
-
getType
LegAction.LegActionType getType()Gets the type of action that this instance represents.- Returns:
- The action type.
-
addField
Adds a field that relates to this leg, for example the base currency of this transaction.
Each leg has a unique identifier, and any fields added using this method will automatically be prefixed with the correct identifier. For example, if the ID of the underlying leg is 1 and the field name added to this leg is "BaseCurrency" then the field name sent over the wire will be "L1_BaseCurrency".
- Parameters:
name
- The field name.value
- The field value as a String.
-
addField
Adds a field that relates to this leg, for example the bid price for this transaction.
Each leg has a unique identifier, and any fields added using this method will automatically be prefixed with the correct identifier. For example, if the ID of the underlying leg is 1 and the field name added to this leg is "BidPrice" then the field name sent over the wire will be "L1_BidPrice".
- Parameters:
name
- The field name.value
- The field value as an integer.
-
getField
Gets the value of a field on this leg action.
It is not necessary to prefix the field name with the leg identifier, as this is handled by the TradingDataSource. For example, calling this method with the parameter "Amount" will return the value of the field stored as "L1_Amount" if the identifier of the underlying leg is 1.
- Parameters:
name
- The field name.- Returns:
- The value of the field with the specified name, or null if the field does not exist.
-
getFields
Gets an unmodifiable copy of all the fields on this leg action. The field names will be prefixed.
- Returns:
- A map of field name to field value for all the fields on this leg action.
-
getLeg
Leg getLeg()Gets the underlyingLeg
that this action relates to.- Returns:
- The leg.
-