1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.juddi.function;
17
18 import org.apache.commons.logging.Log;
19 import org.apache.commons.logging.LogFactory;
20 import org.apache.juddi.datatype.RegistryObject;
21 import org.apache.juddi.datatype.request.GetRegistryInfo;
22 import org.apache.juddi.datatype.response.RegistryInfo;
23 import org.apache.juddi.error.RegistryException;
24 import org.apache.juddi.registry.RegistryEngine;
25 import org.apache.juddi.util.Config;
26 import org.apache.juddi.util.Release;
27
28 /***
29 * @author Steve Viens (sviens@apache.org)
30 */
31 public class GetRegisteryInfoFunction extends AbstractFunction
32 {
33
34 private static Log log = LogFactory.getLog(GetRegisteryInfoFunction.class);
35
36 /***
37 *
38 */
39 public GetRegisteryInfoFunction(RegistryEngine registry)
40 {
41 super(registry);
42 }
43
44 /***
45 *
46 */
47 public RegistryObject execute(RegistryObject regObject)
48 throws RegistryException
49 {
50 GetRegistryInfo request = (GetRegistryInfo)regObject;
51 String generic = request.getGeneric();
52
53 try
54 {
55
56
57
58 RegistryInfo info = new RegistryInfo();
59 info.setGeneric(generic);
60 info.setOperator(Config.getOperator());
61 info.addProperty("operatorName",Config.getStringProperty("juddi.operatorName"));
62 info.addProperty("operatorEmailAddress",Config.getStringProperty("juddi.operatorEmailAddress"));
63 info.addProperty("registryVersion",Release.getRegistryVersion());
64 info.addProperty("uddiVersion",Release.getUDDIVersion());
65
66 return info;
67 }
68 catch(Exception ex)
69 {
70 log.error(ex);
71 throw new RegistryException(ex);
72 }
73 }
74
75
76 /****************************************************************************/
77 /****************************** TEST DRIVER *********************************/
78 /****************************************************************************/
79
80
81 public static void main(String[] args)
82 {
83
84 RegistryEngine reg = new RegistryEngine();
85 reg.init();
86
87 try
88 {
89 }
90 catch (Exception ex)
91 {
92
93 ex.printStackTrace();
94 }
95 finally
96 {
97
98 reg.dispose();
99 }
100 }
101 }