01: /*
02: * uDig - User Friendly Desktop Internet GIS client
03: * http://udig.refractions.net
04: * (C) 2004, Refractions Research Inc.
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: */
17: package net.refractions.udig.catalog;
18:
19: import java.io.Serializable;
20: import java.net.URL;
21: import java.util.List;
22: import java.util.Map;
23:
24: /**
25: * Builds service proxies or clones (with an id).
26: * <p>
27: * Where not specified, sensible defaults will be added to the create options. aka Magic will occur
28: * here :-)
29: * </p>
30: *
31: * @author David Zwiers, Refractions Research
32: */
33: public interface IServiceFactory {
34:
35: /**
36: * This will create a new IService magically. In some cases sensible default parameters may be
37: * added, in addition to parameters removed. An ID will be generated.
38: *
39: * @param params
40: * @return List<IService>
41: */
42: List<IService> acquire(Map<String, Serializable> params); // may look up authentication
43:
44: /**
45: * This method generates a default set of params, and calls acquire(params).
46: *
47: * @param target
48: * @return List<IService>
49: * @see acquire(params)
50: */
51: List<IService> acquire(URL target); // creates a map, may look up authentication
52:
53: /**
54: * This method is intended to be used when replacing an IService entry in a catalog, or for
55: * cloning. This allows you to retain the URI id, while providing new parameters. This is also
56: * intended for persistence frameworks to use. WARNING: This may have undesired
57: * results/conflicts when added to a ICatalog if care is not taken when using this method.
58: *
59: * @param id
60: * @param params
61: * @return List<IService>
62: */
63: List<IService> acquire(URL id, Map<String, Serializable> params); // may not look up
64:
65: // authentication
66: /**
67: * @deprecated use {@link #acquire(Map)}
68: */
69: List<IService> aquire(Map<String, Serializable> params); // may look up authentication
70:
71: /**
72: * @deprecated use {@link #acquire(URL)}
73: */
74: List<IService> aquire(URL target); // creates a map, may look up authentication
75:
76: /**
77: * @deprecated use {@link #acquire(URL, Map)}
78: */
79: List<IService> aquire(URL id, Map<String, Serializable> params); // may not look up
80: // authentication
81: }
|