Codota Logo
quickfix
Code IndexAdd Codota to your IDE (free)

How to use quickfix

Best Java code snippets using quickfix (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
DateTime d =
  • Codota Iconnew DateTime()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseDateTime(text)
  • Codota IconObject instant;new DateTime(instant)
  • Smart code suggestions by Codota
}
origin: quickfix-j/quickfixj

private void initializeHeader(Message.Header header) {
  state.setLastSentTime(SystemTime.currentTimeMillis());
  header.setString(BeginString.FIELD, sessionID.getBeginString());
  header.setString(SenderCompID.FIELD, sessionID.getSenderCompID());
  optionallySetID(header, SenderSubID.FIELD, sessionID.getSenderSubID());
  optionallySetID(header, SenderLocationID.FIELD, sessionID.getSenderLocationID());
  header.setString(TargetCompID.FIELD, sessionID.getTargetCompID());
  optionallySetID(header, TargetSubID.FIELD, sessionID.getTargetSubID());
  optionallySetID(header, TargetLocationID.FIELD, sessionID.getTargetLocationID());
  header.setInt(MsgSeqNum.FIELD, getExpectedSenderNum());
  insertSendingTime(header);
}
origin: quickfix-j/quickfixj

private void nextReject(Message reject) throws FieldNotFound, RejectLogon, IncorrectDataFormat,
    IncorrectTagValue, UnsupportedMessageType, IOException, InvalidMessage {
  if (!verify(reject, false, validateSequenceNumbers)) {
    return;
  }
  if (getExpectedTargetNum() == reject.getHeader().getInt(MsgSeqNum.FIELD)) {
    state.incrNextTargetMsgSeqNum();
  }
  nextQueued();
}
origin: quickfix-j/quickfixj

public void generateTestRequest(String id) {
  state.incrementTestRequestCounter();
  final Message testRequest = messageFactory.create(sessionID.getBeginString(),
      MsgType.TEST_REQUEST);
  initializeHeader(testRequest.getHeader());
  testRequest.setString(TestReqID.FIELD, id);
  sendRaw(testRequest, 0);
}
origin: quickfix-j/quickfixj

void setSessionID(SessionID sessionID) {
  header.setString(BeginString.FIELD, sessionID.getBeginString());
  header.setString(SenderCompID.FIELD, sessionID.getSenderCompID());
  optionallySetID(header, SenderSubID.FIELD, sessionID.getSenderSubID());
  optionallySetID(header, SenderLocationID.FIELD, sessionID.getSenderLocationID());
  header.setString(TargetCompID.FIELD, sessionID.getTargetCompID());
  optionallySetID(header, TargetSubID.FIELD, sessionID.getTargetSubID());
  optionallySetID(header, TargetLocationID.FIELD, sessionID.getTargetLocationID());
}
origin: quickfix-j/quickfixj

private boolean doTargetTooLow(Message msg) throws FieldNotFound, IOException {
  if (!isPossibleDuplicate(msg)) {
    final int msgSeqNum = msg.getHeader().getInt(MsgSeqNum.FIELD);
    final String text = "MsgSeqNum too low, expecting " + getExpectedTargetNum()
        + " but received " + msgSeqNum;
    generateLogout(text);
    throw new SessionException(text);
  }
  return validatePossDup(msg);
}
origin: quickfix-j/quickfixj

public void generateHeartbeat() {
  final Message heartbeat = messageFactory.create(sessionID.getBeginString(),
      MsgType.HEARTBEAT);
  initializeHeader(heartbeat.getHeader());
  sendRaw(heartbeat, 0);
}
origin: quickfix-j/quickfixj

private String getMsgType() throws InvalidMessage {
  try {
    return header.getString(MsgType.FIELD);
  } catch (final FieldNotFound e) {
    throw MessageUtils.newInvalidMessageException(e.getMessage() + " in " + messageData, this);
  }
}
origin: quickfix-j/quickfixj

private void initializeResendFields(Message message) throws FieldNotFound {
  final Message.Header header = message.getHeader();
  final LocalDateTime sendingTime = header.getUtcTimeStamp(SendingTime.FIELD);
  header.setUtcTimeStamp(OrigSendingTime.FIELD, sendingTime, getTimestampPrecision());
  header.setBoolean(PossDupFlag.FIELD, true);
  insertSendingTime(header);
}
origin: quickfix-j/quickfixj

private boolean isNextField(DataDictionary dd, Header fields, int tag) throws InvalidMessage {
  final StringField field = extractField(dd, header);
  if (field == null || field.getTag() != tag) {
    return false;
  }
  fields.setField(field);
  return true;
}
origin: quickfix-j/quickfixj

private Object cloneTo(Message message) {
  message.initializeFrom(this);
  message.header.initializeFrom(getHeader());
  message.trailer.initializeFrom(getTrailer());
  return message;
}
origin: quickfix-j/quickfixj

private void processPreFixtDataDictionary(SessionID sessionID, SessionSettings settings,
    DefaultDataDictionaryProvider dataDictionaryProvider) throws ConfigError,
    FieldConvertError {
  final DataDictionary dataDictionary = createDataDictionary(sessionID, settings,
      Session.SETTING_DATA_DICTIONARY, sessionID.getBeginString());
  dataDictionaryProvider.addTransportDictionary(sessionID.getBeginString(), dataDictionary);
  dataDictionaryProvider.addApplicationDictionary(
      MessageUtils.toApplVerID(sessionID.getBeginString()), dataDictionary);
}
origin: quickfix-j/quickfixj

public static SessionID getSessionID(Message fixMessage) {
  final Header header = fixMessage.getHeader();
  return new SessionID(getFieldOrDefault(header, BeginString.FIELD, null), getFieldOrDefault(
      header, SenderCompID.FIELD, null), getFieldOrDefault(header, SenderSubID.FIELD,
      null), getFieldOrDefault(header, SenderLocationID.FIELD, null), getFieldOrDefault(
      header, TargetCompID.FIELD, null), getFieldOrDefault(header, TargetSubID.FIELD,
      null), getFieldOrDefault(header, TargetLocationID.FIELD, null), null);
}
origin: quickfix-j/quickfixj

public DataDictionary getDataDictionary() {
  if (!sessionID.isFIXT()) {
    // For pre-FIXT sessions, the session data dictionary is the same as the application
    // data dictionary.
    return dataDictionaryProvider.getSessionDataDictionary(sessionID.getBeginString());
  } else {
    throw new SessionException("No default data dictionary for FIXT 1.1 and newer");
  }
}
origin: quickfix-j/quickfixj

private void parseTrailer(DataDictionary dd) throws InvalidMessage {
  StringField field = extractField(dd, trailer);
  while (field != null) {
    if (!isTrailerField(field, dd)) {
      throw new FieldException(SessionRejectReason.TAG_SPECIFIED_OUT_OF_REQUIRED_ORDER,
          field.getTag());
    }
    trailer.setField(field);
    field = extractField(dd, trailer);
  }
}
origin: quickfix-j/quickfixj

private void setField(FieldMap fields, StringField field) {
  if (fields.isSetField(field)) {
    throw new FieldException(SessionRejectReason.TAG_APPEARS_MORE_THAN_ONCE, field.getTag());
  }
  fields.setField(field);
}
origin: quickfix-j/quickfixj

@Override
public boolean isSessionTime() {
  if(isNonStopSession()) {
    return true;
  }
  Calendar now = SystemTime.getUtcCalendar();
  TimeInterval interval = theMostRecentIntervalBefore(now);
  return interval.isContainingTime(now);
}
origin: quickfix-j/quickfixj

private boolean isCurrentSession(final long time)
    throws IOException {
  return sessionSchedule == null || sessionSchedule.isSameSession(
      SystemTime.getUtcCalendar(time), SystemTime.getUtcCalendar(state.getCreationTime()));
}
origin: quickfix-j/quickfixj

@Override
public void clear() {
  super.clear();
  header.clear();
  trailer.clear();
  position = 0;
}
origin: quickfix-j/quickfixj

  public SessionSchedule create(SessionID sessionID, SessionSettings settings) throws ConfigError
  {
    try {
      return new DefaultSessionSchedule(settings, sessionID);
    } catch (final FieldConvertError e) {
      throw new ConfigError(e.getMessage());
    }
  }
}
origin: quickfix-j/quickfixj

public static SessionID getReverseSessionID(Message fixMessage) {
  final Header header = fixMessage.getHeader();
  return new SessionID(getFieldOrDefault(header, BeginString.FIELD, null), getFieldOrDefault(
      header, TargetCompID.FIELD, null), getFieldOrDefault(header, TargetSubID.FIELD,
      null), getFieldOrDefault(header, TargetLocationID.FIELD, null), getFieldOrDefault(
      header, SenderCompID.FIELD, null), getFieldOrDefault(header, SenderSubID.FIELD,
      null), getFieldOrDefault(header, SenderLocationID.FIELD, null), null);
}
quickfix

Most used classes

  • Message$Header
  • Side
  • ClOrdID
  • Symbol
  • MsgType
  • OrderID,
  • Price,
  • OrderQty,
  • OrigClOrdID,
  • OrdType,
  • TransactTime,
  • AvgPx,
  • CumQty,
  • ExecID,
  • Text,
  • Session,
  • SessionSettings,
  • Account,
  • LeavesQty
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now