This project has retired. For details please refer to its
Attic page.
Security3to2 xref
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.juddi.v3.client.transport.wrapper;
17
18 import java.rmi.RemoteException;
19 import java.util.Map;
20 import javax.xml.ws.Binding;
21 import javax.xml.ws.BindingProvider;
22 import javax.xml.ws.EndpointReference;
23 import javax.xml.ws.soap.SOAPFaultException;
24 import org.apache.juddi.v3.client.UDDIServiceV2;
25 import org.apache.juddi.v3.client.mapping.MapUDDIv2Tov3;
26 import org.apache.juddi.v3.client.mapping.MapUDDIv3Tov2;
27 import org.uddi.api_v3.AuthToken;
28 import org.uddi.api_v3.DiscardAuthToken;
29 import org.uddi.api_v3.GetAuthToken;
30 import org.uddi.v2_service.DispositionReport;
31 import org.uddi.v2_service.Publish;
32 import org.uddi.v3_service.DispositionReportFaultMessage;
33 import org.uddi.v3_service.UDDISecurityPortType;
34
35
36
37
38
39
40
41
42
43 public class Security3to2 implements UDDISecurityPortType, BindingProvider {
44
45 Publish publishService = null;
46
47 public Security3to2() {
48
49 UDDIServiceV2 service = new UDDIServiceV2();
50 publishService = service.getPublish();
51
52 }
53
54 @Override
55 public void discardAuthToken(DiscardAuthToken body) throws DispositionReportFaultMessage, RemoteException {
56 try {
57 org.uddi.api_v2.DiscardAuthToken discardAuthToken = new org.uddi.api_v2.DiscardAuthToken();
58 discardAuthToken.setAuthInfo(body.getAuthInfo());
59 discardAuthToken.setGeneric(MapUDDIv3Tov2.VERSION);
60 publishService.discardAuthToken(discardAuthToken);
61 } catch (DispositionReport ex) {
62 throw MapUDDIv2Tov3.MapException(ex);
63 } catch (SOAPFaultException ex) {
64 throw MapUDDIv2Tov3.MapException(ex);
65 }
66 }
67
68 @Override
69 public AuthToken getAuthToken(GetAuthToken body) throws DispositionReportFaultMessage, RemoteException {
70 org.uddi.api_v2.GetAuthToken authToken = new org.uddi.api_v2.GetAuthToken();
71 authToken.setGeneric(MapUDDIv3Tov2.VERSION);
72 authToken.setCred(body.getCred());
73 authToken.setUserID(body.getUserID());
74 try {
75 org.uddi.api_v2.AuthToken authToken1 = publishService.getAuthToken(authToken);
76 AuthToken r = new AuthToken();
77 r.setAuthInfo(authToken1.getAuthInfo());
78 return r;
79 } catch (DispositionReport ex) {
80 throw MapUDDIv2Tov3.MapException(ex);
81 } catch (SOAPFaultException ex) {
82 throw MapUDDIv2Tov3.MapException(ex);
83 }
84 }
85
86
87 @Override
88 public Map<String, Object> getRequestContext() {
89 return ((BindingProvider)publishService).getRequestContext();
90 }
91
92 @Override
93 public Map<String, Object> getResponseContext() {
94 return ((BindingProvider)publishService).getResponseContext();
95 }
96
97 @Override
98 public Binding getBinding() {
99 return ((BindingProvider)publishService).getBinding();
100 }
101
102 @Override
103 public EndpointReference getEndpointReference() {
104 return ((BindingProvider)publishService).getEndpointReference();
105 }
106
107 @Override
108 public <T extends EndpointReference> T getEndpointReference(Class<T> clazz) {
109 return ((BindingProvider)publishService).getEndpointReference(clazz);
110 }
111 }