public void run() { try { synchronized (stub) { String sessionCookie = login(); ServiceClient client = stub._getServiceClient(); Options option = client.getOptions(); option.setManageSession(true); option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, sessionCookie); } } catch (UserStoreException e) { log.error("Error login in tenant manager", e); } }
@Override public void run() { try { synchronized (stub) { String sessionCookie = login(); ServiceClient client = stub._getServiceClient(); Options option = client.getOptions(); option.setManageSession(true); option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, sessionCookie); } } catch (UserStoreException e) { log.error(ERROR_MESSAGE, e); } }
private RemoteTenantManagerServiceStub getStub() throws Exception { if (stub == null) { stub = new RemoteTenantManagerServiceStub(UserMgtWSAPIDSComponent .getCcServiceInstance().getClientConfigContext(), url + "RemoteTenantManagerService"); ServiceClient client = stub._getServiceClient(); Options option = client.getOptions(); option.setManageSession(true); LoginSender sender = new LoginSender(); String sessionCookie = sender.login(); if (sessionCookie == null) { log.error("WSRealmTenantManager cannot login to server"); throw new Exception("WSRealmTenantManager cannot login to server"); } option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, sessionCookie); //Timer timer = new Timer(); // timer.scheduleAtFixedRate(sender, 10000, 10000); } return stub; }
private RemoteTenantManagerServiceStub getStub() throws UserStoreException { if (stub == null) { try { stub = new RemoteTenantManagerServiceStub(UserMgtWSAPIDSComponent .getCcServiceInstance().getClientConfigContext(), url + SERVICE_NAME); ServiceClient client = stub._getServiceClient(); Options option = client.getOptions(); option.setManageSession(true); LoginSender sender = new LoginSender(); String sessionCookie = sender.login(); if (sessionCookie == null) { throw new UserStoreException(SERVER_LOGIN_ERROR); } option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, sessionCookie); } catch (AxisFault axisFault) { throw new UserStoreException("Axis error occurred while creating service client stub",axisFault); } } return stub; }