incubator-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ran...@apache.org
Subject cvs commit: incubator-ftpserver/src/java/org/apache/ftpserver/interfaces ConnectionManagerObserver.java ConnectionObserver.java FileObserver.java IConnection.java IConnectionManager.java IDataConnectionConfig.java IFtpConfig.java IFtpStatistics.java IIpRestrictor.java IMessageResource.java ISocketFactory.java ISsl.java StatisticsObserver.java
Date Wed, 07 Sep 2005 05:04:04 GMT
rana_b      2005/09/06 22:04:04

  Added:       src/java/org/apache/ftpserver/interfaces
                        ConnectionManagerObserver.java
                        ConnectionObserver.java FileObserver.java
                        IConnection.java IConnectionManager.java
                        IDataConnectionConfig.java IFtpConfig.java
                        IFtpStatistics.java IIpRestrictor.java
                        IMessageResource.java ISocketFactory.java ISsl.java
                        StatisticsObserver.java
  Log:
  Refactored - removed avalon entirely
  
  Revision  Changes    Path
  1.1                  incubator-ftpserver/src/java/org/apache/ftpserver/interfaces/ConnectionManagerObserver.java
  
  Index: ConnectionManagerObserver.java
  ===================================================================
  // $Id: ConnectionManagerObserver.java,v 1.1 2005/09/07 05:04:03 rana_b Exp $
  /*
   * Copyright 2004 The Apache Software Foundation
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.ftpserver.interfaces;
  
  
  /**
   * This observer interface monitors all the ftp connections.
   * 
   * @author <a href="mailto:rana_b@yahoo.com">Rana Bhattacharyya</a>
   */
  public 
  interface ConnectionManagerObserver {
      
      /**
       * New ftp connection.
       */
      void openedConnection(IConnection connection);
      
      /**
       * Closing ftp connection
       */
      void closedConnection(IConnection connection);
      
      /**
       * Connected user property change 
       */
      void updatedConnection(IConnection connection);
  }    
  
  
  
  1.1                  incubator-ftpserver/src/java/org/apache/ftpserver/interfaces/ConnectionObserver.java
  
  Index: ConnectionObserver.java
  ===================================================================
  // $Id: ConnectionObserver.java,v 1.1 2005/09/07 05:04:03 rana_b Exp $
  /*
   * Copyright 2004 The Apache Software Foundation
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.ftpserver.interfaces;
  
  
  /**
   * This interface is used to monitor connection request & replies.
   * 
   * @author <a href="mailto:rana_b@yahoo.com">Rana Bhattacharyya</a>
   */
  public 
  interface ConnectionObserver {
  
      /**
       * Write user request.
       */
      void request(String msg);
  
  
      /**
       * Write server response.
       */
      void response(String msg);
  
  }
  
  
  
  1.1                  incubator-ftpserver/src/java/org/apache/ftpserver/interfaces/FileObserver.java
  
  Index: FileObserver.java
  ===================================================================
  // $Id: FileObserver.java,v 1.1 2005/09/07 05:04:03 rana_b Exp $
  /*
   * Copyright 2004 The Apache Software Foundation
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.ftpserver.interfaces;
  
  import org.apache.ftpserver.ftplet.FileObject;
  
  /**
   * This is the file related activity observer.
   * 
   * @author <a href="mailto:rana_b@yahoo.com">Rana Bhattacharyya</a>
   */
  public 
  interface FileObserver {
  
      /**
       * User file upload notification.
       */
      void notifyUpload(IConnection connection, FileObject file, long size);
      
      /**
       * User file download notification.
       */
      void notifyDownload(IConnection connection, FileObject file, long size);
      
      /**
       * User file delete notification.
       */
      void notifyDelete(IConnection connection, FileObject file);
      
      /**
       * User make directory notification.
       */
      void notifyMkdir(IConnection connection, FileObject file);
      
      /**
       * User remove directory notification.
       */
      void notifyRmdir(IConnection connection, FileObject file);
      
  }
  
  
  
  1.1                  incubator-ftpserver/src/java/org/apache/ftpserver/interfaces/IConnection.java
  
  Index: IConnection.java
  ===================================================================
  // $Id: IConnection.java,v 1.1 2005/09/07 05:04:03 rana_b Exp $
  /*
   * Copyright 2004 The Apache Software Foundation
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.ftpserver.interfaces;
  
  import org.apache.ftpserver.ftplet.FtpRequest;
  
  /**
   * This is the connection request handler interface.
   * 
   * @author <a href="mailto:rana_b@yahoo.com">Rana Bhattacharyya</a>
   */
  public
  interface IConnection extends Runnable {
  
      /**
       * Get current request.
       */
      FtpRequest getRequest();
      
      /**
       * Close handler.
       */
      void close();
              
      /**
       * Set connection observer.
       */
      void setObserver(ConnectionObserver observer);
  }
   
  
  
  
  1.1                  incubator-ftpserver/src/java/org/apache/ftpserver/interfaces/IConnectionManager.java
  
  Index: IConnectionManager.java
  ===================================================================
  // $Id: IConnectionManager.java,v 1.1 2005/09/07 05:04:03 rana_b Exp $
  /*
   * Copyright 2004 The Apache Software Foundation
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.ftpserver.interfaces;
  
  import java.util.List;
  
  import org.apache.ftpserver.ftplet.Component;
  
  /**
   * It manages all the ftp connections.
   * 
   * @author <a href="mailto:rana_b@yahoo.com">Rana Bhattacharyya</a>
   */
  public
  interface IConnectionManager extends Component {
  
      /**
       * Get maximum number of connections.
       */
      int getMaxConnections();
       
      /**
       * Get maximum number of logins.
       */
      int getMaxLogins();
       
      
      /**
       * Is anonymous login enabled?
       */
      boolean isAnonymousLoginEnabled();
      
      
      /**
       * Get maximum anonymous logins
       */
      int getMaxAnonymousLogins();
  
      
      /**
       * Get all request handlers.
       */
      List getAllConnections();
      
      /**
       * Establish a new connection channel.
       */
      void newConnection(IConnection connection); 
      
      
      /**
       * Update connection.
       */
      void updateConnection(IConnection connection);
      
      
      /**
       * Close a connection.
       */
      void closeConnection(IConnection connection);
      
      
      /**
       * Close all connections.
       */
      void closeAllConnections();
      
      
      /**
       * Set connection manager observer.
       */
      void setObserver(ConnectionManagerObserver observer);
  } 
  
  
  
  1.1                  incubator-ftpserver/src/java/org/apache/ftpserver/interfaces/IDataConnectionConfig.java
  
  Index: IDataConnectionConfig.java
  ===================================================================
  // $Id: IDataConnectionConfig.java,v 1.1 2005/09/07 05:04:03 rana_b Exp $
  /*
   * Copyright 2004 The Apache Software Foundation
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.ftpserver.interfaces;
  
  import org.apache.ftpserver.ftplet.Component;
  
  import java.net.InetAddress;
  
  /**
   * Data connection configuration interface.
   * 
   * @author <a href="mailto:rana_b@yahoo.com">Rana Bhattacharyya</a>
   */
  public 
  interface IDataConnectionConfig extends Component {
  
      /**
       * Is PORT data connection enabled?
       */
      boolean isPortEnabled();
      
      /**
       * Check the PORT IP?
       */
      boolean isPortIpCheck();
      
      /**
       * Get passive address.
       */
      InetAddress getPassiveAddress();
      
      /**
       * Get passive port.
       */
      int getPassivePort();
      
      /**
       * Release passive port.
       */
      void releasePassivePort(int port);
      
      /**
       * Get SSL component.
       */
      ISsl getSSL();
  }
  
  
  
  1.1                  incubator-ftpserver/src/java/org/apache/ftpserver/interfaces/IFtpConfig.java
  
  Index: IFtpConfig.java
  ===================================================================
  // $Id: IFtpConfig.java,v 1.1 2005/09/07 05:04:03 rana_b Exp $
  /*
   * Copyright 2004 The Apache Software Foundation
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.ftpserver.interfaces;
  
  import org.apache.ftpserver.ftplet.FtpConfig;
  import org.apache.ftpserver.ftplet.Ftplet;
  
  /**
   * This is basically <code>org.apache.ftpserver.ftplet.FtpConfig</code> with
added
   * connection manager, message resource functionalities.
   * 
   * @author <a href="mailto:rana_b@yahoo.com">Rana Bhattacharyya</a>
   */
  public 
  interface IFtpConfig extends FtpConfig {
  
      /**
       * Get connection manager.
       */
      IConnectionManager getConnectionManager();
      
      /**
       * Get message resource.
       */
      IMessageResource getMessageResource();
      
      /**
       * Get IP restrictor.
       */
      IIpRestrictor getIpRestrictor();
      
      /**
       * Get ftplet container.
       */
      Ftplet getFtpletContainer();
      
      /**
       * Get server socket factory.
       */
      ISocketFactory getSocketFactory();
          
      /**
       * Get data connection config.
       */
      IDataConnectionConfig getDataConnectionConfig();
      
      /**
       * Release all components.
       */
      void dispose();
  }
  
  
  
  1.1                  incubator-ftpserver/src/java/org/apache/ftpserver/interfaces/IFtpStatistics.java
  
  Index: IFtpStatistics.java
  ===================================================================
  // $Id: IFtpStatistics.java,v 1.1 2005/09/07 05:04:03 rana_b Exp $
  /*
   * Copyright 2004 The Apache Software Foundation
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.ftpserver.interfaces;
  
  import org.apache.ftpserver.ftplet.Component;
  import org.apache.ftpserver.ftplet.FileObject;
  import org.apache.ftpserver.ftplet.FtpStatistics;
  
  /**
   * This is same as <code>org.apache.ftpserver.ftplet.FtpStatistics</code>
   * with added observer and setting values functionalities.
   * 
   * @author <a href="mailto:rana_b@yahoo.com">Rana Bhattacharyya</a>
   */
  public 
  interface IFtpStatistics extends FtpStatistics, Component {
  
      /**
       * Set statistics observer.
       */
      void setObserver(StatisticsObserver observer);
      
      /**
       * Set file observer.
       */
      void setFileObserver(FileObserver observer);
      
      /**
       * Increment upload count.
       */
      void setUpload(IConnection connection, FileObject file, long size);
      
      /**
       * Increment download count.
       */
      void setDownload(IConnection connection, FileObject file, long size);
      
      /**
       * Increment make directory count.
       */
      void setMkdir(IConnection connection, FileObject dir);
      
      /**
       * Decrement remove directory count.
       */
      void setRmdir(IConnection connection, FileObject dir) ;
      
      /**
       * Increment delete count.
       */
      void setDelete(IConnection connection, FileObject file);
      
      /**
       * Increment current connection count.
       */
      void setOpenConnection(IConnection connection);
      
      /**
       * Decrement close connection count.
       */
      void setCloseConnection(IConnection connection);
      
      /**
       * Increment current login count.
       */
      void setLogin(IConnection connection);
      
      /**
       * Decrement current login count.
       */
      void setLogout(IConnection connection);
  }
  
  
  
  1.1                  incubator-ftpserver/src/java/org/apache/ftpserver/interfaces/IIpRestrictor.java
  
  Index: IIpRestrictor.java
  ===================================================================
  // $Id: IIpRestrictor.java,v 1.1 2005/09/07 05:04:03 rana_b Exp $
  /*
   * Copyright 2004 The Apache Software Foundation
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.ftpserver.interfaces;
  
  import org.apache.ftpserver.ftplet.Component;
  import org.apache.ftpserver.ftplet.FtpException;
  
  import java.net.InetAddress;
  
  
  /**
   * Ip restrictor interface.
   * 
   * @author <a href="mailto:rana_b@yahoo.com">Rana Bhattacharyya</a>
   */
  public
  interface IIpRestrictor extends Component {
      
      /**
       * Check IP permission.
       */
      boolean hasPermission(InetAddress address) throws FtpException;
      
      
      /**
       * Get IP and permission {String, Boolean} array.
       */
      Object[][] getPermissions() throws FtpException;
      
      
      /**
       * Set IP and permission {String, Boolean} array.
       */
      void setPermissions(Object[][] permissions) throws FtpException;
  }
  
  
  
  1.1                  incubator-ftpserver/src/java/org/apache/ftpserver/interfaces/IMessageResource.java
  
  Index: IMessageResource.java
  ===================================================================
  // $Id: IMessageResource.java,v 1.1 2005/09/07 05:04:03 rana_b Exp $
  /*
   * Copyright 2004 The Apache Software Foundation
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.ftpserver.interfaces;
  
  import org.apache.ftpserver.ftplet.Component;
  import org.apache.ftpserver.ftplet.FtpException;
  
  import java.util.Properties;
  
  /**
   * This is message resource interface.
   * 
   * @author <a href="mailto:rana_b@yahoo.com">Rana Bhattacharyya</a>
   */
  public 
  interface IMessageResource extends Component {
  
      /**
       * Get all the available languages.
       */
      String[] getAvailableLanguages();
      
      /**
       * Get the message for the corresponding code and sub id.
       */
      String getMessage(int code, String subId, String language);
      
      
      /**
       * Save properties. This properties object contain all the
       * available messages. Old properties will not be overwritten.
       */
      void save(Properties prop, String language) throws FtpException;
      
      
      /**
       * Get all the messages.
       */
      Properties getMessages(String language);
      
  }
  
  
  
  1.1                  incubator-ftpserver/src/java/org/apache/ftpserver/interfaces/ISocketFactory.java
  
  Index: ISocketFactory.java
  ===================================================================
  // $Id: ISocketFactory.java,v 1.1 2005/09/07 05:04:03 rana_b Exp $
  /*
   * Copyright 2004 The Apache Software Foundation
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.ftpserver.interfaces;
  
  import org.apache.ftpserver.ftplet.Component;
  
  import java.net.InetAddress;
  import java.net.ServerSocket;
  
  
  /**
   * This interface is responsible to create appropriate server socket.
   *  
   * @author <a href="mailto:rana_b@yahoo.com">Rana Bhattacharyya</a>
   */
  public
  interface ISocketFactory extends Component {
      
      /**
       * Create the server socket. 
       */
      ServerSocket createServerSocket() throws Exception;
      
      /**
       * Get server address.
       */
      InetAddress getServerAddress();
      
      /**
       * Get server port.
       */
      int getPort();
      
      /**
       * Get SSL component.
       */
      ISsl getSSL();
  }
  
  
  
  1.1                  incubator-ftpserver/src/java/org/apache/ftpserver/interfaces/ISsl.java
  
  Index: ISsl.java
  ===================================================================
  // $Id: ISsl.java,v 1.1 2005/09/07 05:04:03 rana_b Exp $
  /*
   * Copyright 2004 The Apache Software Foundation
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.ftpserver.interfaces;
  
  import org.apache.ftpserver.ftplet.Component;
  
  import java.net.InetAddress;
  import java.net.ServerSocket;
  import java.net.Socket;
  
  /**
   * SSL interface.
   * 
   * @author <a href="mailto:rana_b@yahoo.com">Rana Bhattacharyya</a>
   */
  public 
  interface ISsl extends Component {
  
      /**
       * Create server socket.
       */
      ServerSocket createServerSocket(InetAddress addr, int port) throws Exception;
      
      /**
       * Create socket.
       */
      Socket createSocket(Socket soc, boolean clientMode) throws Exception;
      
  }
  
  
  
  1.1                  incubator-ftpserver/src/java/org/apache/ftpserver/interfaces/StatisticsObserver.java
  
  Index: StatisticsObserver.java
  ===================================================================
  // $Id: StatisticsObserver.java,v 1.1 2005/09/07 05:04:03 rana_b Exp $
  /*
   * Copyright 2004 The Apache Software Foundation
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.ftpserver.interfaces;
  
  /**
   * Ftp statistics observer interface.
   *
   * @author <a href="mailto:rana_b@yahoo.com">Rana Bhattacharyya</a>
   */
  public 
  interface StatisticsObserver {
      
      /**
       * User file upload notification.
       */
      void notifyUpload();
      
      /**
       * User file download notification.
       */
      void notifyDownload();
      
      /**
       * User file delete notification.
       */
      void notifyDelete();
       
      /**
       * User make directory notification.
       */
      void notifyMkdir();
      
      /**
       * User remove directory notification.
       */
      void notifyRmdir();
      
      /**
       * New user login notification.
       */
      void notifyLogin(boolean anonymous);
      
      /**
       * User logout notification.
       */
      void notifyLogout(boolean anonymous);
      
      /**
       * Connection open notification
       */
      void notifyOpenConnection(); 
      
      /**
       * Connection close notification
       */
      void notifyCloseConnection();
  }    
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@incubator.apache.org
For additional commands, e-mail: cvs-help@incubator.apache.org


Mime
View raw message