/** * Prepares the message to be forwarded according to the conditions specified in the FIX protocol * specification. * * @param message the FIX message to be forwarded * @param fieldValues a Map of field values for quick access */ private void prepareToForwardMessage(Message message, Map<String, String> fieldValues) { //set OnBehalfOf* fields message.getHeader().setField(new OnBehalfOfCompID(fieldValues.get(FIXConstants.SENDER_COMP_ID))); if (fieldValues.get(FIXConstants.SENDER_SUB_ID) != null) { message.getHeader().setField(new OnBehalfOfSubID(fieldValues.get(FIXConstants.SENDER_SUB_ID))); } if (fieldValues.get(FIXConstants.SENDER_LOCATION_ID) != null) { message.getHeader().setField(new OnBehalfOfLocationID(fieldValues.get(FIXConstants.SENDER_LOCATION_ID))); } //remove additional Sender* fields and DeliverTo* fields message.getHeader().removeField(SenderSubID.FIELD); message.getHeader().removeField(SenderLocationID.FIELD); message.getHeader().removeField(DeliverToCompID.FIELD); message.getHeader().removeField(DeliverToSubID.FIELD); message.getHeader().removeField(DeliverToLocationID.FIELD); }
/** * Puts DeliverToX fields in the message to enable the message to be forwarded at the destination. * * @param message the FIX message to be forwarded * @param fieldValues the Map of field values for quick access */ private void setDeliverToXFields(Message message, Map<String, String> fieldValues) { //Use the fields of the message to set DeliverToX fields String onBehalf = fieldValues.get(FIXConstants.ON_BEHALF_OF_COMP_ID); if (onBehalf != null) { message.getHeader().setField(new DeliverToCompID(onBehalf)); onBehalf = fieldValues.get(FIXConstants.ON_BEHALF_OF_SUB_ID); if (onBehalf != null) { message.getHeader().setField(new DeliverToSubID(onBehalf)); } onBehalf = fieldValues.get(FIXConstants.ON_BEHALF_OF_LOCATION_ID); if (onBehalf != null) { message.getHeader().setField(new DeliverToLocationID(onBehalf)); } message.getHeader().removeField(OnBehalfOfCompID.FIELD); message.getHeader().removeField(OnBehalfOfSubID.FIELD); message.getHeader().removeField(OnBehalfOfLocationID.FIELD); } }
public void reverseRoute(Header header) throws FieldNotFound { this.header.removeField(BeginString.FIELD); this.header.removeField(SenderCompID.FIELD); this.header.removeField(SenderSubID.FIELD); this.header.removeField(SenderLocationID.FIELD); this.header.removeField(TargetCompID.FIELD); this.header.removeField(TargetSubID.FIELD); this.header.removeField(TargetLocationID.FIELD); copyField(header, TargetLocationID.FIELD, SenderLocationID.FIELD); this.header.removeField(OnBehalfOfCompID.FIELD); this.header.removeField(OnBehalfOfSubID.FIELD); this.header.removeField(DeliverToCompID.FIELD); this.header.removeField(DeliverToSubID.FIELD); copyField(header, DeliverToSubID.FIELD, OnBehalfOfSubID.FIELD); this.header.removeField(OnBehalfOfLocationID.FIELD); this.header.removeField(DeliverToLocationID.FIELD);
public void reverseRoute(Header header) throws FieldNotFound { this.header.removeField(BeginString.FIELD); this.header.removeField(SenderCompID.FIELD); this.header.removeField(SenderSubID.FIELD); this.header.removeField(SenderLocationID.FIELD); this.header.removeField(TargetCompID.FIELD); this.header.removeField(TargetSubID.FIELD); this.header.removeField(TargetLocationID.FIELD); copyField(header, TargetLocationID.FIELD, SenderLocationID.FIELD); this.header.removeField(OnBehalfOfCompID.FIELD); this.header.removeField(OnBehalfOfSubID.FIELD); this.header.removeField(DeliverToCompID.FIELD); this.header.removeField(DeliverToSubID.FIELD); copyField(header, DeliverToSubID.FIELD, OnBehalfOfSubID.FIELD); this.header.removeField(OnBehalfOfLocationID.FIELD); this.header.removeField(DeliverToLocationID.FIELD);
public void reverseRoute(Header header) throws FieldNotFound { this.header.removeField(BeginString.FIELD); this.header.removeField(SenderCompID.FIELD); this.header.removeField(SenderSubID.FIELD); this.header.removeField(SenderLocationID.FIELD); this.header.removeField(TargetCompID.FIELD); this.header.removeField(TargetSubID.FIELD); this.header.removeField(TargetLocationID.FIELD); copyField(header, TargetLocationID.FIELD, SenderLocationID.FIELD); this.header.removeField(OnBehalfOfCompID.FIELD); this.header.removeField(OnBehalfOfSubID.FIELD); this.header.removeField(DeliverToCompID.FIELD); this.header.removeField(DeliverToSubID.FIELD); copyField(header, DeliverToSubID.FIELD, OnBehalfOfSubID.FIELD); this.header.removeField(OnBehalfOfLocationID.FIELD); this.header.removeField(DeliverToLocationID.FIELD);
/** * Send a message to a counterparty. Sequence numbers and information about the sender * and target identification will be added automatically (or overwritten if that * information already is present). * * The returned status flag is included for * compatibility with the JNI API but it's usefulness is questionable. * In QuickFIX/J, the message is transmitted using asynchronous network I/O so the boolean * only indicates the message was successfully queued for transmission. An error could still * occur before the message data is actually sent. * * @param message the message to send * @return a status flag indicating whether the write to the network layer was successful. */ public boolean send(Message message) { message.getHeader().removeField(PossDupFlag.FIELD); message.getHeader().removeField(OrigSendingTime.FIELD); return sendRaw(message, 0); }
/** * Send a message to a counterparty. Sequence numbers and information about the sender * and target identification will be added automatically (or overwritten if that * information already is present). * * The returned status flag is included for * compatibility with the JNI API but it's usefulness is questionable. * In QuickFIX/J, the message is transmitted using asynchronous network I/O so the boolean * only indicates the message was successfully queued for transmission. An error could still * occur before the message data is actually sent. * * @param message the message to send * @return a status flag indicating whether the write to the network layer was successful. */ public boolean send(Message message) { message.getHeader().removeField(PossDupFlag.FIELD); message.getHeader().removeField(OrigSendingTime.FIELD); return sendRaw(message, 0); }
/** * Send a message to a counterparty. Sequence numbers and information about the sender * and target identification will be added automatically (or overwritten if that * information already is present). * * The returned status flag is included for * compatibility with the JNI API but it's usefulness is questionable. * In QuickFIX/J, the message is transmitted using asynchronous network I/O so the boolean * only indicates the message was successfully queued for transmission. An error could still * occur before the message data is actually sent. * * @param message the message to send * @return a status flag indicating whether the write to the network layer was successful. */ public boolean send(Message message) { message.getHeader().removeField(PossDupFlag.FIELD); message.getHeader().removeField(OrigSendingTime.FIELD); return sendRaw(message, 0); }