@Override public void initialize() { initializeObject(INVOKER); object.setProperties(extraProps); }
/** * Sets provider specific properties. * * @param props map of additional provider properties */ public void setProperties(final Map<String, Object> props) { checkImmutable(); logger.trace("setting properties: {}", props); properties = props; }
@Override @SuppressWarnings("unchecked") public void initialize() { initializeObject(INVOKER); final ConnectionConfig cc = new ConnectionConfig(); final ConnectionConfigPropertySource ccPropSource = new ConnectionConfigPropertySource( cc, propertiesDomain, properties); ccPropSource.initialize(); object.setConnectionConfig(cc); final ProviderConfig pc = new ProviderConfig(); final ProviderConfigPropertySource pcPropSource = new ProviderConfigPropertySource( pc, propertiesDomain, properties); pcPropSource.initialize(); object.getProvider().getProviderConfig().setConnectionStrategy(pc.getConnectionStrategy()); if (pc.getOperationExceptionResultCodes() != null) { object.getProvider().getProviderConfig().setOperationExceptionResultCodes(pc.getOperationExceptionResultCodes()); } if (pc.getControlProcessor() != null) { object.getProvider().getProviderConfig().setControlProcessor(pc.getControlProcessor()); } if (!extraProps.isEmpty()) { object.getProvider().getProviderConfig().setProperties(extraProps); } }
@Override @SuppressWarnings("unchecked") public void initialize() { initializeObject(INVOKER); final ConnectionConfig cc = new ConnectionConfig(); final ConnectionConfigPropertySource ccPropSource = new ConnectionConfigPropertySource( cc, propertiesDomain, properties); ccPropSource.initialize(); object.setConnectionConfig(cc); final ProviderConfig pc = new ProviderConfig(); final ProviderConfigPropertySource pcPropSource = new ProviderConfigPropertySource( pc, propertiesDomain, properties); pcPropSource.initialize(); if (pc.getOperationExceptionResultCodes() != null) { object.getProvider().getProviderConfig().setOperationExceptionResultCodes(pc.getOperationExceptionResultCodes()); } if (pc.getControlProcessor() != null) { object.getProvider().getProviderConfig().setControlProcessor(pc.getControlProcessor()); } if (!extraProps.isEmpty()) { object.getProvider().getProviderConfig().setProperties(extraProps); } }
/** * Creates a new abstract connection factory. Once invoked the supplied provider config is made immutable. See {@link * ProviderConfig#makeImmutable()}. * * @param url of the ldap to connect to * @param strategy connection strategy * @param config provider configuration */ public AbstractProviderConnectionFactory(final String url, final ConnectionStrategy strategy, final T config) { metadata = new DefaultConnectionFactoryMetadata(url); connectionStrategy = strategy; providerConfig = config; providerConfig.makeImmutable(); }
/** * Config test data. * * @return test data */ @DataProvider(name = "configs") public Object[][] createConfigs() { return new Object[][] { new Object[] {new ConnectionConfig(), }, new Object[] {new PoolConfig(), }, new Object[] {new ProviderConfig(), }, new Object[] {new SaslConfig(), }, new Object[] {new SslConfig(), }, new Object[] {new SocketConfig(), }, }; }
final String[] urls = providerConfig.getConnectionStrategy().getLdapUrls(metadata); if (urls == null || urls.length == 0) { throw new ConnectionException( "Connection strategy " + providerConfig.getConnectionStrategy() + " did not produce any LDAP URLs for " + metadata); metadata, url, providerConfig.getConnectionStrategy(), }); conn = createInternal(url);
@Override @SuppressWarnings("unchecked") public void initialize() { initializeObject(INVOKER); final ConnectionConfig cc = new ConnectionConfig(); final ConnectionConfigPropertySource ccPropSource = new ConnectionConfigPropertySource( cc, propertiesDomain, properties); ccPropSource.initialize(); object.setConnectionConfig(cc); final ProviderConfig pc = new ProviderConfig(); final ProviderConfigPropertySource pcPropSource = new ProviderConfigPropertySource( pc, propertiesDomain, properties); pcPropSource.initialize(); if (pc.getOperationExceptionResultCodes() != null) { object.getProvider().getProviderConfig().setOperationExceptionResultCodes(pc.getOperationExceptionResultCodes()); } if (pc.getControlProcessor() != null) { object.getProvider().getProviderConfig().setControlProcessor(pc.getControlProcessor()); } if (!extraProps.isEmpty()) { object.getProvider().getProviderConfig().setProperties(extraProps); } }
/** * Creates a new abstract connection factory. Once invoked the supplied provider config is made immutable. See {@link * ProviderConfig#makeImmutable()}. * * @param url of the ldap to connect to * @param strategy connection strategy * @param config provider configuration */ public AbstractProviderConnectionFactory(final String url, final ConnectionStrategy strategy, final T config) { metadata = new DefaultConnectionFactoryMetadata(url); connectionStrategy = strategy; providerConfig = config; providerConfig.makeImmutable(); }
@Override public void initialize() { initializeObject(INVOKER); object.setProperties(extraProps); }
/** * Sets the control processor. * * @param processor control processor */ public void setControlProcessor(final ControlProcessor<C> processor) { checkImmutable(); logger.trace("setting controlProcessor: {}", processor); controlProcessor = processor; }
/** * Creates a new abstract connection factory. Once invoked the supplied provider config is made immutable. See {@link * ProviderConfig#makeImmutable()}. * * @param url of the ldap to connect to * @param config provider configuration */ public AbstractProviderConnectionFactory(final String url, final T config) { if (url == null) { throw new IllegalArgumentException("LDAP URL cannot be null"); } metadata = new DefaultConnectionFactoryMetadata(url); providerConfig = config; providerConfig.makeImmutable(); }
@Override public void initialize() { initializeObject(INVOKER); object.setProperties(extraProps); }
/** * Sets provider specific properties. * * @param props map of additional provider properties */ public void setProperties(final Map<String, Object> props) { checkImmutable(); logger.trace("setting properties: {}", props); properties = props; }
@Override public void setProperties(final Map<String, Object> props) { checkImmutable(); final boolean allowAnyHostname = Boolean.valueOf((String) props.get(ALLOW_ANY_HOSTNAME)); if (allowAnyHostname) { setHostnameVerifier(new AllowAnyHostnameVerifier()); } super.setProperties(props); }
/** * Sets the control processor. * * @param processor control processor */ public void setControlProcessor(final ControlProcessor<C> processor) { checkImmutable(); logger.trace("setting controlProcessor: {}", processor); controlProcessor = processor; }
@Override public void setProperties(final Map<String, Object> props) { checkImmutable(); final boolean allowAnyHostname = Boolean.valueOf((String) props.get(ALLOW_ANY_HOSTNAME)); if (allowAnyHostname) { setHostnameVerifier(new AllowAnyHostnameVerifier()); } super.setProperties(props); }
/** * Sets the connection strategy. * * @param strategy for making connections */ public void setConnectionStrategy(final ConnectionStrategy strategy) { checkImmutable(); logger.trace("setting connectionStrategy: {}", strategy); connectionStrategy = strategy; }
@Override public void setProperties(final Map<String, Object> props) { checkImmutable(); final boolean allowAnyHostname = Boolean.valueOf((String) props.get(ALLOW_ANY_HOSTNAME)); if (allowAnyHostname) { setHostnameVerifier(new AllowAnyHostnameVerifier()); } super.setProperties(props); }
/** * Sets the control processor. * * @param processor control processor */ public void setControlProcessor(final ControlProcessor<C> processor) { checkImmutable(); logger.trace("setting controlProcessor: {}", processor); controlProcessor = processor; }