Package quickfix.Message

Examples of quickfix.Message.Header


            super(uri, TradeExecutorComponent.this);
            this.tradeExecutor = tradeExecutor;
            tradeExecutor.addListener(new QuickfixjMessageListener() {
                public void onMessage(SessionID sessionID, Message message) throws Exception {
                    // Inject session ID into message so produce will know where to send it
                    Header header = message.getHeader();
                    setOptionalField(header, sessionID, SenderCompID.FIELD, sessionID.getTargetCompID());
                    setOptionalField(header, sessionID, SenderSubID.FIELD, sessionID.getTargetSubID());
                    setOptionalField(header, sessionID, SenderLocationID.FIELD, sessionID.getTargetLocationID());
                    setOptionalField(header, sessionID, TargetCompID.FIELD, sessionID.getSenderCompID());
                    setOptionalField(header, sessionID, TargetSubID.FIELD, sessionID.getSenderSubID());
                    setOptionalField(header, sessionID, TargetLocationID.FIELD, sessionID.getSenderLocationID());
                   
                    Exchange exchange = QuickfixjConverters.toExchange(
                        TradeExecutorEndpoint.this, sessionID, message,
                        QuickfixjEventCategory.AppMessageReceived);
                   
                    for (Processor processor : processors) {
                        processor.process(exchange);
                    }
                }

                private void setOptionalField(Header header, SessionID sessionID, int tag, String value) {
                    if (value != null && value.length() > 0) {
                        header.setString(tag, value);
                    }
                }
            });
        }
View Full Code Here


        }
        return null;
    }

    private SessionID getDestinationSessionID(Message message) {
        Header header = message.getHeader();
        String fixVersion = getField(header, BeginString.FIELD);
        String destinationCompId = getField(header, DeliverToCompID.FIELD);
        if (destinationCompId != null) {
            String destinationSubId = getField(header, DeliverToSubID.FIELD);
            String destinationLocationId = getField(header, DeliverToLocationID.FIELD);
           
            header.removeField(DeliverToCompID.FIELD);
            header.removeField(DeliverToSubID.FIELD);
            header.removeField(DeliverToLocationID.FIELD);
           
            String gatewayCompId = getField(header, TargetCompID.FIELD);
            String gatewaySubId = getField(header, TargetSubID.FIELD);
            String gatewayLocationId = getField(header, TargetLocationID.FIELD);
           
            header.setString(OnBehalfOfCompID.FIELD, getField(header, SenderCompID.FIELD));
            if (header.isSetField(SenderSubID.FIELD)) {
                header.setString(OnBehalfOfSubID.FIELD, getField(header, SenderSubID.FIELD));
            }
            if (header.isSetField(SenderLocationID.FIELD)) {
                header.setString(OnBehalfOfLocationID.FIELD, getField(header, SenderLocationID.FIELD));
            }
           
            return new SessionID(fixVersion, gatewayCompId, gatewaySubId, gatewayLocationId,
                destinationCompId, destinationSubId, destinationLocationId, null);
        }
View Full Code Here

        }
        return null;
    }

    private SessionID getDestinationSessionID(Message message) {
        Header header = message.getHeader();
        String fixVersion = getField(header, BeginString.FIELD);
        String destinationCompId = getField(header, DeliverToCompID.FIELD);
        if (destinationCompId != null) {
            String destinationSubId = getField(header, DeliverToSubID.FIELD);
            String destinationLocationId = getField(header, DeliverToLocationID.FIELD);
           
            header.removeField(DeliverToCompID.FIELD);
            header.removeField(DeliverToSubID.FIELD);
            header.removeField(DeliverToLocationID.FIELD);
           
            String gatewayCompId = getField(header, TargetCompID.FIELD);
            String gatewaySubId = getField(header, TargetSubID.FIELD);
            String gatewayLocationId = getField(header, TargetLocationID.FIELD);
           
            header.setString(OnBehalfOfCompID.FIELD, getField(header, SenderCompID.FIELD));
            if (header.isSetField(SenderSubID.FIELD)) {
                header.setString(OnBehalfOfSubID.FIELD, getField(header, SenderSubID.FIELD));
            }
            if (header.isSetField(SenderLocationID.FIELD)) {
                header.setString(OnBehalfOfLocationID.FIELD, getField(header, SenderLocationID.FIELD));
            }
           
            return new SessionID(fixVersion, gatewayCompId, gatewaySubId, gatewayLocationId,
                destinationCompId, destinationSubId, destinationLocationId, null);
        }
View Full Code Here

            super(uri, TradeExecutorComponent.this);
            this.tradeExecutor = tradeExecutor;
            tradeExecutor.addListener(new QuickfixjMessageListener() {
                public void onMessage(SessionID sessionID, Message message) throws Exception {
                    // Inject session ID into message so produce will know where to send it
                    Header header = message.getHeader();
                    setOptionalField(header, sessionID, SenderCompID.FIELD, sessionID.getTargetCompID());
                    setOptionalField(header, sessionID, SenderSubID.FIELD, sessionID.getTargetSubID());
                    setOptionalField(header, sessionID, SenderLocationID.FIELD, sessionID.getTargetLocationID());
                    setOptionalField(header, sessionID, TargetCompID.FIELD, sessionID.getSenderCompID());
                    setOptionalField(header, sessionID, TargetSubID.FIELD, sessionID.getSenderSubID());
                    setOptionalField(header, sessionID, TargetLocationID.FIELD, sessionID.getSenderLocationID());
                   
                    Exchange exchange = QuickfixjConverters.toExchange(
                        TradeExecutorEndpoint.this, sessionID, message,
                        QuickfixjEventCategory.AppMessageReceived);
                   
                    for (Processor processor : processors) {
                        processor.process(exchange);
                    }
                }

                private void setOptionalField(Header header, SessionID sessionID, int tag, String value) {
                    if (!ObjectHelper.isEmpty(value)) {
                        header.setString(tag, value);
                    }
                }
            });
        }
View Full Code Here

            super(uri, TradeExecutorComponent.this.getCamelContext());
            this.tradeExecutor = tradeExecutor;
            tradeExecutor.addListener(new QuickfixjMessageListener() {
                public void onMessage(SessionID sessionID, Message message) throws Exception {
                    // Inject session ID into message so produce will know where to send it
                    Header header = message.getHeader();
                    setOptionalField(header, sessionID, SenderCompID.FIELD, sessionID.getTargetCompID());
                    setOptionalField(header, sessionID, SenderSubID.FIELD, sessionID.getTargetSubID());
                    setOptionalField(header, sessionID, SenderLocationID.FIELD, sessionID.getTargetLocationID());
                    setOptionalField(header, sessionID, TargetCompID.FIELD, sessionID.getSenderCompID());
                    setOptionalField(header, sessionID, TargetSubID.FIELD, sessionID.getSenderSubID());
                    setOptionalField(header, sessionID, TargetLocationID.FIELD, sessionID.getSenderLocationID());
                   
                    Exchange exchange = QuickfixjConverters.toExchange(
                        TradeExecutorEndpoint.this, sessionID, message,
                        QuickfixjEventCategory.AppMessageReceived);
                   
                    for (Processor processor : processors) {
                        processor.process(exchange);
                    }
                }

                private void setOptionalField(Header header, SessionID sessionID, int tag, String value) {
                    if (value != null && value.length() > 0) {
                        header.setString(tag, value);
                    }
                }
            });
        }
View Full Code Here

        }
        return null;
    }

    private SessionID getDestinationSessionID(Message message) {
        Header header = message.getHeader();
        String fixVersion = getField(header, BeginString.FIELD);
        String destinationCompId = getField(header, DeliverToCompID.FIELD);
        if (destinationCompId != null) {
            String destinationSubId = getField(header, DeliverToSubID.FIELD);
            String destinationLocationId = getField(header, DeliverToLocationID.FIELD);
           
            header.removeField(DeliverToCompID.FIELD);
            header.removeField(DeliverToSubID.FIELD);
            header.removeField(DeliverToLocationID.FIELD);
           
            String gatewayCompId = getField(header, TargetCompID.FIELD);
            String gatewaySubId = getField(header, TargetSubID.FIELD);
            String gatewayLocationId = getField(header, TargetLocationID.FIELD);
           
            header.setString(OnBehalfOfCompID.FIELD, getField(header, SenderCompID.FIELD));
            if (header.isSetField(SenderSubID.FIELD)) {
                header.setString(OnBehalfOfSubID.FIELD, getField(header, SenderSubID.FIELD));
            }
            if (header.isSetField(SenderLocationID.FIELD)) {
                header.setString(OnBehalfOfLocationID.FIELD, getField(header, SenderLocationID.FIELD));
            }
           
            return new SessionID(fixVersion, gatewayCompId, gatewaySubId, gatewayLocationId,
                destinationCompId, destinationSubId, destinationLocationId, null);
        }
View Full Code Here

            super(uri, TradeExecutorComponent.this);
            this.tradeExecutor = tradeExecutor;
            tradeExecutor.addListener(new QuickfixjMessageListener() {
                public void onMessage(SessionID sessionID, Message message) throws Exception {
                    // Inject session ID into message so produce will know where to send it
                    Header header = message.getHeader();
                    setOptionalField(header, sessionID, SenderCompID.FIELD, sessionID.getTargetCompID());
                    setOptionalField(header, sessionID, SenderSubID.FIELD, sessionID.getTargetSubID());
                    setOptionalField(header, sessionID, SenderLocationID.FIELD, sessionID.getTargetLocationID());
                    setOptionalField(header, sessionID, TargetCompID.FIELD, sessionID.getSenderCompID());
                    setOptionalField(header, sessionID, TargetSubID.FIELD, sessionID.getSenderSubID());
                    setOptionalField(header, sessionID, TargetLocationID.FIELD, sessionID.getSenderLocationID());
                   
                    Exchange exchange = QuickfixjConverters.toExchange(
                        TradeExecutorEndpoint.this, sessionID, message,
                        QuickfixjEventCategory.AppMessageReceived);
                   
                    for (Processor processor : processors) {
                        processor.process(exchange);
                    }
                }

                private void setOptionalField(Header header, SessionID sessionID, int tag, String value) {
                    if (value != null && value.length() > 0) {
                        header.setString(tag, value);
                    }
                }
            });
        }
View Full Code Here

            this.tradeExecutor = tradeExecutor;
            tradeExecutor.addListener(new QuickfixjMessageListener() {
                @Override
                public void onMessage(SessionID sessionID, Message message) throws Exception {
                    // Inject session ID into message so producer will know where to send it
                    Header header = message.getHeader();
                    setOptionalField(header, sessionID, SenderCompID.FIELD, sessionID.getTargetCompID());
                    setOptionalField(header, sessionID, SenderSubID.FIELD, sessionID.getTargetSubID());
                    setOptionalField(header, sessionID, SenderLocationID.FIELD, sessionID.getTargetLocationID());
                    setOptionalField(header, sessionID, TargetCompID.FIELD, sessionID.getSenderCompID());
                    setOptionalField(header, sessionID, TargetSubID.FIELD, sessionID.getSenderSubID());
                    setOptionalField(header, sessionID, TargetLocationID.FIELD, sessionID.getSenderLocationID());
                   
                    Exchange exchange = QuickfixjConverters.toExchange(
                        TradeExecutorEndpoint.this, sessionID, message,
                        QuickfixjEventCategory.AppMessageReceived);
                   
                    for (Processor processor : processors) {
                        processor.process(exchange);
                    }
                }

                private void setOptionalField(Header header, SessionID sessionID, int tag, String value) {
                    if (!ObjectHelper.isEmpty(value)) {
                        header.setString(tag, value);
                    }
                }
            });
        }
View Full Code Here

TOP

Related Classes of quickfix.Message.Header

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.