/** * {@inheritDoc} */ @Override public LookupOperationContext newLookupContext( Dn dn, String... attributes ) { LookupOperationContext lookupContext = new LookupOperationContext( session, dn, attributes ); setup( lookupContext ); return lookupContext; }
/** * Creates a new instance of LookupOperationContext. * * @param session The session to use * @param dn The Dn * @param returningAttributes The attributes to return */ public FilteringOperationContext( CoreSession session, Dn dn, String... returningAttributes ) { super( session, dn ); setReturningAttributes( returningAttributes ); }
/** * Checks whether or not the ManageDsaITControl is present. If not * present then the filter is modified to force the return of all referral * entries regardless of whether or not the filter matches the referral * entry. * * @return <tt>true</tt> if the ManageDSAIt control is present */ public boolean hasManageDsaItControl() { return super.hasRequestControl( ManageDsaIT.OID ); }
@Override public void entryAdded( AddOperationContext addContext ) { Entry entry = addContext.getEntry(); updatePasswordPolicy( entry, false ); }
/** * @see Object#toString() */ public String toString() { return "DeleteContext for Dn '" + getDn().getName() + "'"; }
/** * Returns {@link LdapPrincipal} of current context. * * @param opContext TODO * @return the authenticated principal */ public static LdapPrincipal getPrincipal( OperationContext opContext ) { return opContext.getSession().getEffectivePrincipal(); }
@Override public void entryModified( ModifyOperationContext modifyContext ) { Entry entry = modifyContext.getAlteredEntry(); updatePasswordPolicy( entry, false ); }
/** * {@inheritDoc} */ @Override public void delete( Dn dn ) throws LdapException { DeleteOperationContext deleteContext = new DeleteOperationContext( session, dn ); setup( deleteContext ); session.getDirectoryService().getOperationManager().delete( deleteContext ); }
/** * {@inheritDoc} */ @Override public boolean accept( SearchOperationContext searchOperationContext, Entry entry ) throws LdapException { // Add the nbChildren/nbSubordinates attributes if required processSubordinates( searchOperationContext, searchOperationContext.getReturningAttributes(), searchOperationContext.isAllOperationalAttributes(), entry ); return true; }
/** * Set the ignoreRefferal flag for the current operationContext. * * @param opContext The current operationContext * @param ignoreReferral The flag */ private void setReferralHandling( AbstractOperationContext opContext, boolean ignoreReferral ) { if ( ignoreReferral ) { opContext.ignoreReferral(); } else { opContext.throwReferral(); } }
/** * Creates a new instance of AbstractOperationContext. * * @param session The session to use * @param dn The associated Dn */ public AbstractOperationContext( CoreSession session, Dn dn ) { this.dn = dn; this.session = session; // The flag is set to ignore, so that the revert operation can act on // the entries, even if they are referrals. ignoreReferral(); }
/** * @see Object#toString() */ public String toString() { return "SearchContext for Dn '" + getDn().getName() + "', filter :'" + filter + "'"; } }
/** * @see Object#toString() */ public String toString() { return "UnbindContext for Dn '" + getDn().getName() + "'"; } }
public boolean isAbandoned() { return searchContext.isAbandoned(); }
private void setup( AbstractOperationContext opContext ) { opContext.setAuthorizedPrincipal( authorizedPrincipal ); }
/** * {@inheritDoc} */ @Override public boolean accept( SearchOperationContext operation, Entry entry ) throws LdapException { if ( operation.getReturningAttributesString() == null ) { return true; } // Denormalize the operational Attributes denormalizeEntryOpAttrs( entry ); return true; }
/** * Extracts response controls from a an OperationContext to populate into * a Response object. * * @param opContext the context to extract controls from * @param response the response to populate with response controls */ public static void setResponseControls( OperationContext opContext, Response response ) { response.addAllControls( opContext.getResponseControls() ); }
/** * @see Object#toString() */ public String toString() { return "GetRootDseContext with Dn '" + getDn().getName() + "'"; } }
/** * Creates a new instance of LookupOperationContext. * * @param session The session to use * @param returningAttributes The attributes to return */ public FilteringOperationContext( CoreSession session, String... returningAttributes ) { super( session ); setReturningAttributes( returningAttributes ); }
public boolean isAbandoned() { return operationContext.isAbandoned(); }