/*
 * @(#)FxpFailedEvent.java
 *
 * Copyright (c) 2005 JScape
 * 1147 S. 53rd Pl., Mesa, Arizona, 85206, U.S.A.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * JScape. ("Confidential Information").  You shall not disclose such
 * Confidential Information and shall use it only in accordance with
 * the terms of the license agreement you entered into with JScape.
 */
package com.jscape.inet.ftp;

import java.util.EventObject;

/**
 * Fired when a FXP transfer has failed to complete
 */
public class FxpFailedEvent
        extends EventObject {

    // the exception
    private Exception exception;

    // the source
    private Object src;

    // the destination
    private Object destination;

    // the filename
    private String filename;

    /**
     * Creates a new FxpFailedEvent instance
     *
     * @param src         the source Ftp or Ftps instance
     * @param destination the destination Ftp or Ftps instance
     * @param filename    the filename that failed transfer
     * @param ex          the exception
     */
    public FxpFailedEvent(Object src, Object destination, String filename, Exception ex) {
        super(src);
        this.src = src;
        this.destination = destination;
        this.filename = filename;
        this.exception = ex;
    }

    /**
     * Gets exception causing FXP failure.
     *
     * @return the exception
     */
    public Exception getException() {
        return exception;
    }

    /**
     * Gets source Ftp or Ftps instance causing FXP failure.
     *
     * @return a Ftp or Ftps instance
     *
     * @see com.jscape.inet.ftp.Ftp
     * @see com.jscape.inet.ftps.Ftps
     */
    public Object getSource() {
        return src;
    }

    /**
     * Gets destination Ftp or Ftps instance causing FXP failure.
     *
     * @return a Ftp or Ftps instance
     *
     * @see com.jscape.inet.ftp.Ftp
     * @see com.jscape.inet.ftps.Ftps
     */
    public Object getDestination() {
        return destination;
    }

    /**
     * Gets filename that caused FXP failure
     *
     * @return filename
     */
    public String getFilename() {
        return filename;
    }
}
