/** * Converts the message into a simple XML format. This format is * probably not sufficient for production use, but it more intended * for diagnostics and debugging. THIS IS NOT FIXML. * * To get names instead of tag number, use toXML(DataDictionary) * instead. * * @return an XML representation of the message. * @see #toXML(DataDictionary) */ public String toXML() { return toXML(null); }
/** * Converts the message into a simple XML format. This format is * probably not sufficient for production use, but it more intended * for diagnostics and debugging. THIS IS NOT FIXML. * * To get names instead of tag number, use toXML(DataDictionary) * instead. * * @return an XML representation of the message. * @see #toXML(DataDictionary) */ public String toXML() { return toXML(null); }
/** * Converts the message into a simple XML format. This format is * probably not sufficient for production use, but it more intended * for diagnostics and debugging. THIS IS NOT FIXML. * * To get names instead of tag number, use toXML(DataDictionary) * instead. * * @return an XML representation of the message. * @see #toXML(DataDictionary) */ public String toXML() { return toXML(null); }
/** * {@inheritDoc} */ @Override public void fromAdmin(Message message, SessionID sessionId) throws FieldNotFound, IncorrectDataFormat, IncorrectTagValue, RejectLogon { if (log.isTraceEnabled()) { log.trace("fromAdmin: {}", message); log.trace("fromAdmin: {}", message.toXML(dataDictionary)); } }
/** * {@inheritDoc} */ @Override public void toApp(Message message, SessionID sessionId) throws DoNotSend { if (log.isTraceEnabled()) { log.trace("toApp: {}", message); log.trace("toApp: {}", message.toXML(dataDictionary)); } }
/** * {@inheritDoc} */ @Override public void fromApp(Message message, SessionID sessionId) throws FieldNotFound, IncorrectDataFormat, IncorrectTagValue, UnsupportedMessageType { if (log.isTraceEnabled()) { log.trace("fromApp: {}", message); log.trace("fromApp: {}", message.toXML(dataDictionary)); } crack(message, sessionId); }
@Override public void onLogon(SessionID sessionId) { log.info("logged on"); super.onLogon(sessionId); String mdReqId = UUID.randomUUID().toString(); Message message = buildMarketDataRequest( "btccny" + mdReqId, "BTC/CNY", SubscriptionRequestType.SNAPSHOT_PLUS_UPDATES, 100, MDUpdateType.FULL_REFRESH, MDEntryType.OPENING_PRICE, MDEntryType.CLOSING_PRICE, MDEntryType.TRADING_SESSION_HIGH_PRICE, MDEntryType.TRADING_SESSION_LOW_PRICE, MDEntryType.TRADING_SESSION_VWAP_PRICE, MDEntryType.TRADE_VOLUME); log.debug("sending message: {}", message.toXML(dict)); sendMessage(message, sessionId); }
/** * {@inheritDoc} */ @Override public void toAdmin(Message message, SessionID sessionId) { String msgType; try { msgType = message.getHeader().getString(MsgType.FIELD); } catch (FieldNotFound e) { throw new RuntimeException(e.getMessage(), e); } if (MsgType.LOGON.equals(msgType) || MsgType.HEARTBEAT.equals(msgType)) { message.setField(new Username(apiKey)); message.setField(new Password(secretKey)); } if (log.isTraceEnabled()) { log.trace("toAdmin: {}", message); log.trace("toAdmin: {}", message.toXML(dataDictionary)); } }