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.OTExchange;
022 import org.otfeed.protocol.ICommand;
023
024 /**
025 * Retrieves list of supported exchanges.
026 * <p/>
027 * This command allows to retrieve a complete list of
028 * exchanges supported by the server.
029 * <p/>
030 * Generates {@link OTExchange exchange} events.
031 * </p>
032 * Unless property description says otherwise, all properties
033 * are mandatory.
034 */
035 public final class ListExchangesCommand extends CompletionDelegateHolder implements ICommand {
036
037 /**
038 * Creates new list exchanges command, initializing all its
039 * properties.
040 *
041 * @param dataDelegate delegate.
042 */
043 public ListExchangesCommand(IDataDelegate<OTExchange> dataDelegate) {
044 setDataDelegate(dataDelegate);
045 }
046
047 /**
048 * Default constructor. {@link #getDataDelegate DataDelegate} property
049 * must be initiaized before this command object is used.
050 */
051 public ListExchangesCommand() { }
052
053 private IDataDelegate<OTExchange> dataDelegate;
054
055 /**
056 * Delegate to receive {@link OTExchange} events.
057 *
058 * @return delegate.
059 */
060 public IDataDelegate<OTExchange> getDataDelegate() {
061 return dataDelegate;
062 }
063
064 /**
065 * Sets delegate.
066 *
067 * @param dataDelegate delegate.
068 */
069 public void setDataDelegate(IDataDelegate<OTExchange> dataDelegate) {
070 this.dataDelegate = dataDelegate;
071 }
072 }