/** * {@inheritDoc} */ @Override public boolean compare( CompareRequest compareRequest ) throws LdapException { CompareOperationContext compareContext = new CompareOperationContext( this, compareRequest ); OperationManager operationManager = directoryService.getOperationManager(); boolean result = false; try { result = operationManager.compare( compareContext ); } catch ( LdapException e ) { compareRequest.getResultResponse().addAllControls( compareContext.getResponseControls() ); throw e; } compareRequest.getResultResponse().addAllControls( compareContext.getResponseControls() ); return result; }
public boolean compare( CompareOperationContext compareContext ) throws LdapException Attribute attr = compareContext.getOriginalEntry().get( compareContext.getAttributeType() ); if ( attr.contains( compareContext.getValue() ) ) Value reqVal = compareContext.getValue();
/** * 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(); } }
/** * {@inheritDoc} */ @Override public boolean compare( Dn dn, String oid, Object value ) throws LdapException { OperationManager operationManager = directoryService.getOperationManager(); return operationManager.compare( new CompareOperationContext( this, dn, oid, convertToValue( oid, value ) ) ); }
CompareOperationContext opCtx = new CompareOperationContext( getSession(), name, oid, val ); opCtx.addRequestControls( JndiUtils.fromJndiControls( getDirectoryService().getLdapCodecService(), requestControls ) );
/** * Creates a new instance of CompareOperationContext. * * @param session The session to use */ public CompareOperationContext( CoreSession session ) { super( session ); if ( session != null ) { setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.COMPARE ) ); } }
/** * @see Object#toString() */ public String toString() { return "CompareContext for Dn '" + getDn().getName() + "'" + ( ( oid != null ) ? ", oid : <" + oid + ">" : "" ) + ( ( value != null ) ? ", value :'" + ( ( value.isHumanReadable() ) ? value.getValue() : ( ( !value.isHumanReadable() ) ? Strings.dumpBytes( value.getBytes() ) : "unknown value type" ) ) + "'" : "" ); } }
/** * {@inheritDoc} */ @Override public boolean compare( Dn dn, String oid, Object value, boolean ignoreReferral ) throws LdapException { CompareOperationContext compareContext = new CompareOperationContext( this, dn, oid, convertToValue( oid, value ) ); setReferralHandling( compareContext, ignoreReferral ); OperationManager operationManager = directoryService.getOperationManager(); return operationManager.compare( compareContext ); }
/** * Creates a new instance of CompareOperationContext. * * @param session The session to use * @param dn The Dn of teh entry to compare with */ public CompareOperationContext( CoreSession session, Dn dn ) { super( session, dn ); if ( session != null ) { setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.COMPARE ) ); } }
&& ( filter instanceof EqualityNode ) ) CompareOperationContext compareContext = new CompareOperationContext( session, dn, ( ( EqualityNode<?> ) filter ).getAttribute(), ( ( EqualityNode ) filter ).getValue() );
/** * Creates a new instance of LookupOperationContext. * * @param session The session to use * @param oid The entry's Oid */ public CompareOperationContext( CoreSession session, String oid ) { super( session ); this.oid = oid; if ( session != null ) { setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.COMPARE ) ); } }
/** * Creates a new instance of LookupOperationContext. * * @param session The session to use * @param dn The entry's Dn * @param oid The entry's Oid */ public CompareOperationContext( CoreSession session, Dn dn, String oid ) { super( session, dn ); this.oid = oid; if ( session != null ) { setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.COMPARE ) ); } }
/** * Creates a new instance of LookupOperationContext. * * @param session The session to use * @param dn The entry's Dn * @param oid The entry's Oid * @param value The value to compare */ public CompareOperationContext( CoreSession session, Dn dn, String oid, Value value ) { super( session, dn ); this.oid = oid; this.value = value; if ( session != null ) { setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.COMPARE ) ); } }