/*
 * @(#)SftpEvent.java
 *
 * Copyright (c) 2001-2004 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.sftp.events;

import com.jscape.inet.sftp.Sftp;

import static com.jscape.util.Parameters.assertNotNull;

/**
 * The  abstract event class for handling SSH related events.
 */
public abstract class SftpEvent {

    protected final Sftp source;

    /**
     * Creates a new event instance.
     *
     * @param source the source of the event
     */
    protected SftpEvent(Sftp source) {
        assertNotNull(source);
        this.source = source;
    }

    /**
     * Obtains the event source.
     *
     * @return the event source
     */
    public Sftp getSource() {
        return this.source;
    }

    /**
     * The "backwards dispatching" support.
     *
     * @param listener the event listener
     */
    public abstract void accept(SftpListener listener);

}
