STSClient createSTSClient(final STSClientConfig config) throws ParsingException { STSClientPool pool = STSClientFactory.getInstance(); if (pool.configExists(config) == false) { pool.createPool(config); } return pool.getClient(config); }
protected STSClient createWSTrustClient(final STSClientConfig config) { try { STSClientPool pool = STSClientFactory.getInstance(); if (initialClientsInPool > 0) { pool.createPool(initialClientsInPool, config); } return pool.getClient(config); } catch (final Exception e) { throw logger.authCouldNotCreateWSTrustClient(e); } }
protected STSClient createWSTrustClient(final STSClientConfig config) { try { STSClientPool pool = STSClientFactory.getInstance(); if (initialClientsInPool > 0) { pool.createPool(initialClientsInPool, config); } return pool.getClient(config); } catch (final Exception e) { throw logger.authCouldNotCreateWSTrustClient(e); } }
STSClient createSTSClient(final STSClientConfig config) throws ParsingException { STSClientPool pool = STSClientFactory.getInstance(); if (pool.configExists(config) == false) { pool.createPool(config); } return pool.getClient(config); }
@Override protected STSClient createWSTrustClient(final STSClientConfig config) { try { STSClientPool pool = STSClientPoolFactory.getPoolInstance(); pool.createPool(initialClientsInPool, new STSClientCreationCallBack() { @Override public STSClient createClient() { String binaryTokenKey = (String) options.get(MapBasedTokenHandler.SYS_PROP_TOKEN_KEY); if (binaryTokenKey == null) { binaryTokenKey = SecurityActions.getSystemProperty(MapBasedTokenHandler.SYS_PROP_TOKEN_KEY, MapBasedTokenHandler.DEFAULT_TOKEN_KEY); } Object binaryToken = sharedState.get(binaryTokenKey); Map<String, ? super Object> STSClientOptions = new HashMap<String, Object>(options); if (binaryToken != null) { STSClientOptions.put(binaryTokenKey, binaryToken); } return new JBWSTokenClient(config, STSClientOptions); } @Override public String getKey() { return STSClientConfig.computeSTSClientConfigKey(ModuleUtils.getCurrentModuleId(), config.getServiceName(), config.getPortName(), config.getEndPointAddress(), config.getUsername()); } }); return pool.getClient(config); } catch (final Exception e) { throw logger.authCouldNotCreateWSTrustClient(e); } }
@Override protected STSClient createWSTrustClient(final STSClientConfig config) { try { STSClientPool pool = STSClientPoolFactory.getPoolInstance(); pool.createPool(initialClientsInPool, new STSClientCreationCallBack() { @Override public STSClient createClient() { String binaryTokenKey = (String) options.get(MapBasedTokenHandler.SYS_PROP_TOKEN_KEY); if (binaryTokenKey == null) { binaryTokenKey = SecurityActions.getSystemProperty(MapBasedTokenHandler.SYS_PROP_TOKEN_KEY, MapBasedTokenHandler.DEFAULT_TOKEN_KEY); } Object binaryToken = sharedState.get(binaryTokenKey); Map<String, ? super Object> STSClientOptions = new HashMap<String, Object>(options); if (binaryToken != null) { STSClientOptions.put(binaryTokenKey, binaryToken); } return new JBWSTokenClient(config, STSClientOptions); } @Override public String getKey() { return STSClientConfig.computeSTSClientConfigKey(ModuleUtils.getCurrentModuleId(), config.getServiceName(), config.getPortName(), config.getEndPointAddress(), config.getUsername()); } }); return pool.getClient(config); } catch (final Exception e) { throw logger.authCouldNotCreateWSTrustClient(e); } }
pool.createPool(initialClientsInPool, config);
pool.createPool(initialClientsInPool, config);
public WSTrustClient(String serviceName, String port, String[] endpointURIs, SecurityInfo secInfo) throws ParsingException { // basic input validation. if (serviceName == null || port == null || endpointURIs == null || secInfo == null) throw logger.nullArgumentError("The service name, port, endpoint URIs and security info parameters cannot be null"); if (endpointURIs.length == 0) throw logger.nullArgumentError("At least one endpoint URI must be provided"); // create an STSClient for each endpointURI. this.clients = new STSClient[endpointURIs.length]; Builder builder = new STSClientConfig.Builder(); builder.serviceName(serviceName).portName(port).username(secInfo.username).password(secInfo.passwd); STSClientPool pool = STSClientFactory.getInstance(); int index = 0; for (String endpointURI : endpointURIs) { builder.endpointAddress(endpointURI); STSClientConfig config = builder.build(); pool.createPool(config); this.clients[index++] = pool.getClient(config); } }
public WSTrustClient(String serviceName, String port, String[] endpointURIs, SecurityInfo secInfo) throws ParsingException { // basic input validation. if (serviceName == null || port == null || endpointURIs == null || secInfo == null) throw logger.nullArgumentError("The service name, port, endpoint URIs and security info parameters cannot be null"); if (endpointURIs.length == 0) throw logger.nullArgumentError("At least one endpoint URI must be provided"); // create an STSClient for each endpointURI. this.clients = new STSClient[endpointURIs.length]; Builder builder = new STSClientConfig.Builder(); builder.serviceName(serviceName).portName(port).username(secInfo.username).password(secInfo.passwd); STSClientPool pool = STSClientFactory.getInstance(); int index = 0; for (String endpointURI : endpointURIs) { builder.endpointAddress(endpointURI); STSClientConfig config = builder.build(); pool.createPool(config); this.clients[index++] = pool.getClient(config); } }