1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28 package org.astrogrid.community.client.policy.manager ;
29
30 import org.apache.commons.logging.Log ;
31 import org.apache.commons.logging.LogFactory ;
32
33 import java.net.URL ;
34 import java.net.MalformedURLException ;
35
36 import org.astrogrid.community.common.policy.manager.PolicyManagerService ;
37 import org.astrogrid.community.common.policy.manager.PolicyManagerServiceLocator ;
38
39 /***
40 * Soap delegate for our PolicyManager service.
41 *
42 */
43 public class PolicyManagerSoapDelegate
44 extends PolicyManagerCoreDelegate
45 implements PolicyManagerDelegate
46 {
47 /***
48 * Our debug logger.
49 *
50 */
51 private static Log log = LogFactory.getLog(PolicyManagerSoapDelegate.class);
52
53 /***
54 * Our PolicyManager locator.
55 *
56 */
57 private PolicyManagerService locator = new PolicyManagerServiceLocator() ;
58
59 /***
60 * Our endpoint address.
61 *
62 */
63 private URL endpoint ;
64
65 /***
66 * Get our endpoint address.
67 *
68 */
69 public URL getEndpoint()
70 {
71 return this.endpoint ;
72 }
73
74 /***
75 * Public constructor, for a specific endpoint URL.
76 * @param endpoint The service endpoint URL.
77 * @todo Trap null param.
78 * @todo Trap MalformedURLException.
79 *
80 */
81 public PolicyManagerSoapDelegate(String endpoint)
82 throws MalformedURLException
83 {
84 this(new URL(endpoint)) ;
85 }
86
87 /***
88 * Public constructor, for a specific endpoint URL.
89 * @param endpoint The service endpoint URL.
90 * @todo Better Exception handling.
91 * @todo Trap null param.
92 *
93 */
94 public PolicyManagerSoapDelegate(URL endpoint)
95 {
96 super() ;
97 log.debug("") ;
98 log.debug("----\"----") ;
99 log.debug("PolicyManagerSoapDelegate()") ;
100 log.debug(" URL : " + endpoint) ;
101
102
103 if (null == endpoint)
104 {
105 throw new IllegalArgumentException(
106 "Null endpoint"
107 ) ;
108 }
109
110
111 this.endpoint = endpoint ;
112
113
114 try {
115 this.setPolicyManager(
116 locator.getPolicyManager(
117 this.endpoint
118 )
119 ) ;
120 }
121
122
123 catch (Exception ouch)
124 {
125
126
127
128
129 }
130 }
131 }