public WSAuthorizationManager(String serverUrl, String cookie, ConfigurationContext configCtxt) throws UserStoreException { try { stub = new RemoteAuthorizationManagerServiceStub(configCtxt, serverUrl + SERVICE_NAME); ServiceClient client = stub._getServiceClient(); Options option = client.getOptions(); option.setManageSession(true); option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie); } catch (AxisFault e) { throw new UserStoreException("Axis error occurred while creating service client stub", e); } }
public WSAuthorizationManager(String serverUrl, String cookie, ConfigurationContext configCtxt) throws UserStoreException { try { stub = new RemoteAuthorizationManagerServiceStub(configCtxt, serverUrl + "RemoteAuthorizationManagerService"); ServiceClient client = stub._getServiceClient(); Options option = client.getOptions(); option.setManageSession(true); option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie); } catch (AxisFault e) { throw new UserStoreException(); } }
public RemoteAuthorizationManagerClient() throws AppManagementException { AppManagerConfiguration config = ServiceReferenceHolder.getInstance(). getAPIManagerConfigurationService().getAPIManagerConfiguration(); String serviceURL = config.getFirstProperty(AppMConstants.AUTH_MANAGER_URL); username = config.getFirstProperty(AppMConstants.AUTH_MANAGER_USERNAME); password = config.getFirstProperty(AppMConstants.AUTH_MANAGER_PASSWORD); if (serviceURL == null || username == null || password == null) { throw new AppManagementException("Required connection details for authentication " + "manager not provided"); } try { authorizationManager = new RemoteAuthorizationManagerServiceStub(null, serviceURL + "RemoteAuthorizationManagerService"); userStoreManager = new RemoteUserStoreManagerServiceStub(null, serviceURL + "RemoteUserStoreManagerService"); for (ServiceClient client : new ServiceClient[] { authorizationManager._getServiceClient(), userStoreManager._getServiceClient()}) { Options options = client.getOptions(); options.setTimeOutInMilliSeconds(TIMEOUT_IN_MILLIS); options.setProperty(HTTPConstants.SO_TIMEOUT, TIMEOUT_IN_MILLIS); options.setProperty(HTTPConstants.CONNECTION_TIMEOUT, TIMEOUT_IN_MILLIS); options.setCallTransportCleanup(true); options.setManageSession(true); } } catch (AxisFault axisFault) { throw new AppManagementException("Error while initializing the user management stubs", axisFault); } }