View Javadoc

1   /*
2    *  XNap - A P2P framework and client.
3    *
4    *  See the file AUTHORS for copyright information.
5    *
6    *  This program is free software; you can redistribute it and/or modify
7    *  it under the terms of the GNU General Public License as published by
8    *  the Free Software Foundation.
9    *
10   *  This program is distributed in the hope that it will be useful,
11   *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12   *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13   *  GNU General Public License for more details.
14   *
15   *  You should have received a copy of the GNU General Public License
16   *  along with this program; if not, write to the Free Software
17   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18   */
19  
20  package org.xnap.plugin.limewire;
21  
22  import org.xnap.util.AbstractPluginPreferences;
23  
24  /***
25   * Provides the LimeWire preferences. 
26   */
27  public class LimeWirePreferences extends AbstractPluginPreferences {
28  
29      //--- Constant(s) ---
30  
31      public static final int VERSION = 1;
32  
33      //--- Data field(s) ---
34  
35      //--- Constructor(s) ---
36  
37      public LimeWirePreferences()
38      {
39  		super("plugin.limewire", VERSION);
40  
41  		setDefault("allowBrowser", "true");
42  		setDefault("authenticatedConnectionsOnly", "false");
43  		setDefault("autoConnect", "true");
44  		setDefault("chatEnabled", "true");
45  		setDefault("connectionTableColumns", 
46  				   "host;status;msgCount;dropped;bandwidth;hosts;protocol;vendor;uptime");
47  		setDefault("disableUltraPeer", "false");
48  		setDefault("forcedIPAddressString", "0.0.0.0");
49  		setDefault("forcedPort", "6349");
50  		setDefault("forceIPAdress", "false");
51  		setDefault("port", "6349");
52      }
53  
54      //--- Method(s) ---
55  
56      public void convert(int oldVersion)
57      {
58  		// nothing to do yet
59      }
60  
61      public boolean getAuthenticatedConnectionsOnly() {
62  		return getBoolean("authenticatedConnectionsOnly");
63      }
64      
65      public void setAuthenticatedConnectionsOnly(boolean newValue) {
66  		set("authenticatedConnectionsOnly", newValue);
67      }
68  
69      public boolean getAutoConnect() {
70  		return getBoolean("autoConnect");
71      }
72      
73      public void setAutoConnect(boolean newValue) {
74  		set("autoConnect", newValue);
75      }
76  
77      public boolean getDisableUltraPeer() {
78  		return getBoolean("disableUltraPeer");
79      }
80      
81      public void setDisableUltraPeer(boolean newValue) {
82  		set("disableUltraPeer", newValue);
83      }
84  
85      public int getPort() {
86          return getInt("port");
87      }
88  
89      public void setPort(int newValue) {
90  		set("port", newValue);
91      }
92  
93  }