Examples of removeFromEnvironment()


Examples of javax.naming.InitialContext.removeFromEnvironment()

   private Context createInitialContext(Hashtable env) throws NamingException
   {
      Context ctx1 = new InitialContext(env);
      if (ctx1.getEnvironment().get(NamingContext.JNP_DISCOVERY_GROUP) != null)
      {
         ctx1.removeFromEnvironment(Context.PROVIDER_URL);
      }
      return ctx1;
   }

   private void redeployNaming() throws Exception
View Full Code Here

Examples of javax.naming.directory.DirContext.removeFromEnvironment()

                    dnBuffer.append(ldapConn.getBaseDN());
                    Attributes attrs = entry.getAttributes();
                    first_name = getAttributeValue(attrs, ATTR_FIRSTNAME);
                    last_name = getAttributeValue(attrs, ATTR_LASTNAME);
                    // re-bind as user
                    conn.removeFromEnvironment(javax.naming.Context.SECURITY_PRINCIPAL);
                    conn.removeFromEnvironment(javax.naming.Context.SECURITY_CREDENTIALS);
                    conn.addToEnvironment(javax.naming.Context.SECURITY_PRINCIPAL, dnBuffer.toString());
                    conn.addToEnvironment(javax.naming.Context.SECURITY_CREDENTIALS, this.myOpaqueCredentials.credentialstring);
                    searchCtls = new SearchControls();
                    searchCtls.setReturningAttributes(new String[0]);
View Full Code Here

Examples of javax.naming.directory.DirContext.removeFromEnvironment()

                    Attributes attrs = entry.getAttributes();
                    first_name = getAttributeValue(attrs, ATTR_FIRSTNAME);
                    last_name = getAttributeValue(attrs, ATTR_LASTNAME);
                    // re-bind as user
                    conn.removeFromEnvironment(javax.naming.Context.SECURITY_PRINCIPAL);
                    conn.removeFromEnvironment(javax.naming.Context.SECURITY_CREDENTIALS);
                    conn.addToEnvironment(javax.naming.Context.SECURITY_PRINCIPAL, dnBuffer.toString());
                    conn.addToEnvironment(javax.naming.Context.SECURITY_CREDENTIALS, this.myOpaqueCredentials.credentialstring);
                    searchCtls = new SearchControls();
                    searchCtls.setReturningAttributes(new String[0]);
                    searchCtls.setSearchScope(SearchControls.OBJECT_SCOPE);
View Full Code Here

Examples of javax.naming.directory.DirContext.removeFromEnvironment()

                    dnBuffer.append(ldapConn.getBaseDN());
                    Attributes attrs = entry.getAttributes();
                    first_name = getAttributeValue(attrs, ATTR_FIRSTNAME);
                    last_name = getAttributeValue(attrs, ATTR_LASTNAME);
                    // re-bind as user
                    conn.removeFromEnvironment(javax.naming.Context.SECURITY_PRINCIPAL);
                    conn.removeFromEnvironment(javax.naming.Context.SECURITY_CREDENTIALS);
                    conn.addToEnvironment(javax.naming.Context.SECURITY_PRINCIPAL, dnBuffer.toString());
                    conn.addToEnvironment(javax.naming.Context.SECURITY_CREDENTIALS, this.myOpaqueCredentials.credentialstring);
                    searchCtls = new SearchControls();
                    searchCtls.setReturningAttributes(new String[0]);
View Full Code Here

Examples of javax.naming.directory.DirContext.removeFromEnvironment()

                    Attributes attrs = entry.getAttributes();
                    first_name = getAttributeValue(attrs, ATTR_FIRSTNAME);
                    last_name = getAttributeValue(attrs, ATTR_LASTNAME);
                    // re-bind as user
                    conn.removeFromEnvironment(javax.naming.Context.SECURITY_PRINCIPAL);
                    conn.removeFromEnvironment(javax.naming.Context.SECURITY_CREDENTIALS);
                    conn.addToEnvironment(javax.naming.Context.SECURITY_PRINCIPAL, dnBuffer.toString());
                    conn.addToEnvironment(javax.naming.Context.SECURITY_CREDENTIALS, this.myOpaqueCredentials.credentialstring);
                    searchCtls = new SearchControls();
                    searchCtls.setReturningAttributes(new String[0]);
                    searchCtls.setSearchScope(SearchControls.OBJECT_SCOPE);
View Full Code Here

Examples of javax.naming.directory.DirContext.removeFromEnvironment()

                                dnBuffer.append(ldapConn.getBaseDN());
                                Attributes attrs = entry.getAttributes();
                                first_name = getAttributeValue(attrs, ATTR_FIRSTNAME);
                                last_name = getAttributeValue(attrs, ATTR_LASTNAME);
                                // re-bind as user
                                conn.removeFromEnvironment(javax.naming.Context.SECURITY_PRINCIPAL);
                                conn.removeFromEnvironment(javax.naming.Context.SECURITY_CREDENTIALS);
                                conn.addToEnvironment(javax.naming.Context.SECURITY_PRINCIPAL, dnBuffer.toString());
                                conn.addToEnvironment(javax.naming.Context.SECURITY_CREDENTIALS, this.myOpaqueCredentials.credentialstring);
                                searchCtls = new SearchControls();
                                searchCtls.setReturningAttributes(new String[0]);
View Full Code Here

Examples of javax.naming.directory.DirContext.removeFromEnvironment()

                                Attributes attrs = entry.getAttributes();
                                first_name = getAttributeValue(attrs, ATTR_FIRSTNAME);
                                last_name = getAttributeValue(attrs, ATTR_LASTNAME);
                                // re-bind as user
                                conn.removeFromEnvironment(javax.naming.Context.SECURITY_PRINCIPAL);
                                conn.removeFromEnvironment(javax.naming.Context.SECURITY_CREDENTIALS);
                                conn.addToEnvironment(javax.naming.Context.SECURITY_PRINCIPAL, dnBuffer.toString());
                                conn.addToEnvironment(javax.naming.Context.SECURITY_CREDENTIALS, this.myOpaqueCredentials.credentialstring);
                                searchCtls = new SearchControls();
                                searchCtls.setReturningAttributes(new String[0]);
                                searchCtls.setSearchScope(SearchControls.OBJECT_SCOPE);
View Full Code Here

Examples of javax.naming.ldap.LdapContext.removeFromEnvironment()

            attrs.put( attr );

            sysRoot.createSubcontext( "ou=uzerz,ou=groups", attrs );
            sysRoot.addToEnvironment( "java.naming.ldap.deleteRDN", "false" );
            sysRoot.rename( "ou=users", "ou=uzerz,ou=groups" );
            sysRoot.removeFromEnvironment( "java.naming.ldap.deleteRDN" );
            fail( "Execution should never get here due to exception!" );
        }
        catch ( LdapNameAlreadyBoundException e )
        {
            assertEquals( "ou=uzerz,ou=groups,ou=system", e.getResolvedName().toString() );
View Full Code Here

Examples of javax.naming.ldap.LdapContext.removeFromEnvironment()

        try
        {
            sysRoot.addToEnvironment( "java.naming.ldap.deleteRDN", "false" );
            sysRoot.rename( "ou=blah", "ou=blah2,ou=groups" );
            sysRoot.removeFromEnvironment( "java.naming.ldap.deleteRDN" );
            fail( "Execution should never get here due to exception!" );
        }
        catch ( LdapNameNotFoundException e )
        {
            assertEquals( "ou=system", e.getResolvedName().toString() );
View Full Code Here

Examples of javax.naming.ldap.LdapContext.removeFromEnvironment()

        template.executeReadWrite(new ContextExecutor() {

            public Object executeWithContext(DirContext dirCtx) throws NamingException {
                LdapContext ctx = (LdapContext) dirCtx;
                ctx.removeFromEnvironment("com.sun.jndi.ldap.connect.pool");
                ctx.addToEnvironment(Context.SECURITY_PRINCIPAL, LdapUtils.getFullDn(dn, ctx).toString());
                ctx.addToEnvironment(Context.SECURITY_CREDENTIALS, oldPassword);
                // TODO: reconnect doesn't appear to actually change the credentials
                try {
                    ctx.reconnect(null);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.