View Javadoc

1   /*
2    * ------------------------------------------------------------------------------
3    * Hermes FTP Server
4    * Copyright (c) 2005-2007 Lars Behnke
5    * ------------------------------------------------------------------------------
6    * 
7    * This file is part of Hermes FTP Server.
8    * 
9    * Hermes FTP Server is free software; you can redistribute it and/or modify
10   * it under the terms of the GNU General Public License as published by
11   * the Free Software Foundation; either version 2 of the License, or
12   * (at your option) any later version.
13   * 
14   * Hermes FTP Server is distributed in the hope that it will be useful,
15   * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17   * GNU General Public License for more details.
18   * 
19   * You should have received a copy of the GNU General Public License
20   * along with Hermes FTP Server; if not, write to the Free Software
21   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22   * ------------------------------------------------------------------------------
23   */
24  
25  package net.sf.hermesftp.cmd;
26  
27  /***
28   * Wraps the connection parameter of the data channel into a single object.
29   * 
30   * @author Behnke
31   */
32  public class DataChannelInfo {
33  
34      private String address;
35  
36      private int    port;
37  
38      private int    protocolIdx;
39  
40      /***
41       * Constructor.
42       * 
43       * @param addr The IP address.
44       * @param port The port.
45       */
46      public DataChannelInfo(String addr, int port) {
47          this(addr, port, 1);
48      }
49  
50      /***
51       * Constructor.
52       * 
53       * @param addr The IP address.
54       * @param port The port.
55       * @param protocolIdx The protocol index (IPv4, IPv6)
56       */
57      public DataChannelInfo(String addr, int port, int protocolIdx) {
58          super();
59          this.address = addr;
60          this.port = port;
61          this.protocolIdx = protocolIdx;
62      }
63  
64      /***
65       * Getter method for <code>protocolIdx</code>.
66       * 
67       * @return The property <code>protocolIdx</code>.
68       */
69      public int getProtocolIdx() {
70          return protocolIdx;
71      }
72  
73      /***
74       * Setter method for <code>protocolIdx</code>.
75       * 
76       * @param protocolIdx the protocolIdx to set
77       */
78      public void setProtocolIdx(int protocolIdx) {
79          this.protocolIdx = protocolIdx;
80      }
81  
82      /***
83       * Getter method for <code>address</code>.
84       * 
85       * @return The property <code>address</code>.
86       */
87      public String getAddress() {
88          return address;
89      }
90  
91      /***
92       * Setter method for <code>address</code>.
93       * 
94       * @param address the address to set
95       */
96      public void setAddress(String address) {
97          this.address = address;
98      }
99  
100     /***
101      * Getter method for <code>port</code>.
102      * 
103      * @return The property <code>port</code>.
104      */
105     public int getPort() {
106         return port;
107     }
108 
109     /***
110      * Setter method for <code>port</code>.
111      * 
112      * @param port the port to set
113      */
114     public void setPort(int port) {
115         this.port = port;
116     }
117 
118 }