DirContext createContext(Hashtable<?, ?> env) throws NamingException { return new InitialLdapContext(env, null); } }
public void setQueueSearchBase(String queueSearchBase) { try { LdapName baseName = new LdapName(queueSearchBase); queuePrefixLength = baseName.size(); this.queueSearchBase = queueSearchBase; } catch (InvalidNameException e) { throw new IllegalArgumentException("Invalid base DN value " + queueSearchBase, e); } }
public boolean isAdminDN(String dn) { if(dn == null) return false; try { return isAdminDN(new LdapName(dn)); } catch (InvalidNameException e) { return false; } }
@Override protected void doConnect( String username, String password ) throws KettleException { super.doConnect( username, password ); StartTlsRequest tlsRequest = new StartTlsRequest(); try { this.startTlsResponse = (StartTlsResponse) getCtx().extendedOperation( tlsRequest ); /* Starting TLS */ this.startTlsResponse.negotiate( CustomSocketFactory.getDefault() ); } catch ( NamingException e ) { throw new KettleException( e ); } catch ( IOException e ) { throw new KettleException( e ); } }
public static PasswordPolicyResponseControl extractControl(DirContext dirCtx) { LdapContext ctx = (LdapContext) dirCtx; Control[] ctrls = null; try { ctrls = ctx.getResponseControls(); } catch (javax.naming.NamingException e) { logger.error("Failed to obtain response controls", e); } for (int i = 0; ctrls != null && i < ctrls.length; i++) { if (ctrls[i] instanceof PasswordPolicyResponseControl) { return (PasswordPolicyResponseControl) ctrls[i]; } } return null; }
@Override public void setRequestControls(Control[] requestControls) throws NamingException { if ( ! (delegating instanceof LdapContext)) throw Assert.unsupported(); ((LdapContext) delegating).setRequestControls(requestControls); }
@Override public ExtendedResponse extendedOperation(ExtendedRequest request) throws NamingException { if ( ! (delegating instanceof LdapContext)) throw Assert.unsupported(); return ((LdapContext) delegating).extendedOperation(request); }
@Override public void handleRecord(LdapAttributes attributes) { callbackAttributeName = attributes.getName().toString(); } }
@Override public Control[] getRequestControls() throws NamingException { if ( ! (delegating instanceof LdapContext)) throw Assert.unsupported(); return ((LdapContext) delegating).getRequestControls(); }
@Override public Control[] getConnectControls() throws NamingException { if ( ! (delegating instanceof LdapContext)) throw Assert.unsupported(); return ((LdapContext) delegating).getConnectControls(); }
javax.naming.ldap.Rdn.unescapeValue("\\b" + stringFormOfOutput)
public void setTopicSearchBase(String topicSearchBase) { try { LdapName baseName = new LdapName(topicSearchBase); topicPrefixLength = baseName.size(); this.topicSearchBase = topicSearchBase; } catch (InvalidNameException e) { throw new IllegalArgumentException("Invalid base DN value " + topicSearchBase, e); } }
/** * Creates and returns a new {@link javax.naming.ldap.InitialLdapContext} instance. This method exists primarily * to support testing where a mock LdapContext can be returned instead of actually creating a connection, but * subclasses are free to provide a different implementation if necessary. * * @param env the JNDI environment settings used to create the LDAP connection * @return an LdapConnection * @throws NamingException if a problem occurs creating the connection */ protected LdapContext createLdapContext(Hashtable env) throws NamingException { return new InitialLdapContext(env, null); }
@Override public Control[] getResponseControls() throws NamingException { if ( ! (delegating instanceof LdapContext)) throw Assert.unsupported(); return ((LdapContext) delegating).getResponseControls(); }
public void setTempSearchBase(String tempSearchBase) { try { LdapName baseName = new LdapName(tempSearchBase); tempPrefixLength = baseName.size(); this.tempSearchBase = tempSearchBase; } catch (InvalidNameException e) { throw new IllegalArgumentException("Invalid base DN value " + tempSearchBase, e); } }
/** * Creates and returns a new {@link javax.naming.ldap.InitialLdapContext} instance. This method exists primarily * to support testing where a mock LdapContext can be returned instead of actually creating a connection, but * subclasses are free to provide a different implementation if necessary. * * @param env the JNDI environment settings used to create the LDAP connection * @return an LdapConnection * @throws NamingException if a problem occurs creating the connection */ protected LdapContext createLdapContext(Hashtable env) throws NamingException { return new InitialLdapContext(env, null); }
protected InitialLdapContext createLdapContext( Hashtable<String, String> env ) throws NamingException { return new InitialLdapContext( env, null ); }
public LdapContext newInitialLdapContext(Hashtable<?,?> environment, Control[] connCtls) throws NamingException { ClassLoader previous = setSocketFactory(); try { return new InitialLdapContext(environment, null); } finally { unsetSocketFactory(previous); } }