Add configuration data container.
[xudocci.git] / src / main / java / net / pterodactylus / xdcc / main / Configuration.java
1 /*
2  * XdccDownloader - Configuration.java - Copyright © 2013 David Roden
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  */
17
18 package net.pterodactylus.xdcc.main;
19
20 import java.util.Set;
21
22 import org.codehaus.jackson.annotate.JsonProperty;
23
24 /**
25  * Container for configuration data.
26  *
27  * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
28  */
29 public class Configuration {
30
31         public static class Network {
32
33                 public static class Server {
34
35                         @JsonProperty
36                         private String hostname;
37
38                         @JsonProperty
39                         private Set<Integer> unencryptedPorts;
40
41                         @JsonProperty
42                         private Set<Integer> encryptedPorts;
43
44                         public String getHostname() {
45                                 return hostname;
46                         }
47
48                         public Set<Integer> getUnencryptedPorts() {
49                                 return unencryptedPorts;
50                         }
51
52                         public Set<Integer> getEncryptedPorts() {
53                                 return encryptedPorts;
54                         }
55
56                 }
57
58                 @JsonProperty
59                 private String name;
60
61                 @JsonProperty
62                 private Set<Server> servers;
63
64                 @JsonProperty
65                 private Set<String> channels;
66
67                 public String getName() {
68                         return name;
69                 }
70
71                 public Set<Server> getServers() {
72                         return servers;
73                 }
74
75                 public Set<String> getChannels() {
76                         return channels;
77                 }
78
79         }
80
81         @JsonProperty
82         private Set<Network> networks;
83
84         @JsonProperty
85         private String temporaryDirectory;
86
87         @JsonProperty
88         private String finalDirectory;
89
90         @JsonProperty
91         private int telnetPort;
92
93         public Set<Network> getNetworks() {
94                 return networks;
95         }
96
97         public String getTemporaryDirectory() {
98                 return temporaryDirectory;
99         }
100
101         public String getFinalDirectory() {
102                 return finalDirectory;
103         }
104
105         public int getTelnetPort() {
106                 return telnetPort;
107         }
108
109 }