public boolean isResponse(Message possibleResponse) { if (correlationField != null){ try { possibleResponse.getField(correlationField); } catch (FieldNotFound e) { return false; } return this.value.equals(correlationField.getValue()); } else { return false; } }
private void cancelReject(Message message, SessionID sessionID) throws FieldNotFound { String id = message.getField(new ClOrdID()).getValue(); Order order = orderTableModel.getOrder(id); if (order == null) return; if (order.getOriginalID() != null) order = orderTableModel.getOrder(order.getOriginalID()); try { order.setMessage(message.getField(new Text()).getValue()); } catch (FieldNotFound e) { } orderTableModel.updateOrder(order, message.getField(new OrigClOrdID()).getValue()); }
/** * Create a new cancel replace from the given message. * * @param inOldMessage a <code>Message</code> value * @return a <code>Message</code> value * @throws FieldNotFound */ public Message newCancelReplaceFromMessage(Message inOldMessage) throws FieldNotFound { Message cancelMessage = newCancelHelper(MsgType.ORDER_CANCEL_REPLACE_REQUEST, inOldMessage, false); if(inOldMessage.isSetField(Price.FIELD)) { cancelMessage.setField(inOldMessage.getField(new Price())); } addHandlingInst(cancelMessage); return cancelMessage; } /**
ExecID execID = (ExecID) message.getField(new ExecID()); if (alreadyProcessed(execID, sessionID)) return; Order order = orderTableModel.getOrder(message.getField(new ClOrdID()).getValue()); if (order == null) { return; message.getField(lastShares); fillSize = new BigDecimal("" + lastShares.getValue()); } else { message.getField(leavesQty); fillSize = new BigDecimal(order.getQuantity()).subtract(new BigDecimal("" + leavesQty.getValue())); OrdStatus ordStatus = (OrdStatus) message.getField(new OrdStatus()); order.setMessage(message.getField(new Text()).getValue()); } catch (FieldNotFound e) { orderTableModel.updateOrder(order, message.getField(new ClOrdID()).getValue()); observableOrder.update(order); execution.setExchangeID(sessionID + message.getField(new ExecID()).getValue()); execution.setSymbol(message.getField(new Symbol()).getValue()); execution.setQuantity(fillSize.intValue()); if (message.isSetField(LastPx.FIELD)) { execution.setPrice(Double.parseDouble(message.getString(LastPx.FIELD)));
try { outgoingMessage.setField(existingMessage .getField(new StringField(fieldInt))); } catch (FieldNotFound e) {
char ordStatus = inMessage.getField(new OrdStatus()).getValue(); switch(ordStatus) { case OrdStatus.REJECTED:
/** * Create a new cancel helper from the given inputs. * * @param inMsgType a <code>String</code> value * @param inOldMessage a <code>Message</code> value * @param inOnlyCopyRequiredFields a <code>boolean</code> value * @return a <code>Message</code> value * @throws FieldNotFound */ public Message newCancelHelper(String inMsgType, Message inOldMessage, boolean inOnlyCopyRequiredFields) throws FieldNotFound { Message cancelMessage = msgFactory.create(beginString, inMsgType); addApplicationVersion(cancelMessage); cancelMessage.setField(new OrigClOrdID(inOldMessage.getString(ClOrdID.FIELD))); fillFieldsFromExistingMessage(inOldMessage, inOnlyCopyRequiredFields, cancelMessage); if (inOldMessage.isSetField(OrderQty.FIELD)){ cancelMessage.setField(inOldMessage.getField(new OrderQty())); } addTransactionTimeIfNeeded(cancelMessage); addSendingTime(cancelMessage); return cancelMessage; }
quickfix.field.Side orderSide = new quickfix.field.Side(); try { deltaMessage.getField(orderSide); } catch (FieldNotFound e) { orderSide.setValue(quickfix.field.Side.UNDISCLOSED);
getLog().onErrorEvent( "Warn: incoming message with incorrect field: " + message.getField(e.getField()) + ": " + message);
getLog().onErrorEvent( "Warn: incoming message with incorrect field: " + message.getField(e.getField()) + ": " + getMessageToLog(message));
getLog().onErrorEvent( "Warn: incoming message with incorrect field: " + message.getField(e.getField()) + ": " + getMessageToLog(message));