001    /**
002     * Copyright 2007 Mike Kroutikov.
003     *
004     * This program is free software; you can redistribute it and/or modify
005     *   it under the terms of the Lesser GNU General Public License as 
006     *   published by the Free Software Foundation; either version 3 of
007     *   the License, or (at your option) any later version.
008     *
009     *   This program is distributed in the hope that it will be useful,
010     *   but WITHOUT ANY WARRANTY; without even the implied warranty of
011     *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
012     *   Lesser GNU General Public License for more details.
013     *
014     *   You should have received a copy of the Lesser GNU General Public License
015     *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
016     */
017    
018    package org.otfeed.command;
019    
020    import org.otfeed.protocol.ICommand;
021    
022    /**
023     * Request for the real-time (live) quotes.
024     * <p/>
025     * Generates {@link org.otfeed.event.OTQuote quote}, 
026     * {@link org.otfeed.event.OTTrade trade},
027     * {@link org.otfeed.event.OTMMQuote marker-maker quote}, and 
028     * {@link org.otfeed.event.OTBBO bbo} events.
029     */
030    public final class TickStreamCommand 
031                    extends ExchangeSymbolAndQuoteDelegateHolder implements ICommand {
032    
033            /**
034             * Creates new tick stream command, initializing 
035             * all its properties, except delegates.
036             * 
037             * @param exchangeCode exchange code.
038             * @param symbolCode symbol code.
039             * @param volumeStyle volume reporting style.
040             */
041            public TickStreamCommand(String exchangeCode,
042                            String symbolCode,
043                            VolumeStyleEnum volumeStyle) {
044                    setExchangeCode(exchangeCode);
045                    setSymbolCode(symbolCode);
046                    setVolumeStyle(volumeStyle);
047            }
048    
049            /**
050             * Default construtor. Initializes
051             * {@link #getVolumeStyle volumeStyle} property to its default
052             * value of {@link VolumeStyleEnum#COMPOUND COMPOUND}.
053             * Other properties must be set explicitly before using 
054             * this object. 
055             */
056            public TickStreamCommand() {
057                    this(null, null, VolumeStyleEnum.COMPOUND);
058            }
059    
060            /**
061             * Creates new tick stream command for a single event type, initializing 
062             * all its properties, except <code>individualFlag</code>,
063             * which is set to <code>COMPOUND</code>, and delegates.
064             * 
065             * @param exchangeCode exchange code.
066             * @param symbolCode symbol code.
067             */
068            public TickStreamCommand(String exchangeCode,
069                            String symbolCode) {
070                    this(exchangeCode, 
071                                    symbolCode,
072                                    VolumeStyleEnum.COMPOUND);
073            }
074    }