01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2006, GeoTools Project Managment Committee (PMC)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation;
09: * version 2.1 of the License.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: */
16: package org.geotools.catalog.adaptable;
17:
18: import java.io.IOException;
19: import java.net.URI;
20: import java.util.List;
21:
22: import org.geotools.catalog.Catalog;
23: import org.geotools.catalog.CatalogInfo;
24:
25: import org.geotools.catalog.Service;
26: import org.geotools.util.ProgressListener;
27:
28: import com.vividsolutions.jts.geom.Envelope;
29:
30: public class AdaptingCatalog extends AdaptingResolve implements Catalog {
31:
32: protected AdaptingCatalog(Catalog catalog,
33: ResolveAdapterFactoryFinder adapter) {
34: super (catalog, adapter);
35:
36: }
37:
38: protected Catalog catalog() {
39: return (Catalog) resolve;
40: }
41:
42: public void add(Service service)
43: throws UnsupportedOperationException {
44: if (!(service instanceof AdaptingResolve)) {
45: service = new AdaptingService(service, finder);
46: }
47:
48: catalog().add(service);
49: }
50:
51: public void remove(Service service)
52: throws UnsupportedOperationException {
53: catalog().remove(service);
54: }
55:
56: public void replace(URI id, Service service)
57: throws UnsupportedOperationException {
58: catalog().replace(id, service);
59: }
60:
61: public List find(URI id, ProgressListener monitor) {
62: return catalog().find(id, monitor);
63: }
64:
65: public List findService(URI query, ProgressListener monitor) {
66: return catalog().findService(query, monitor);
67: }
68:
69: public List search(String pattern, Envelope bbox,
70: ProgressListener monitor) throws IOException {
71: return catalog().search(pattern, bbox, monitor);
72: }
73:
74: public CatalogInfo getInfo(ProgressListener monitor)
75: throws IOException {
76: return catalog().getInfo(monitor);
77: }
78:
79: }
|