/** * {@inheritDoc} */ @Override public Dn getName() { return getDecorated().getName(); }
/** * {@inheritDoc} */ @Override public boolean compare( Dn dn, String attributeName, byte[] value ) throws LdapException { CompareRequest compareRequest = new CompareRequestImpl(); compareRequest.setName( dn ); compareRequest.setAttributeId( attributeName ); compareRequest.setAssertionValue( value ); CompareResponse compareResponse = compare( compareRequest ); return processResponse( compareResponse ); }
/** * {@inheritDoc} */ @Override public Value getAssertionValue() { return getDecorated().getAssertionValue(); }
CompareResponseImpl response = new CompareResponseImpl( compareRequest.getMessageId() ); compareRequest.getName(), null ); compareRequest.setAttributeId( type ); LOG.debug( I18n.msg( I18n.MSG_05122_COMPARING_ATTRIBUTE_DESCRIPTION, compareRequest.getAttributeId() ) );
/** * {@inheritDoc} */ @Override public Element toDsml( Element root ) { Element element = super.toDsml( root ); CompareRequest request = getDecorated(); // Dn if ( request.getName() != null ) { element.addAttribute( "dn", request.getName().getName() ); } // Assertion Element assertionElement = element.addElement( "assertion" ); if ( request.getAttributeId() != null ) { assertionElement.addAttribute( "name", request.getAttributeId() ); } if ( request.getAssertionValue() != null ) { assertionElement.addElement( "value" ).setText( request.getAssertionValue().getValue() ); } return element; }
compareRequest.setAssertionValue( "" ); if ( container.isBinary( compareRequest.getAttributeId() ) ) compareRequest.setAssertionValue( tlv.getValue().getData() ); Strings.dumpBytes( compareRequest.getAssertionValue().getBytes() ) ) ); compareRequest.setAssertionValue( Strings.utf8ToString( tlv.getValue().getData() ) ); LOG.debug( I18n.msg( I18n.MSG_05121_COMPARING_ATTRIBUTE_VALUE, compareRequest.getAssertionValue() ) );
/** * Creates a new instance of LookupOperationContext. * * @param session The session to use * @param compareRequest The Compare operation to process */ public CompareOperationContext( CoreSession session, CompareRequest compareRequest ) { super( session, compareRequest.getName() ); this.oid = compareRequest.getAttributeId(); this.value = compareRequest.getAssertionValue(); this.requestControls = compareRequest.getControls(); if ( session != null ) { setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.COMPARE ) ); } if ( requestControls.containsKey( ManageDsaIT.OID ) ) { ignoreReferral(); } else { throwReferral(); } }
compareRequest.setName( new Dn( dn ) ); compareRequest.setAttributeId( attribute.getId() ); compareRequest.setAssertionValue( attribute.getString() ); compareRequest.addControl( proxiedAuthzControl ); CompareResponse response = connection.compare( compareRequest ); return response.getLdapResult().getResultCode() == ResultCodeEnum.SUCCESS;
if ( compareRequest.getName() == null ) compareRequest.setMessageId( newId );
/** * {@inheritDoc} */ @Override public CompareRequest setAssertionValue( byte[] value ) { getDecorated().setAssertionValue( value ); return this; }
LOG.error( I18n.err( I18n.ERR_05114_ERROR_MESSAGE, msg, ine.getMessage() ) ); CompareResponseImpl response = new CompareResponseImpl( compareRequest.getMessageId() ); throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALID_DN_SYNTAX, Dn.EMPTY_DN, ine ); compareRequest.setName( entry );
/** * Set the attribute description * * @param attributeDesc The attributeDesc to set. */ public void setAttributeDesc( String attributeDesc ) { getDecorated().setAttributeId( attributeDesc ); }
/** * Set the entry to be compared * * @param entry The entry to set. */ @Override public CompareRequest setName( Dn entry ) { getDecorated().setName( entry ); return this; }
/** * {@inheritDoc} */ public void handle( LdapSession session, CompareRequest req ) { LOG.debug( "Handling compare request while ignoring referrals: {}", req ); LdapResult result = req.getResultResponse().getLdapResult(); try { if ( session.getCoreSession().compare( req ) ) { result.setResultCode( ResultCodeEnum.COMPARE_TRUE ); } else { result.setResultCode( ResultCodeEnum.COMPARE_FALSE ); } result.setMatchedDn( req.getName() ); session.getIoSession().write( req.getResultResponse() ); } catch ( Exception e ) { handleException( session, req, e ); } } }
/** * Get the attribute description * * @return Returns the attributeDesc. */ public String getAttributeDesc() { return getDecorated().getAttributeId(); }
/** * {@inheritDoc} */ @Override public void action( LdapMessageContainer<CompareRequestDecorator> container ) { // Now, we can allocate the CompareRequest Object CompareRequest internalCompareRequest = new CompareRequestImpl(); internalCompareRequest.setMessageId( container.getMessageId() ); CompareRequestDecorator compareRequest = new CompareRequestDecorator( container.getLdapCodecService(), internalCompareRequest ); container.setMessage( compareRequest ); if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_05120_COMPARE_REQUEST ) ); } } }
abandon( compareRequest.getMessageId() );
CompareResponseImpl response = new CompareResponseImpl( compareRequest.getMessageId() ); compareRequest.getName(), null ); compareRequest.setAttributeId( type ); LOG.debug( I18n.msg( I18n.MSG_05122_COMPARING_ATTRIBUTE_DESCRIPTION, compareRequest.getAttributeId() ) );
Dn reqName = req.getName(); String reqId = req.getAttributeId(); Value reqVal = req.getAssertionValue();
compareRequest.setAssertionValue( "" ); if ( container.isBinary( compareRequest.getAttributeId() ) ) compareRequest.setAssertionValue( tlv.getValue().getData() ); Strings.dumpBytes( compareRequest.getAssertionValue().getBytes() ) ) ); compareRequest.setAssertionValue( Strings.utf8ToString( tlv.getValue().getData() ) ); LOG.debug( I18n.msg( I18n.MSG_05121_COMPARING_ATTRIBUTE_VALUE, compareRequest.getAssertionValue() ) );