/** * Build the connection configuration. * * @return the connection configuration */ public FIXConfig build() { return new FIXConfig(version, senderCompId, targetCompId, heartBtInt, incomingMsgSeqNum, outgoingMsgSeqNum, maxFieldCount, fieldCapacity, rxBufferCapacity, txBufferCapacity, checkSumEnabled); }
/** * Create a message container. * * @return a message container */ public FIXMessage create() { return new FIXMessage(config.getMaxFieldCount(), config.getFieldCapacity()); }
this.checkSum = new FIXValue(CHECK_SUM_FIELD_CAPACITY); this.beginString.setString(config.getVersion().getBeginString()); this.senderCompId = config.getSenderCompID(); this.targetCompId = config.getTargetCompID(); new FIXMessage(config.getMaxFieldCount(), config.getFieldCapacity()), config.isCheckSumEnabled()); this.rxMsgSeqNum = config.getIncomingMsgSeqNum(); this.txMsgSeqNum = config.getOutgoingMsgSeqNum(); this.rxBuffer = ByteBuffer.allocateDirect(config.getRxBufferCapacity()); this.txHeaderBuffer = ByteBuffer.allocateDirect(config.getTxBufferCapacity()); this.txBodyBuffer = ByteBuffer.allocateDirect(config.getTxBufferCapacity()); this.lastTxMillis = clock.currentTimeMillis(); this.heartbeatMillis = config.getHeartBtInt() * 1000; this.testRequestMillis = config.getHeartBtInt() * 1100; this.txMessage = new FIXMessage(config.getMaxFieldCount(), config.getFieldCapacity()); this.currentTimestamp = new StringBuilder(config.getFieldCapacity());
/** * Create a message parser. * * @param config the parser configuration * @param listener the message listener */ public FIXMessageParser(FIXConfig config, FIXMessageListener listener) { this.message = new FIXMessage(config.getMaxFieldCount(), config.getFieldCapacity()); this.checkSumEnabled = config.isCheckSumEnabled(); this.listener = listener; this.beginString = new FIXValue(BEGIN_STRING_FIELD_CAPACITY); this.bodyLength = new FIXValue(BODY_LENGTH_FIELD_CAPACITY); this.checkSum = new FIXValue(CHECK_SUM_FIELD_CAPACITY); }
/** * Send a Logon(A) message. Set EncryptMethod(98) to 0 and HeartBtInt(108) * according to the connection configuration. * * @param resetSeqNum if true set ResetSeqNumFlag(141) to true, otherwise * omit ResetSeqNumFlag(141) * @throws IOException if an I/O error occurs */ public void sendLogon(boolean resetSeqNum) throws IOException { prepare(txMessage, Logon); txMessage.addField(EncryptMethod).setInt(0); txMessage.addField(HeartBtInt).setInt(config.getHeartBtInt()); if (resetSeqNum) txMessage.addField(ResetSeqNumFlag).setChar('Y'); send(txMessage); }
MessageHandler(FIXMessageListener downstream) { this.downstream = downstream; this.string = new StringBuilder(config.getFieldCapacity()); }
this.checkSum = new FIXValue(CHECK_SUM_FIELD_CAPACITY); this.senderCompId = config.getSenderCompID(); this.targetCompId = config.getTargetCompID(); this.rxMsgSeqNum = config.getIncomingMsgSeqNum(); this.txMsgSeqNum = config.getOutgoingMsgSeqNum(); this.rxBuffer = ByteBuffer.allocateDirect(config.getRxBufferCapacity()); this.txHeaderBuffer = ByteBuffer.allocateDirect(config.getTxBufferCapacity()); beginString.setString(config.getVersion().getBeginString()); this.txBodyBuffer = ByteBuffer.allocateDirect(config.getTxBufferCapacity()); this.lastTxMillis = clock.currentTimeMillis(); this.heartbeatMillis = config.getHeartBtInt() * 1000; this.testRequestMillis = config.getHeartBtInt() * 1100; this.txMessage = new FIXMessage(config.getMaxFieldCount(), config.getFieldCapacity()); this.currentTimestamp = new StringBuilder(config.getFieldCapacity());
/** * Send a Logon(A) message. Set EncryptMethod(98) to 0 and HeartBtInt(108) * according to the connection configuration. * * @param resetSeqNum if true set ResetSeqNumFlag(141) to true, otherwise * omit ResetSeqNumFlag(141) * @throws IOException if an I/O error occurs */ public void sendLogon(boolean resetSeqNum) throws IOException { prepare(txMessage, Logon); txMessage.addField(EncryptMethod).setInt(0); txMessage.addField(HeartBtInt).setInt(config.getHeartBtInt()); if (resetSeqNum) txMessage.addField(ResetSeqNumFlag).setBoolean(true); send(txMessage); }
/** * Create a message container. * * @return a message container */ public FIXMessage create() { return new FIXMessage(config.getMaxFieldCount(), config.getFieldCapacity()); }
/** * Build the connection configuration. * * @return the connection configuration */ public FIXConfig build() { return new FIXConfig(version, senderCompId, targetCompId, heartBtInt, incomingMsgSeqNum, outgoingMsgSeqNum, maxFieldCount, fieldCapacity, rxBufferCapacity, txBufferCapacity, checkSumEnabled); }