source: TI12-security/trunk/java/DEWS/.metadata/.plugins/org.eclipse.core.resources/.history/7b/b09263642bb5001b17e1d3f3a43f3aed @ 2110

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/java/DEWS/.metadata/.plugins/org.eclipse.core.resources/.history/7b/b09263642bb5001b17e1d3f3a43f3aed@2110
Revision 2110, 3.5 KB checked in by pjkersha, 13 years ago (diff)
Line 
1package ndg.security.sessionMgr;
2
3public class SessionMgrProxy implements ndg.security.sessionMgr.SessionMgr {
4  private boolean _useJNDI = true;
5  private String _endpoint = null;
6  private ndg.security.sessionMgr.SessionMgr __sessionMgr = null;
7 
8  public SessionMgrProxy() {
9    _initSessionMgrProxy();
10  }
11 
12  private void _initSessionMgrProxy() {
13 
14  if (_useJNDI) {
15    try{
16      javax.naming.InitialContext ctx = new javax.naming.InitialContext();
17      __sessionMgr = ((ndg.security.sessionMgr.SessionMgrService)ctx.lookup("java:comp/env/service/SessionMgrService")).getSessionMgr();
18      }
19    catch (javax.naming.NamingException namingException) {}
20    catch (javax.xml.rpc.ServiceException serviceException) {}
21  }
22  if (__sessionMgr == null) {
23    try{
24      __sessionMgr = (new ndg.security.sessionMgr.SessionMgrServiceLocator()).getSessionMgr();
25      }
26    catch (javax.xml.rpc.ServiceException serviceException) {}
27  }
28  if (__sessionMgr != null) {
29    if (_endpoint != null)
30      ((javax.xml.rpc.Stub)__sessionMgr)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
31    else
32      _endpoint = (String)((javax.xml.rpc.Stub)__sessionMgr)._getProperty("javax.xml.rpc.service.endpoint.address");
33  }
34 
35}
36
37
38public void useJNDI(boolean useJNDI) {
39  _useJNDI = useJNDI;
40  __sessionMgr = null;
41 
42}
43
44public String getEndpoint() {
45  return _endpoint;
46}
47
48public void setEndpoint(String endpoint) {
49  _endpoint = endpoint;
50  if (__sessionMgr != null)
51    ((javax.xml.rpc.Stub)__sessionMgr)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
52 
53}
54
55public ndg.security.sessionMgr.SessionMgr getSessionMgr() {
56  if (__sessionMgr == null)
57    _initSessionMgrProxy();
58  return __sessionMgr;
59}
60
61public void addUser(java.lang.String username, java.lang.String passphrase) throws java.rmi.RemoteException{
62  if (__sessionMgr == null)
63    _initSessionMgrProxy();
64  __sessionMgr.addUser(username, passphrase);
65}
66
67public void connect(java.lang.String username, java.lang.String passphrase, boolean createServerSess, boolean getCookie, javax.xml.rpc.holders.StringHolder proxyCert, javax.xml.rpc.holders.StringHolder proxyPriKey, javax.xml.rpc.holders.StringHolder userCert, javax.xml.rpc.holders.StringHolder cookie) throws java.rmi.RemoteException{
68  if (__sessionMgr == null)
69    _initSessionMgrProxy();
70  __sessionMgr.connect(username, passphrase, createServerSess, getCookie, proxyCert, proxyPriKey, userCert, cookie);
71}
72
73public void disconnect(java.lang.String userCert, java.lang.String sessID, java.lang.String encrSessionMgrURI) throws java.rmi.RemoteException{
74  if (__sessionMgr == null)
75    _initSessionMgrProxy();
76  __sessionMgr.disconnect(userCert, sessID, encrSessionMgrURI);
77}
78
79public void getAttCert(java.lang.String userCert, java.lang.String sessID, java.lang.String encrSessionMgrURI, java.lang.String attAuthorityURI, java.lang.String attAuthorityCert, java.lang.String reqRole, boolean mapFromTrustedHosts, boolean rtnExtAttCertList, ndg.security.sessionMgr.holders.StringArrayHolder extAttCert, java.lang.String[] extTrustedHost, javax.xml.rpc.holders.StringHolder attCert, javax.xml.rpc.holders.StringHolder msg) throws java.rmi.RemoteException{
80  if (__sessionMgr == null)
81    _initSessionMgrProxy();
82  __sessionMgr.getAttCert(userCert, sessID, encrSessionMgrURI, attAuthorityURI, attAuthorityCert, reqRole, mapFromTrustedHosts, rtnExtAttCertList, extAttCert, extTrustedHost, attCert, msg);
83}
84
85public java.lang.String getX509Cert() throws java.rmi.RemoteException{
86  if (__sessionMgr == null)
87    _initSessionMgrProxy();
88  return __sessionMgr.getX509Cert();
89}
90
91
92}
Note: See TracBrowser for help on using the repository browser.