This project has retired. For details please refer to its
Attic page.
RegistryServiceImpl xref
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 javax.xml.registry.BulkResponse;
20 import javax.xml.registry.BusinessLifeCycleManager;
21 import javax.xml.registry.BusinessQueryManager;
22 import javax.xml.registry.CapabilityProfile;
23 import javax.xml.registry.DeclarativeQueryManager;
24 import javax.xml.registry.InvalidRequestException;
25 import javax.xml.registry.JAXRException;
26 import javax.xml.registry.RegistryService;
27 import javax.xml.registry.UnsupportedCapabilityException;
28 import javax.xml.registry.infomodel.ClassificationScheme;
29
30 import org.apache.ws.scout.registry.infomodel.ClassificationSchemeImpl;
31 import org.apache.ws.scout.registry.infomodel.KeyImpl;
32 import org.apache.ws.scout.transport.TransportException;
33
34
35
36
37
38
39
40
41
42 public class RegistryServiceImpl implements RegistryService
43 {
44 private final IRegistryBase registry;
45 private final BusinessQueryManager queryManager;
46 private final BusinessLifeCycleManager lifeCycleManager;
47
48 private final ClassificationSchemeImpl postalScheme;
49 private final int maxRows;
50 private final String uddiVersion;
51
52 private ConnectionImpl connection;
53
54 public RegistryServiceImpl(IRegistryBase registry, String postalScheme, int maxRows, String uddiVersion)
55 {
56 this.registry = registry;
57 this.maxRows = maxRows;
58 this.uddiVersion = uddiVersion;
59 if ("3.0".equals(uddiVersion)) {
60 queryManager = new BusinessQueryManagerV3Impl(this);
61 lifeCycleManager = new BusinessLifeCycleManagerV3Impl(this);
62 } else {
63 queryManager = new BusinessQueryManagerImpl(this);
64 lifeCycleManager = new BusinessLifeCycleManagerImpl(this);
65 }
66 if (postalScheme == null)
67 {
68 this.postalScheme = null;
69 } else
70 {
71 this.postalScheme = new ClassificationSchemeImpl(lifeCycleManager);
72 this.postalScheme.setKey(new KeyImpl(postalScheme));
73 }
74 }
75
76 IRegistryBase getRegistry()
77 {
78 return registry;
79 }
80
81 BusinessLifeCycleManager getLifeCycleManagerImpl()
82 {
83 return lifeCycleManager;
84 }
85
86 int getMaxRows()
87 {
88 return maxRows;
89 }
90
91 public CapabilityProfile getCapabilityProfile()
92 {
93 return new CapabilityProfileImpl();
94 }
95
96 public String getUddiVersion() {
97 return uddiVersion;
98 }
99
100 public BusinessQueryManager getBusinessQueryManager() throws JAXRException
101 {
102 return queryManager;
103 }
104
105 public BusinessLifeCycleManager getBusinessLifeCycleManager() throws JAXRException
106 {
107 return lifeCycleManager;
108 }
109
110 public BulkResponse getBulkResponse(String s) throws JAXRException, InvalidRequestException
111 {
112 if (s == "" || s == null)
113 throw new InvalidRequestException();
114 return null;
115 }
116
117 public DeclarativeQueryManager getDeclarativeQueryManager() throws JAXRException, UnsupportedCapabilityException
118 {
119 throw new UnsupportedCapabilityException();
120 }
121
122 public ClassificationScheme getDefaultPostalScheme() throws JAXRException
123 {
124 return postalScheme;
125 }
126
127 public String makeRegistrySpecificRequest(String s) throws JAXRException
128 {
129 String inquiry = "INQUIRY";
130 String publish = "PUBLISH";
131 String type = "";
132
133
134 String snippet = s.substring(0,20);
135 if( snippet.indexOf("save") > -1) type = publish;
136 else
137 type = inquiry;
138
139 try {
140 return registry.execute(s,type);
141 } catch (TransportException e) {
142 throw new JAXRException(e.getLocalizedMessage());
143 }
144 }
145
146 public ConnectionImpl getConnection()
147 {
148 return connection;
149 }
150
151 public void setConnection(ConnectionImpl connection)
152 {
153 this.connection = connection;
154 }
155
156 }