/** * {@inheritDoc} */ @Override public void modify( Dn dn, Modification... modifications ) throws LdapException { if ( dn == null ) { LOG.debug( "received a null dn for modification" ); throw new IllegalArgumentException( "The Dn to be modified cannot be null" ); } if ( ( modifications == null ) || ( modifications.length == 0 ) ) { String msg = "Cannot process a ModifyRequest without any modification"; LOG.debug( msg ); throw new IllegalArgumentException( msg ); } int newId = messageId.incrementAndGet(); ModifyRequest modifyRequest = new ModifyRequestImpl(); modifyRequest.setMessageId( newId ); modifyRequest.setName( dn ); for ( Modification modification : modifications ) { modifyRequest.addModification( modification ); } ModifyResponse modifyResponse = modify( modifyRequest ); processResponse( modifyResponse ); }
/** * {@inheritDoc} */ @Override public void modify( Entry entry, ModificationOperation modOp ) throws LdapException { if ( entry == null ) { LOG.debug( "received a null entry for modification" ); throw new IllegalArgumentException( "Entry to be modified cannot be null" ); } int newId = messageId.incrementAndGet(); ModifyRequest modifyRequest = new ModifyRequestImpl(); modifyRequest.setMessageId( newId ); modifyRequest.setName( entry.getDn() ); Iterator<Attribute> itr = entry.iterator(); while ( itr.hasNext() ) { modifyRequest.addModification( new DefaultModification( modOp, itr.next() ) ); } ModifyResponse modifyResponse = modify( modifyRequest ); processResponse( modifyResponse ); }
modRequest.setMessageId( newId );
modRequest.setMessageId( newId );
modRequest.setMessageId( newId );
/** * {@inheritDoc} */ @Override public void action( LdapMessageContainer<ModifyRequestDecorator> container ) { // Now, we can allocate the ModifyRequest Object ModifyRequest internalModifyRequest = new ModifyRequestImpl(); internalModifyRequest.setMessageId( container.getMessageId() ); ModifyRequestDecorator modifyRequestDecorator = new ModifyRequestDecorator( container.getLdapCodecService(), internalModifyRequest ); container.setMessage( modifyRequestDecorator ); } }
/** * {@inheritDoc} */ @Override public void action( LdapMessageContainer<ModifyRequestDecorator> container ) { // Now, we can allocate the ModifyRequest Object ModifyRequest internalModifyRequest = new ModifyRequestImpl(); internalModifyRequest.setMessageId( container.getMessageId() ); ModifyRequestDecorator modifyRequestDecorator = new ModifyRequestDecorator( container.getLdapCodecService(), internalModifyRequest ); container.setMessage( modifyRequestDecorator ); } }
/** * {@inheritDoc} */ @Override public void action( LdapMessageContainer<ModifyRequestDecorator> container ) { // Now, we can allocate the ModifyRequest Object ModifyRequest internalModifyRequest = new ModifyRequestImpl(); internalModifyRequest.setMessageId( container.getMessageId() ); ModifyRequestDecorator modifyRequestDecorator = new ModifyRequestDecorator( container.getLdapCodecService(), internalModifyRequest ); container.setMessage( modifyRequestDecorator ); } }
/** * {@inheritDoc} */ @Override public ModifyResponse modify( ModifyRequest modRequest ) throws LdapException { if ( modRequest == null ) { String msg = "Cannot process a null modifyRequest"; LOG.debug( msg ); throw new IllegalArgumentException( msg ); } int newId = messageId.incrementAndGet(); modRequest.setMessageId( newId ); ModifyResponse resp = new ModifyResponseImpl( newId ); resp.getLdapResult().setResultCode( ResultCodeEnum.SUCCESS ); try { session.modify( modRequest ); } catch ( LdapException e ) { LOG.warn( e.getMessage(), e ); resp.getLdapResult().setResultCode( ResultCodeEnum.getResultCode( e ) ); resp.getLdapResult().setDiagnosticMessage( e.getMessage() ); } addResponseControls( modRequest, resp ); return resp; }