KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > inversoft > verge > util > url > config > CategoryConfig


1 /*
2  * Copyright (c) 2003, Inversoft
3  *
4  * This software is distribuable under the GNU Lesser General Public License.
5  * For more information visit gnu.org.
6  */

7 package com.inversoft.verge.util.url.config;
8
9
10 /**
11  * <p>
12  * This class stores the configuration for a URL category.
13  * </p>
14  *
15  * @author Brian Pontarelli
16  * @since 2.0
17  * @version 2.0
18  */

19 public class CategoryConfig {
20
21     private String JavaDoc name;
22     private String JavaDoc protocol;
23     private String JavaDoc host;
24     private int port;
25     private String JavaDoc context;
26     boolean https;
27
28
29     /**
30      * Constructor for CategoryConfig.
31      */

32     public CategoryConfig(String JavaDoc name, String JavaDoc protocol, String JavaDoc host, int port,
33             String JavaDoc context) {
34         this.name = name;
35         this.protocol = protocol;
36         this.host = host;
37         this.port = port;
38         this.context = context;
39         
40         if (protocol != null && protocol.equals("https")) {
41             https = true;
42         }
43     }
44
45     /**
46      * Retrieves the name property
47      *
48      * @return The name property
49      */

50     public String JavaDoc getName() {
51         return name;
52     }
53
54     /**
55      * Populates the name property
56      *
57      * @param name The name property
58      */

59     public void setName(String JavaDoc name) {
60         this.name = name;
61     }
62
63     /**
64      * Retrieves the protocol property
65      *
66      * @return The protocol property
67      */

68     public String JavaDoc getProtocol() {
69         return protocol;
70     }
71
72     /**
73      * Populates the protocol property
74      *
75      * @param protocol The protocol property
76      */

77     public void setProtocol(String JavaDoc protocol) {
78         this.protocol = protocol;
79     }
80
81     /**
82      * Returns whether or not this category is https or not
83      *
84      * @return True if protocol equals https, false otherwise
85      */

86     public boolean isHttps() {
87         return https;
88     }
89
90     /**
91      * Retrieves the host property
92      *
93      * @return The host property
94      */

95     public String JavaDoc getHost() {
96         return host;
97     }
98
99     /**
100      * Populates the host property
101      *
102      * @param host The host property
103      */

104     public void setHost(String JavaDoc host) {
105         this.host = host;
106     }
107
108     /**
109      * Retrieves the the port property
110      *
111      * @return The the port property
112      */

113     public int getPort() {
114         return port;
115     }
116
117     /**
118      * Populates the the port property
119      *
120      * @param port The the port property
121      */

122     public void setPort(int port) {
123         this.port = port;
124     }
125
126     /**
127      * Retrieves the context property
128      *
129      * @return The context property
130      */

131     public String JavaDoc getContext() {
132         return context;
133     }
134
135     /**
136      * Populates the context property
137      *
138      * @param context The context property
139      */

140     public void setContext(String JavaDoc context) {
141         this.context = context;
142     }
143 }
Popular Tags