View Javadoc

1   /*
2    * Copyright 2001-2005 The Apache Software Foundation
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.apache.commons.net;
17  import java.util.EventListener;
18  
19  /***
20   * There exists a large class of IETF protocols that work by sending an
21   * ASCII text command and arguments to a server, and then receiving an
22   * ASCII text reply.  For debugging and other purposes, it is extremely
23   * useful to log or keep track of the contents of the protocol messages.
24   * The ProtocolCommandListener interface coupled with the
25   * {@link ProtocolCommandEvent} class facilitate this process.
26   * <p>
27   * To receive ProtocolCommandEvents, you merely implement the
28   * ProtocolCommandListener interface and register the class as a listener
29   * with a ProtocolCommandEvent source such as
30   * {@link org.apache.commons.net.ftp.FTPClient}.
31   * <p>
32   * <p>
33   * @see ProtocolCommandEvent
34   * @see ProtocolCommandSupport
35   * @author Daniel F. Savarese
36   ***/
37  
38  public interface ProtocolCommandListener extends EventListener
39  {
40  
41      /***
42       * This method is invoked by a ProtocolCommandEvent source after
43       * sending a protocol command to a server.
44       * <p>
45       * @param event The ProtocolCommandEvent fired.
46       ***/
47      public void protocolCommandSent(ProtocolCommandEvent event);
48  
49      /***
50       * This method is invoked by a ProtocolCommandEvent source after
51       * receiving a reply from a server.
52       * <p>
53       * @param event The ProtocolCommandEvent fired.
54       ***/
55      public void protocolReplyReceived(ProtocolCommandEvent event);
56  
57  }