package org.marketcetera.event.impl; import javax.annotation.concurrent.ThreadSafe; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import org.marketcetera.event.AskEvent; import org.marketcetera.event.FutureEvent; import org.marketcetera.event.beans.FutureBean; import org.marketcetera.event.beans.QuoteBean; import org.marketcetera.trade.*; import org.marketcetera.util.misc.ClassVersion; /* $License$ */ /** * Provides a Futures implementation of {@link AskEvent}. * * @author <a href="mailto:colin@marketcetera.com">Colin DuPlantis</a> * @version $Id: FutureAskEventImpl.java 16878 2014-04-14 22:55:48Z colin $ * @since 2.1.0 */ @ThreadSafe @XmlRootElement(name="futureAsk") @XmlAccessorType(XmlAccessType.NONE) @ClassVersion("$Id: FutureAskEventImpl.java 16878 2014-04-14 22:55:48Z colin $") public class FutureAskEventImpl extends AbstractQuoteEventImpl implements AskEvent, FutureEvent { /* (non-Javadoc) * @see org.marketcetera.event.FutureEvent#getDeliveryType() */ @Override public DeliveryType getDeliveryType() { return future.getDeliveryType(); } /* (non-Javadoc) * @see org.marketcetera.event.FutureEvent#getProviderSymbol() */ @Override public String getProviderSymbol() { return future.getProviderSymbol(); } /* (non-Javadoc) * @see org.marketcetera.event.FutureEvent#getStandardType() */ @Override public StandardType getStandardType() { return future.getStandardType(); } /* (non-Javadoc) * @see org.marketcetera.event.FutureEvent#getType() */ @Override public FutureType getType() { return future.getType(); } /* (non-Javadoc) * @see org.marketcetera.event.FutureEvent#getUnderylingAssetType() */ @Override public FutureUnderlyingAssetType getUnderylingAssetType() { return future.getUnderlyingAssetType(); } /* (non-Javadoc) * @see org.marketcetera.event.HasEquity#getInstrument() */ @Override public Future getInstrument() { return (Future)super.getInstrument(); } /* (non-Javadoc) * @see org.marketcetera.event.FutureEvent#getContractSize() */ @Override public int getContractSize() { return future.getContractSize(); } /** * Create a new FutureAskEventImpl instance. * * @param inQuote a <code>QuoteBean</code> value * @throws IllegalArgumentException if <code>MessageId</code> < 0 * @throws IllegalArgumentException if <code>Timestamp</code> is <code>null</code> * @throws IllegalArgumentException if <code>Instrument</code> is <code>null</code> * @throws IllegalArgumentException if <code>Price</code> is <code>null</code> * @throws IllegalArgumentException if <code>Size</code> is <code>null</code> * @throws IllegalArgumentException if <code>Exchange</code> is <code>null</code> or empty * @throws IllegalArgumentException if <code>ExchangeTimestamp</code> is <code>null</code> or empty * @throws IllegalArgumentException if <code>Action</code> is <code>null</code> */ FutureAskEventImpl(QuoteBean inQuote, FutureBean inFuture) { super(inQuote); future = FutureBean.copy(inFuture); future.validate(); } /* (non-Javadoc) * @see org.marketcetera.event.impl.AbstractQuoteEventImpl#getDescription() */ @Override protected String getDescription() { return description; } /** * Create a new FutureAskEventImpl instance. * * <p>This constructor is intended to be used by JAXB. */ @SuppressWarnings("unused") private FutureAskEventImpl() { future = new FutureBean(); } /** * provides a human-readable description of this event type (does not need to be localized) */ private static final String description = "Future Ask"; //$NON-NLS-1$ /** * the future attributes */ @XmlElement private final FutureBean future; private static final long serialVersionUID = 1L; }