public 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.
Modifier and Type | Interface and Description |
---|---|
static class |
LegAction.LegActionType
An enumeration of possible actions that can be performed on a leg.
|
Modifier and Type | Method and Description |
---|---|
void |
addField(java.lang.String name,
int value)
Adds a field that relates to this leg, for example the bid price for this transaction.
|
void |
addField(java.lang.String name,
java.lang.String value)
Adds a field that relates to this leg, for example the base currency of this transaction.
|
java.lang.String |
getField(java.lang.String name)
Gets the value of a field on this leg action.
|
java.util.Map<java.lang.String,java.lang.String> |
getFields()
Gets an unmodifiable copy of all the fields on this leg action.
|
Leg |
getLeg()
Gets the underlying
Leg that this action relates to. |
LegAction.LegActionType |
getType()
Gets the type of action that this instance represents.
|
LegAction.LegActionType getType()
void addField(java.lang.String name, java.lang.String value)
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".
name
- The field name.value
- The field value as a String.void addField(java.lang.String name, int value)
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".
name
- The field name.value
- The field value as an integer.java.lang.String getField(java.lang.String name)
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.
name
- The field name.java.util.Map<java.lang.String,java.lang.String> getFields()
Gets an unmodifiable copy of all the fields on this leg action. The field names will be prefixed.
Please send bug reports and comments to Caplin support