001 /*
002 * This file is part of the Echo Point Project. This project is a
003 * collection of Components that have extended the Echo Web Application
004 * Framework Version 3.
005 *
006 * Version: MPL 1.1
007 *
008 * The contents of this file are subject to the Mozilla Public License Version
009 * 1.1 (the "License"); you may not use this file except in compliance with
010 * the License. You may obtain a copy of the License at
011 * http://www.mozilla.org/MPL/
012 *
013 * Software distributed under the License is distributed on an "AS IS" basis,
014 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
015 * for the specific language governing rights and limitations under the
016 * License.
017 */
018 package echopoint.tucana.event;
019
020 import java.io.Serializable;
021 import java.util.EventListener;
022
023 /**
024 * An interface that represents a call back handler that will be notified when
025 * an upload event completes or fails.
026
027 * <p><b>Note:</b> Development of this component was sponsored by <a
028 * href='http://tcnbroadcasting.com/index.jsp' target='_top'>TCN
029 * Broadcasting</a>. We are grateful for their support and sponsorship.</p>
030 *
031 * @author jvolkman (Echo2), Rakesh 2008-11-2
032 * @version $Id: UploadCallback.java 102 2008-11-17 20:10:05Z sptrakesh $
033 */
034 public interface UploadCallback extends EventListener, Serializable
035 {
036 /**
037 * Indicates a file upload has been started.
038 *
039 * @param event the event
040 */
041 void uploadStarted( final UploadStartEvent event );
042
043 /**
044 * Indicates a file upload has been canceled.
045 *
046 * @param event the event
047 */
048 void uploadCancelled( final UploadCancelEvent event );
049
050 /**
051 * Indicates that a file upload was rejected by the server since the client
052 * attempted to send restricted content.
053 *
054 * @param event The event that was generated.
055 */
056 void uploadDisallowed( final InvalidContentTypeEvent event );
057
058 /**
059 * Indicates a file upload has progressed.
060 *
061 * @param event the event
062 */
063 void uploadProgressed( final UploadProgressEvent event );
064
065 /**
066 * Call back method invoked once an upload event completes.
067 *
068 * @param event The event that has completed.
069 */
070 void uploadSucceeded( final UploadFinishEvent event );
071
072 /**
073 * Call back method when an upload event fails.
074 *
075 * @param event The event that has failed.
076 */
077 void uploadFailed( final UploadFailEvent event );
078
079 /**
080 * A convenience method to return the last event received by the
081 * callback handler. Can be used to gain access to the input stream
082 * (provided it has not been closed).
083 *
084 * @return The upload event that was last processed by the handler.
085 */
086 UploadEvent getEvent();
087 }