Package org.apache.directory.api.ldap.model.message

Examples of org.apache.directory.api.ldap.model.message.ModifyRequest.replace()


        X509Certificate cert = certGen.generate( privateKey, "BC" );

        // Write the modifications
        ModifyRequest request = new ModifyRequestImpl();
        request.setName( dn );
        request.replace( PRIVATE_KEY_AT, privateKey.getEncoded() );
        request.replace( PRIVATE_KEY_FORMAT_AT, privateKey.getFormat() );
        request.replace( PUBLIC_KEY_AT, publicKey.getEncoded() );
        request.replace( PUBLIC_KEY_FORMAT_AT, publicKey.getFormat() );
        request.replace( USER_CERTIFICATE_AT, cert.getEncoded() );
        ldapServer.getDirectoryService().getAdminSession().modify( dn, modifications );
View Full Code Here


        // Write the modifications
        ModifyRequest request = new ModifyRequestImpl();
        request.setName( dn );
        request.replace( PRIVATE_KEY_AT, privateKey.getEncoded() );
        request.replace( PRIVATE_KEY_FORMAT_AT, privateKey.getFormat() );
        request.replace( PUBLIC_KEY_AT, publicKey.getEncoded() );
        request.replace( PUBLIC_KEY_FORMAT_AT, publicKey.getFormat() );
        request.replace( USER_CERTIFICATE_AT, cert.getEncoded() );
        ldapServer.getDirectoryService().getAdminSession().modify( dn, modifications );
View Full Code Here

        // Write the modifications
        ModifyRequest request = new ModifyRequestImpl();
        request.setName( dn );
        request.replace( PRIVATE_KEY_AT, privateKey.getEncoded() );
        request.replace( PRIVATE_KEY_FORMAT_AT, privateKey.getFormat() );
        request.replace( PUBLIC_KEY_AT, publicKey.getEncoded() );
        request.replace( PUBLIC_KEY_FORMAT_AT, publicKey.getFormat() );
        request.replace( USER_CERTIFICATE_AT, cert.getEncoded() );
        ldapServer.getDirectoryService().getAdminSession().modify( dn, modifications );

        // TODO: activate when DIRSERVER-1373 is fixed
View Full Code Here

        ModifyRequest request = new ModifyRequestImpl();
        request.setName( dn );
        request.replace( PRIVATE_KEY_AT, privateKey.getEncoded() );
        request.replace( PRIVATE_KEY_FORMAT_AT, privateKey.getFormat() );
        request.replace( PUBLIC_KEY_AT, publicKey.getEncoded() );
        request.replace( PUBLIC_KEY_FORMAT_AT, publicKey.getFormat() );
        request.replace( USER_CERTIFICATE_AT, cert.getEncoded() );
        ldapServer.getDirectoryService().getAdminSession().modify( dn, modifications );

        // TODO: activate when DIRSERVER-1373 is fixed
        //ldapService.reloadSslContext();
View Full Code Here

        request.setName( dn );
        request.replace( PRIVATE_KEY_AT, privateKey.getEncoded() );
        request.replace( PRIVATE_KEY_FORMAT_AT, privateKey.getFormat() );
        request.replace( PUBLIC_KEY_AT, publicKey.getEncoded() );
        request.replace( PUBLIC_KEY_FORMAT_AT, publicKey.getFormat() );
        request.replace( USER_CERTIFICATE_AT, cert.getEncoded() );
        ldapServer.getDirectoryService().getAdminSession().modify( dn, modifications );

        // TODO: activate when DIRSERVER-1373 is fixed
        //ldapService.reloadSslContext();
        //ldapsService.reloadSslContext();
View Full Code Here

        assertEquals( "", srEditorBot.getContent( 1, 4 ) );

        // add description
        ModifyRequest request = new ModifyRequestImpl();
        request.setName( new Dn( "uid=admin,ou=system" ) );
        request.replace( "description", "The 1st description." );
        ldapServer.getDirectoryService().getAdminSession().modify( request );

        // refresh the search, using the toolbar icon
        srEditorBot.refresh();
        SWTUtils.sleep( 1000 );
View Full Code Here

    ldapServer.setSaslPrincipal(servicePrincipalName);

    if (serviceEntryDn != null) {
      final ModifyRequest modifyRequest = new ModifyRequestImpl();
      modifyRequest.setName(serviceEntryDn);
      modifyRequest.replace("userPassword", "randall");
      modifyRequest.replace("krb5PrincipalName", servicePrincipalName);
      ldapServer.getDirectoryService().getAdminSession()
      .modify(modifyRequest);
    }
View Full Code Here

    if (serviceEntryDn != null) {
      final ModifyRequest modifyRequest = new ModifyRequestImpl();
      modifyRequest.setName(serviceEntryDn);
      modifyRequest.replace("userPassword", "randall");
      modifyRequest.replace("krb5PrincipalName", servicePrincipalName);
      ldapServer.getDirectoryService().getAdminSession()
      .modify(modifyRequest);
    }

    return servicePrincipalName;
View Full Code Here

        LdapConnection connection = new LdapNetworkConnection( "localhost", 9999 );
        connection.bind( "uid=admin,ou=system", "secret");
        Dn adminDn = new Dn( "uid=admin,ou=system" );
        ModifyRequest modReq = new ModifyRequestImpl();
        modReq.setName( adminDn );
        modReq.replace( SchemaConstants.USER_PASSWORD_AT, NEW_CONNECTION_PASSWORD );
        connection.modify( modReq );
        connection.close();
       
        // check that we actually changed the admin connection password
        connection = new LdapNetworkConnection( "localhost", 9999 );
View Full Code Here

        String servicePrincipal = "ldap/" + hostName + "@EXAMPLE.COM";
        getLdapServer().setSaslPrincipal( servicePrincipal );

        ModifyRequest modifyRequest = new ModifyRequestImpl();
        modifyRequest.setName( new Dn( "uid=ldap,ou=users,dc=example,dc=com" ) );
        modifyRequest.replace( "userPassword", "randall" );
        modifyRequest.replace( "krb5PrincipalName", servicePrincipal );
        getService().getAdminSession().modify( modifyRequest );
    }

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.