01: /* Copyright (c) 2001 - 2007 TOPP - www.openplans.org. All rights reserved.
02: * This code is licensed under the GPL 2.0 license, availible at the root
03: * application directory.
04: */
05: package org.vfny.geoserver.wms.responses.map.georss;
06:
07: import org.vfny.geoserver.global.WMS;
08: import org.vfny.geoserver.wms.GetMapProducer;
09: import org.vfny.geoserver.wms.GetMapProducerFactorySpi;
10: import java.util.HashSet;
11: import java.util.Map;
12: import java.util.Set;
13:
14: public class GeoRSSMapProducerFactory implements
15: GetMapProducerFactorySpi {
16: static Set formats = new HashSet();
17: static Set aliases = new HashSet();
18:
19: static {
20: formats.add(AtomGeoRSSMapProducer.MIME_TYPE);
21: formats.add(RSSGeoRSSMapProducer.MIME_TYPE);
22:
23: aliases.addAll(AtomGeoRSSMapProducer.FORMATS);
24: aliases.addAll(RSSGeoRSSMapProducer.FORMATS);
25: }
26:
27: public boolean canProduce(String mapFormat) {
28: return formats.contains(mapFormat)
29: || aliases.contains(mapFormat);
30: }
31:
32: public GetMapProducer createMapProducer(String mapFormat, WMS wms)
33: throws IllegalArgumentException {
34: if (AtomGeoRSSMapProducer.MIME_TYPE.equals(mapFormat)
35: || AtomGeoRSSMapProducer.FORMATS.contains(mapFormat)) {
36: return new AtomGeoRSSMapProducer();
37: }
38:
39: if (RSSGeoRSSMapProducer.MIME_TYPE.equals(mapFormat)
40: || RSSGeoRSSMapProducer.FORMATS.contains(mapFormat)) {
41: return new RSSGeoRSSMapProducer();
42: }
43:
44: return null;
45: }
46:
47: public String getName() {
48: return "GeoRSS";
49: }
50:
51: public Set getSupportedFormats() {
52: return formats;
53: }
54:
55: public boolean isAvailable() {
56: return true;
57: }
58:
59: public Map getImplementationHints() {
60: return null;
61: }
62: }
|