Package org.apache.ftpserver.interfaces

Examples of org.apache.ftpserver.interfaces.StatisticsObserver


    // /////////////// all observer methods ////////////////////
    /**
     * Observer upload notification.
     */
    private void notifyUpload(final FtpIoSession session, final FileObject file, long size) {
        StatisticsObserver observer = this.observer;
        if (observer != null) {
            observer.notifyUpload();
        }

        FileObserver fileObserver = this.fileObserver;
        if (fileObserver != null) {
            fileObserver.notifyUpload(session, file, size);
View Full Code Here


    /**
     * Observer download notification.
     */
    private void notifyDownload(final FtpIoSession session, final FileObject file, final long size) {
        StatisticsObserver observer = this.observer;
        if (observer != null) {
            observer.notifyDownload();
        }

        FileObserver fileObserver = this.fileObserver;
        if (fileObserver != null) {
            fileObserver.notifyDownload(session, file, size);
View Full Code Here

    /**
     * Observer delete notification.
     */
    private void notifyDelete(final FtpIoSession session, final FileObject file) {
        StatisticsObserver observer = this.observer;
        if (observer != null) {
            observer.notifyDelete();
        }

        FileObserver fileObserver = this.fileObserver;
        if (fileObserver != null) {
            fileObserver.notifyDelete(session, file);
View Full Code Here

    /**
     * Observer make directory notification.
     */
    private void notifyMkdir(final FtpIoSession session, final FileObject file) {
        StatisticsObserver observer = this.observer;
        if (observer != null) {
            observer.notifyMkdir();
        }

        FileObserver fileObserver = this.fileObserver;
        if (fileObserver != null) {
            fileObserver.notifyMkdir(session, file);
View Full Code Here

    /**
     * Observer remove directory notification.
     */
    private void notifyRmdir(final FtpIoSession session, final FileObject file) {
        StatisticsObserver observer = this.observer;
        if (observer != null) {
            observer.notifyRmdir();
        }

        FileObserver fileObserver = this.fileObserver;
        if (fileObserver != null) {
            fileObserver.notifyRmdir(session, file);
View Full Code Here

    /**
     * Observer open connection notification.
     */
    private void notifyOpenConnection(final FtpIoSession session) {
        StatisticsObserver observer = this.observer;
        if (observer != null) {
            observer.notifyOpenConnection();
        }
    }
View Full Code Here

    /**
     * Observer close connection notification.
     */
    private void notifyCloseConnection(final FtpIoSession session) {
        StatisticsObserver observer = this.observer;
        if (observer != null) {
            observer.notifyCloseConnection();
        }
    }
View Full Code Here

    /**
     * Observer login notification.
     */
    private void notifyLogin(final FtpIoSession session) {
        StatisticsObserver observer = this.observer;
        if (observer != null) {

            // is anonymous login
            User user = session.getUser();
            boolean anonymous = false;
            if (user != null) {
                String login = user.getName();
                anonymous = (login != null) && login.equals("anonymous");
            }
            observer.notifyLogin(anonymous);
        }
    }
View Full Code Here

    /**
     * Observer failed login notification.
     */
    private void notifyLoginFail(final FtpIoSession session) {
        StatisticsObserver observer = this.observer;
        if (observer != null) {
            if (session.getRemoteAddress() instanceof InetSocketAddress) {
                observer.notifyLoginFail(((InetSocketAddress) session.getRemoteAddress()).getAddress());

            }
        }
    }
View Full Code Here

    /**
     * Observer logout notification.
     */
    private void notifyLogout(final FtpIoSession session) {
        StatisticsObserver observer = this.observer;
        if (observer != null) {
            // is anonymous login
            User user = session.getUser();
            boolean anonymous = false;
            if (user != null) {
                String login = user.getName();
                anonymous = (login != null) && login.equals("anonymous");
            }
            observer.notifyLogout(anonymous);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.ftpserver.interfaces.StatisticsObserver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.