This project has retired. For details please refer to its
Attic page.
PublicationQuery xref
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.juddi.api.util;
18
19 import java.util.ArrayList;
20 import java.util.Hashtable;
21 import java.util.List;
22
23
24
25
26
27
28 public enum PublicationQuery implements UDDIQuery {
29 GET_REGISTEREDINFO("get_registeredInfo"),
30 SAVE_BUSINESS("save_business"),
31 SAVE_SERVICE("save_service"),
32 SAVE_BINDING("save_binding"),
33 SAVE_TMODEL("save_tmodel"),
34 DELETE_BUSINESS("delete_business"),
35 DELETE_SERVICE("delete_service"),
36 DELETE_BINDING("delete_binding"),
37 DELETE_TMODEL("delete_tmodel"),
38 ADD_PUBLISHERASSERTIONS("add_publisherassertions"),
39 SET_PUBLISHERASSERTIONS("set_publisherassertions"),
40 GET_PUBLISHERASSERTIONS("get_publisherassertions"),
41 DELETE_PUBLISHERASSERTIONS("delete_publisherassertions"),
42 GET_ASSERTIONSTATUSREPORT("get_assertionstatusreport");
43
44 private String _query;
45 private static Hashtable<String, PublicationQuery> _publicationQueries = null;
46
47 PublicationQuery(final String query) {
48 _query = query;
49 }
50
51 public String getQuery() {
52 return _query;
53 }
54
55 public synchronized static void initPublicationQueries () {
56 if (_publicationQueries == null) {
57 _publicationQueries = new Hashtable();
58
59 _publicationQueries.put(PublicationQuery.GET_REGISTEREDINFO.getQuery(), PublicationQuery.GET_REGISTEREDINFO);
60 _publicationQueries.put(PublicationQuery.SAVE_BUSINESS.getQuery(), PublicationQuery.SAVE_BUSINESS);
61 _publicationQueries.put(PublicationQuery.SAVE_SERVICE.getQuery(), PublicationQuery.SAVE_SERVICE);
62 _publicationQueries.put(PublicationQuery.SAVE_BINDING.getQuery(), PublicationQuery.SAVE_BINDING);
63 _publicationQueries.put(PublicationQuery.SAVE_TMODEL.getQuery(), PublicationQuery.SAVE_TMODEL);
64 _publicationQueries.put(PublicationQuery.DELETE_BUSINESS.getQuery(), PublicationQuery.DELETE_BUSINESS);
65 _publicationQueries.put(PublicationQuery.DELETE_SERVICE.getQuery(), PublicationQuery.DELETE_SERVICE);
66 _publicationQueries.put(PublicationQuery.DELETE_BINDING.getQuery(), PublicationQuery.DELETE_BINDING);
67 _publicationQueries.put(PublicationQuery.DELETE_TMODEL.getQuery(), PublicationQuery.DELETE_TMODEL);
68 _publicationQueries.put(PublicationQuery.ADD_PUBLISHERASSERTIONS.getQuery(), PublicationQuery.ADD_PUBLISHERASSERTIONS);
69 _publicationQueries.put(PublicationQuery.SET_PUBLISHERASSERTIONS.getQuery(), PublicationQuery.SET_PUBLISHERASSERTIONS);
70 _publicationQueries.put(PublicationQuery.GET_PUBLISHERASSERTIONS.getQuery(), PublicationQuery.GET_PUBLISHERASSERTIONS);
71 _publicationQueries.put(PublicationQuery.DELETE_PUBLISHERASSERTIONS.getQuery(), PublicationQuery.DELETE_PUBLISHERASSERTIONS);
72 _publicationQueries.put(PublicationQuery.GET_ASSERTIONSTATUSREPORT.getQuery(), PublicationQuery.GET_ASSERTIONSTATUSREPORT);
73 }
74 }
75
76 public static List<String> getQueries() {
77 if (_publicationQueries == null) {
78 initPublicationQueries();
79 }
80
81 List list = new ArrayList<String>(_publicationQueries.keySet());
82 return list;
83 }
84
85
86
87
88
89
90
91 public static PublicationQuery fromQuery(final String query) {
92 if (_publicationQueries == null) {
93 initPublicationQueries();
94 }
95
96 if (_publicationQueries.contains(query)) {
97 return _publicationQueries.get(query);
98 } else {
99 throw new IllegalArgumentException("Unrecognized query " + query);
100 }
101 }
102 }