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.security.service ;
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.security.service.SecurityServiceService ;
37 import org.astrogrid.community.common.security.service.SecurityServiceServiceLocator ;
38
39 /***
40 * Soap delegate for our SecurityService service.
41 *
42 */
43 public class SecurityServiceSoapDelegate
44 extends SecurityServiceCoreDelegate
45 implements SecurityServiceDelegate
46 {
47 /***
48 * Our debug logger.
49 *
50 */
51 private static Log log = LogFactory.getLog(SecurityServiceSoapDelegate.class);
52
53 /***
54 * Public constructor.
55 *
56 */
57 public SecurityServiceSoapDelegate()
58 {
59 super() ;
60 }
61
62 /***
63 * Public constructor, for a specific endpoint URL.
64 * @param endpoint The service endpoint URL.
65 *
66 */
67 public SecurityServiceSoapDelegate(String endpoint)
68 throws MalformedURLException
69 {
70 this(new URL(endpoint)) ;
71 }
72
73 /***
74 * Public constructor, for a specific endpoint URL.
75 * @param endpoint The service endpoint URL.
76 *
77 */
78 public SecurityServiceSoapDelegate(URL endpoint)
79 {
80 super() ;
81 log.debug("") ;
82 log.debug("----\"----") ;
83 log.debug("SecurityServiceSoapDelegate()") ;
84 log.debug(" URL : " + endpoint) ;
85 this.setEndpoint(endpoint) ;
86 }
87
88 /***
89 * Our SecurityService locator.
90 *
91 */
92 private SecurityServiceService locator = new SecurityServiceServiceLocator() ;
93
94 /***
95 * Our endpoint address.
96 *
97 */
98 private URL endpoint ;
99
100 /***
101 * Get our endpoint address.
102 *
103 */
104 public URL getEndpoint()
105 {
106 return this.endpoint ;
107 }
108
109 /***
110 * Set our endpoint address.
111 * @todo Better Exception handling.
112 *
113 */
114 public void setEndpoint(URL endpoint)
115 {
116 log.debug("") ;
117 log.debug("----\"----") ;
118 log.debug("SecurityServiceSoapDelegate.setEndpoint()") ;
119 log.debug(" URL : " + endpoint) ;
120
121
122 this.endpoint = endpoint ;
123
124
125 this.setSecurityService(null) ;
126
127
128 if (null != this.getEndpoint())
129 {
130
131
132 if (null != locator)
133 {
134 try {
135
136
137 this.setSecurityService(
138 locator.getSecurityService(
139 this.getEndpoint()
140 )
141 ) ;
142 }
143
144
145 catch (Exception ouch)
146 {
147
148
149
150
151 }
152 }
153 }
154 }
155 }