/** * Appends a string representation of this message to the specified string * builder. * * @param builder a string builder */ public void toString(StringBuilder builder) { for (int i = 0; i < count; i++) { builder.append(tags[i]); builder.append('='); values[i].asString(builder); builder.append('|'); } }
/** * Appends a string representation of this message to the specified string * builder. * * @param builder a string builder */ public void toString(StringBuilder builder) { for (int i = 0; i < count; i++) { builder.append(tags[i]); builder.append('='); values[i].asString(builder); builder.append('|'); } }
@Benchmark public StringBuilder asString() { stringValue.asString(string); return string; }
private void handleTestRequest(FIXMessage message) throws IOException { FIXValue testReqId = message.valueOf(TestReqID); if (testReqId == null) { sendReject(message.getMsgSeqNum(), 1, "TestReqID(112) not found"); return; } string.setLength(0); testReqId.asString(string); sendHeartbeat(string); }
private void handleLogon(FIXMessage message) throws IOException { if (senderCompId.isEmpty()) { FIXValue value = message.valueOf(TargetCompID); if (value == null) { statusListener.close(FIXConnection.this, "SenderCompID(49) not found"); return; } senderCompId = value.asString(); } if (targetCompId.isEmpty()) { FIXValue value = message.valueOf(SenderCompID); if (value == null) { statusListener.close(FIXConnection.this, "TargetCompID(56) not found"); return; } targetCompId = value.asString(); } statusListener.logon(FIXConnection.this, message); }
private void handleLogon(FIXMessage message) throws IOException { if (senderCompId.isEmpty()) { FIXValue value = message.valueOf(TargetCompID); if (value == null) { statusListener.close(FIXConnection.this, "SenderCompID(49) not found"); return; } senderCompId = value.asString(); } if (targetCompId.isEmpty()) { FIXValue value = message.valueOf(SenderCompID); if (value == null) { statusListener.close(FIXConnection.this, "TargetCompID(56) not found"); return; } targetCompId = value.asString(); } statusListener.logon(FIXConnection.this, message); }
static Message get(FIXMessage message) { List<Field> fields = new ArrayList<>(); String msgType = null; for (int i = 0; i < message.getFieldCount(); i++) { int tag = message.tagAt(i); String value = message.valueAt(i).asString(); if (tag == MsgType) msgType = value; else fields.add(new Field(tag, value)); } if (msgType == null) throw new IllegalArgumentException("MsgType(35) missing"); return new Message(msgType, fields); }
@Override public void logon(FIXConnection connection, FIXMessage message) throws IOException { FIXValue username = message.valueOf(Username); if (username == null) { requiredTagMissing(message, "Username(553) missing"); return; } FIXValue password = message.valueOf(Password); if (password == null) { requiredTagMissing(message, "Password(554) missing"); return; } fix.updateCompID(message); ASCII.putLeft(loginRequest.username, username.asString()); ASCII.putLeft(loginRequest.password, password.asString()); ASCII.putRight(loginRequest.requestedSession, ""); ASCII.putLongRight(loginRequest.requestedSequenceNumber, 0); orderEntry.login(loginRequest); }