001: /* Copyright (c) 2001 - 2007 TOPP - www.openplans.org. All rights reserved.
002: * This code is licensed under the GPL 2.0 license, availible at the root
003: * application directory.
004: */
005: package org.geoserver.ows;
006:
007: import java.net.URL;
008: import java.nio.charset.Charset;
009: import java.util.List;
010: import java.util.Map;
011:
012: /**
013: * Bean containing the properties of an Open Web Service (OWS).
014: * <p>
015: * The properties of this bean are meant to configure the behaviour of an open
016: * web service. The bean is a property java bean, only getters and setters
017: * apply.
018: * </p>
019: * <p>
020: * This class contains properties common to many types of open web services. It
021: * is intended to be subclassed by services who require addional properties.
022: * </p>
023: * @author Justin Deoliveira, The Open Planning Project, jdeolive@openplans.org
024: *
025: */
026: public class OWS {
027: /**
028: * id of the service
029: */
030: private String id;
031:
032: /**
033: * Service enabled flag
034: */
035: private boolean enabled;
036:
037: /**
038: * Url pointing to the service
039: */
040: private URL onlineResource;
041:
042: /**
043: * Name
044: */
045: private String name;
046:
047: /**
048: * Title
049: */
050: private String title;
051:
052: /**
053: * Abstract
054: */
055: private String serverAbstract;
056:
057: /**
058: * Fees for using the service.
059: */
060: private String fees;
061:
062: /**
063: * Service access constraints.
064: */
065: private String accessConstraints;
066:
067: /**
068: * Maintainer of the service.
069: */
070: private String maintainer;
071:
072: /**
073: * Character set to use.
074: */
075: private Charset charSet = Charset.forName("UTF-8");
076:
077: /**
078: * List of keywords associated with the service.
079: */
080: private List keywords;
081:
082: /**
083: * Client properties
084: */
085: private Map clientProperties;
086:
087: /**
088: * Flag indicating wether the service should be verbose or not.
089: */
090: private boolean isVerbose;
091:
092: /**
093: * Number of decimals used when encoding data.
094: */
095: private int numDecimals;
096:
097: /**
098: * Locationz used to look up schemas.
099: */
100: private String schemaBaseURL = "http://schemas.opengis.net";
101:
102: /**
103: * Creates a new OWS.
104: *
105: * @param id The id of the service.
106: */
107: public OWS(String id) {
108: this .id = id;
109: }
110:
111: /**
112: * Protected constructor for subclass use.
113: */
114: protected OWS() {
115: }
116:
117: /**
118: * @return The identifier of the service
119: */
120: public String getId() {
121: return id;
122: }
123:
124: /**
125: * id setter for subclasses.
126: */
127: protected void setId(String id) {
128: this .id = id;
129: }
130:
131: /**
132: * <p>
133: * Returns whether is service is enabled.
134: * </p>
135: *
136: * @return true when enabled.
137: */
138: public boolean isEnabled() {
139: return enabled;
140: }
141:
142: public void setEnabled(boolean enabled) {
143: this .enabled = enabled;
144: }
145:
146: /**
147: * <p>
148: * Returns the Online Resource for this Service.
149: * </p>
150: *
151: * @return URL The Online resource.
152: */
153: public URL getOnlineResource() {
154: return onlineResource;
155: }
156:
157: public void setOnlineResource(URL onlineResource) {
158: this .onlineResource = onlineResource;
159: }
160:
161: /**
162: * <p>
163: * A description of this service.
164: * </p>
165: *
166: * @return String This Service's abstract.
167: */
168: public String getAbstract() {
169: return serverAbstract;
170: }
171:
172: public void setAbtract(String serverAbstract) {
173: this .serverAbstract = serverAbstract;
174: }
175:
176: /**
177: * <p>
178: * A description of this service's access constraints.
179: * </p>
180: *
181: * @return String This service's access constraints.
182: */
183: public String getAccessConstraints() {
184: return accessConstraints;
185: }
186:
187: public void setAccessConstraints(String accessConstraints) {
188: this .accessConstraints = accessConstraints;
189: }
190:
191: /**
192: * <p>
193: * A description of the fees for this service.
194: * </p>
195: *
196: * @return String the fees for this service.
197: */
198: public String getFees() {
199: return fees;
200: }
201:
202: public void setFees(String fees) {
203: this .fees = fees;
204: }
205:
206: /**
207: * <p>
208: * A list of the keywords for this service.
209: * </p>
210: *
211: * @return List keywords for this service
212: */
213: public List getKeywords() {
214: return keywords;
215: }
216:
217: public void setKeywords(List keywords) {
218: this .keywords = keywords;
219: }
220:
221: /**
222: * <p>
223: * The name of the maintainer for this service.
224: * </p>
225: *
226: * @return String maintainer for this service.
227: */
228: public String getMaintainer() {
229: return maintainer;
230: }
231:
232: public void setMaintainer(String maintainer) {
233: this .maintainer = maintainer;
234: }
235:
236: /**
237: * <p>
238: * The name for this service.
239: * </p>
240: *
241: * @return String the service's name.
242: */
243: public String getName() {
244: return name;
245: }
246:
247: public void setName(String name) {
248: this .name = name;
249: }
250:
251: /**
252: * <p>
253: * The title for this service.
254: * </p>
255: *
256: * @return String the service's title.
257: */
258: public String getTitle() {
259: return title;
260: }
261:
262: public void setTitle(String title) {
263: this .title = title;
264: }
265:
266: /**
267: * @return the character set for the service.
268: */
269: public Charset getCharSet() {
270: return charSet;
271: }
272:
273: public void setCharSet(Charset charSet) {
274: this .charSet = charSet;
275: }
276:
277: /**
278: * <p>
279: * Client properties for the service.
280: * </p>
281: */
282: public Map getClientProperties() {
283: return clientProperties;
284: }
285:
286: public void setClientProperties(Map clientProperties) {
287: this .clientProperties = clientProperties;
288: }
289:
290: /**
291: * Flag indicating wether the service should be verbose, for things like
292: * responding to requests, etc...
293: *
294: * @return True if verboseness on, other wise false.
295: */
296: public boolean isVerbose() {
297: return isVerbose;
298: }
299:
300: public void setVerbose(boolean isVerbose) {
301: this .isVerbose = isVerbose;
302: }
303:
304: /**
305: * Sets the base url from which to locate schemas from.
306: *
307: * @param schemaBaseURL
308: */
309: public void setSchemaBaseURL(String schemaBaseURL) {
310: this .schemaBaseURL = schemaBaseURL;
311: }
312:
313: /**
314: * @return The base url from which to locate schemas from.
315: */
316: public String getSchemaBaseURL() {
317: return schemaBaseURL;
318: }
319: }
|