1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
package org.apache.ws.scout.registry; |
18 | |
|
19 | |
import java.io.Serializable; |
20 | |
import java.util.Collection; |
21 | |
import java.util.Properties; |
22 | |
|
23 | |
import javax.xml.registry.Connection; |
24 | |
import javax.xml.registry.ConnectionFactory; |
25 | |
import javax.xml.registry.FederatedConnection; |
26 | |
import javax.xml.registry.InvalidRequestException; |
27 | |
import javax.xml.registry.JAXRException; |
28 | |
import javax.xml.registry.UnsupportedCapabilityException; |
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | |
|
37 | |
|
38 | |
|
39 | |
public class ConnectionFactoryImpl extends ConnectionFactory implements Serializable |
40 | |
{ |
41 | |
private static final long serialVersionUID = -6902106826496922256L; |
42 | |
public static final String QUERYMANAGER_PROPERTY = "javax.xml.registry.queryManagerURL"; |
43 | |
public static final String LIFECYCLEMANAGER_PROPERTY = "javax.xml.registry.lifeCycleManagerURL"; |
44 | |
public static final String SECURITYMANAGER_PROPERTY = "javax.xml.registry.securityManagerURL"; |
45 | |
public static final String SEMANTICEQUIVALENCES_PROPERTY = "javax.xml.registry.semanticEquivalences"; |
46 | |
public static final String POSTALADDRESSSCHEME_PROPERTY = "javax.xml.registry.postalAddressScheme"; |
47 | |
public static final String AUTHENTICATIONMETHOD_PROPERTY = "javax.xml.registry.security.authenticationMethod"; |
48 | |
public static final String MAXROWS_PROPERTY = "javax.xml.registry.uddi.maxRows"; |
49 | |
|
50 | |
public static final String ADMIN_ENDPOINT_PROPERTY = "scout.proxy.adminURL"; |
51 | |
public static final String TRANSPORT_CLASS_PROPERTY = "scout.proxy.transportClass"; |
52 | |
public static final String SECURITY_PROVIDER_PROPERTY = "scout.proxy.securityProvider"; |
53 | |
public static final String PROTOCOL_HANDLER_PROPERTY = "scout.proxy.protocolHandler"; |
54 | |
public static final String UDDI_VERSION_PROPERTY = "scout.proxy.uddiVersion"; |
55 | |
public static final String UDDI_NAMESPACE_PROPERTY = "scout.proxy.uddiNamespace"; |
56 | |
|
57 | 0 | private Properties properties = new Properties(); |
58 | |
|
59 | |
|
60 | |
|
61 | |
|
62 | |
|
63 | 0 | public ConnectionFactoryImpl() {} |
64 | |
|
65 | |
public Connection createConnection() throws JAXRException |
66 | |
{ |
67 | |
|
68 | 0 | String queryManagerURL = properties.getProperty(QUERYMANAGER_PROPERTY); |
69 | 0 | if (queryManagerURL==null) throw new InvalidRequestException("Missing required property " + QUERYMANAGER_PROPERTY); |
70 | 0 | return new ConnectionImpl(properties); |
71 | |
} |
72 | |
|
73 | |
public FederatedConnection createFederatedConnection(Collection collection) throws JAXRException |
74 | |
{ |
75 | 0 | throw new UnsupportedCapabilityException("FederatedConnections are not supported in this release"); |
76 | |
} |
77 | |
|
78 | |
|
79 | |
|
80 | |
|
81 | |
|
82 | |
|
83 | |
|
84 | |
|
85 | |
public Properties getProperties() |
86 | |
{ |
87 | 0 | return properties; |
88 | |
} |
89 | |
|
90 | |
|
91 | |
|
92 | |
|
93 | |
|
94 | |
|
95 | |
public void setProperties(Properties properties) |
96 | |
{ |
97 | 0 | if (properties==null) properties = new Properties(); |
98 | 0 | this.properties.putAll(properties); |
99 | 0 | } |
100 | |
|
101 | |
public static ConnectionFactory newInstance() |
102 | |
{ |
103 | 0 | return new ConnectionFactoryImpl(); |
104 | |
} |
105 | |
|
106 | |
} |