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.event.IDataDelegate;
021    import org.otfeed.event.OTEquityInit;
022    import org.otfeed.protocol.ICommand;
023    
024    /**
025     * Request for the detailed equity information.
026     * <p/>
027     * Generates {@link OTEquityInit equity init} event.
028     */
029    public final class EquityInitCommand 
030                    extends ExchangeAndSymbolHolder implements ICommand {
031            
032            /**
033             * Creates new equity init command, initializing all
034             * its properties.
035             * 
036             * @param exchangeCode exchange code.
037             * @param symbolCode symbol code.
038             * @param dataDelegate delegate.
039             */
040            public EquityInitCommand(String exchangeCode,
041                            String symbolCode,
042                            IDataDelegate<OTEquityInit> dataDelegate) {
043                    setExchangeCode(exchangeCode);
044                    setSymbolCode(symbolCode);
045                    setDataDelegate(dataDelegate);
046            }
047    
048            /**
049             * Default constructor. All properties must be initialized
050             * explicitly before using this command object.
051             */
052            public EquityInitCommand() {
053                    this(null, null, null);
054            }
055    
056            private IDataDelegate<OTEquityInit> dataDelegate;
057    
058            /**
059             * Delegate to receive {@link OTEquityInit} events.
060             * This parameter is mandatory.
061             * 
062             * @return delegate.
063             */
064            public IDataDelegate<OTEquityInit> getDataDelegate() {
065                    return dataDelegate;
066            }
067    
068            /**
069             * Sets delegate.
070             * 
071             * @param dataDelegate delegate.
072             */
073            public void setDataDelegate(IDataDelegate<OTEquityInit> dataDelegate) {
074                    this.dataDelegate = dataDelegate;
075            }
076    }