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

Examples of org.apache.directory.shared.ldap.model.message.AddRequestImpl


            "ObjectClass: person",
            "cn: userMinAge",
            "sn: userMinAge_sn",
            "userPassword: 12345");

        AddRequest addRequest = new AddRequestImpl();
        addRequest.setEntry( userEntry );
        addRequest.addControl( PP_REQ_CTRL );

        AddResponse addResp = connection.add( addRequest );
        assertEquals( ResultCodeEnum.SUCCESS, addResp.getLdapResult().getResultCode() );

        PasswordPolicy respCtrl = getPwdRespCtrl( addResp );
View Full Code Here


            "ObjectClass: person",
            "cn: userPwdHist",
            "sn: userPwdHist_sn",
            "userPassword: 12345" );

        AddRequest addRequest = new AddRequestImpl();
        addRequest.setEntry( userEntry );
        addRequest.addControl( PP_REQ_CTRL );

        connection.add( addRequest );
       
        Entry entry = connection.lookup( userDn, "*", "+" );
       
View Full Code Here

            "ObjectClass: person",
            "cn: userLen",
            "sn: userLen_sn",
            "userPassword: 1234");

        AddRequest addRequest = new AddRequestImpl();
        addRequest.setEntry( userEntry );
        addRequest.addControl( PP_REQ_CTRL );

        AddResponse addResp = connection.add( addRequest );
        assertEquals( ResultCodeEnum.CONSTRAINT_VIOLATION, addResp.getLdapResult().getResultCode() );

        PasswordPolicy respCtrl = getPwdRespCtrl( addResp );
View Full Code Here

            "ObjectClass: person",
            "cn: userMaxAge",
            "sn: userMaxAge_sn",
            "userPassword: " + password );

        AddRequest addRequest = new AddRequestImpl();
        addRequest.setEntry( userEntry );
        addRequest.addControl( PP_REQ_CTRL );

        connection.add( addRequest );

        BindRequest bindReq = new BindRequestImpl();
        bindReq.setDn( userDn );
View Full Code Here

            "cn: ppolicySubentry",
            "sn: ppolicySubentry_sn",
            "userPassword: " + password,
            "pwdPolicySubEntry:" + userDn.getName() );

        AddRequest addRequest = new AddRequestImpl();
        addRequest.setEntry( userEntry );
        addRequest.addControl( PP_REQ_CTRL );

        AddResponse addResp = connection.add( addRequest );
        assertEquals( ResultCodeEnum.SUCCESS, addResp.getLdapResult().getResultCode() );
       
        userEntry = connection.lookup( userDn, "*", "+" );
View Full Code Here

    /**
     * Inserts an entry into the DIT. Throws {@link EntryAlreadyExistsException} if an entry with given Dn already
     * exists. Throws {@link MissingParentException} if an ancestor of the entry is missing.
     */
    public void store(Entry entry) throws EntryAlreadyExistsException, MissingParentException {
        AddRequest addRequest = new AddRequestImpl().setEntry(entry);
        LdapResult result;
        try {
            result = connection.add(addRequest).getLdapResult();
        } catch (LdapException e) {
            throw new LdapDaoException(e);
View Full Code Here

            "ObjectClass: person",
            "cn: testAsyncAdd_cn",
            "sn: testAsyncAdd_sn" );

        assertFalse( session.exists( "cn=testAsyncAdd,ou=system" ) );
        AddRequest addRequest = new AddRequestImpl();
        addRequest.setEntry( entry );

        AddFuture addFuture = connection.addAsync( addRequest );

        AddResponse addResponse = addFuture.get( 1000, TimeUnit.MILLISECONDS );
View Full Code Here

            "ObjectClass : person",
            "cn: testadd_sn",
            "sn: testadd_sn"
            );
       
        AddRequest addRequest = new AddRequestImpl();
        addRequest.setEntry( entry );
        addRequest.addControl( new ManageDsaITImpl() );

        AddResponse response = connection.add( addRequest );

        assertNotNull( response );
        assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
View Full Code Here

        entry.add( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.PERSON_OC );
        entry.add( SchemaConstants.CN_AT, "testAsyncAdd_cn" );
        entry.add( SchemaConstants.SN_AT, "testAsyncAdd_sn" );

        assertFalse( session.exists( dn ) );
        AddRequest addRequest = new AddRequestImpl();
        addRequest.setEntry( entry );

        AddFuture addFuture = connection.addAsync( addRequest );

        AddResponse addResponse = addFuture.get( 1000, TimeUnit.MILLISECONDS );
View Full Code Here

    /**
     * Creates a new getDecoratedMessage() of AddRequestDsml.
     */
    public AddRequestDsml( LdapCodecService codec )
    {
        super( codec, new AddRequestImpl() );
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.model.message.AddRequestImpl

Copyright © 2018 www.massapicom. 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.