001 package org.otfeed.event;
002
003 /**
004 * Defines contract for the listeners that want to receive
005 * end-of-stream notification. After such a notification
006 * is recevied, no more stream data can arrive.
007 */
008 public interface ICompletionDelegate {
009
010 /**
011 * Handles end-of-stream event.
012 * <p/>
013 * If data stream is ended with error (because server
014 * returned an error, or driver encountered an error condition),
015 * <code>error</code> parameter will be not null. On normal stream
016 * completion, <code>error</code> parameter is null.
017 *
018 * <p/>
019 * It is guarnteed, that this method will be called before
020 * request completes.
021 *
022 * @param error error code, if stream completion was abnormal.
023 * Null otherwise.
024 */
025 public void onDataEnd(OTError error);
026 }