001 /* 002 * Copyright 2001-2005 The Apache Software Foundation 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 package org.apache.commons.net; 017 import java.util.EventListener; 018 019 /*** 020 * There exists a large class of IETF protocols that work by sending an 021 * ASCII text command and arguments to a server, and then receiving an 022 * ASCII text reply. For debugging and other purposes, it is extremely 023 * useful to log or keep track of the contents of the protocol messages. 024 * The ProtocolCommandListener interface coupled with the 025 * {@link ProtocolCommandEvent} class facilitate this process. 026 * <p> 027 * To receive ProtocolCommandEvents, you merely implement the 028 * ProtocolCommandListener interface and register the class as a listener 029 * with a ProtocolCommandEvent source such as 030 * {@link org.apache.commons.net.ftp.FTPClient}. 031 * <p> 032 * <p> 033 * @see ProtocolCommandEvent 034 * @see ProtocolCommandSupport 035 * @author Daniel F. Savarese 036 ***/ 037 038 public interface ProtocolCommandListener extends EventListener 039 { 040 041 /*** 042 * This method is invoked by a ProtocolCommandEvent source after 043 * sending a protocol command to a server. 044 * <p> 045 * @param event The ProtocolCommandEvent fired. 046 ***/ 047 public void protocolCommandSent(ProtocolCommandEvent event); 048 049 /*** 050 * This method is invoked by a ProtocolCommandEvent source after 051 * receiving a reply from a server. 052 * <p> 053 * @param event The ProtocolCommandEvent fired. 054 ***/ 055 public void protocolReplyReceived(ProtocolCommandEvent event); 056 057 }