Package org.apache.directory.server.core.entry

Examples of org.apache.directory.server.core.entry.ClonedServerEntry$EmptyEntry



    public AddOperationContext( CoreSession session, InternalAddRequest addRequest ) throws Exception
    {
        super( session );
        entry = new ClonedServerEntry(
            new DefaultServerEntry( session.getDirectoryService().getSchemaManager(), addRequest.getEntry() ) );
        dn = addRequest.getEntry().getDn();
        requestControls = addRequest.getControls();
       
        if ( requestControls.containsKey( ManageDsaITControl.CONTROL_OID ) )
View Full Code Here


    {
        DN oriChildName = moveContext.getDn();
        DN newParentName = moveContext.getParent();
       
        // Access the principal requesting the operation, and bypass checks if it is the admin
        ClonedServerEntry entry = moveContext.lookup( oriChildName, ByPassConstants.LOOKUP_BYPASS );
      
        DN newName = ( DN ) newParentName.clone();
        newName.add( oriChildName.get( oriChildName.size() - 1 ) );
        LdapPrincipal principal = moveContext.getSession().getEffectivePrincipal();
        DN principalDn = principal.getClonedName();

        // bypass authz code if we are disabled
        if ( !moveContext.getSession().getDirectoryService().isAccessControlEnabled() )
        {
            next.move( moveContext );
            return;
        }

        protectCriticalEntries( oriChildName);

        // bypass authz code but manage caches if operation is performed by the admin
        if ( isPrincipalAnAdministrator( principalDn ) )
        {
            next.move( moveContext );
            tupleCache.subentryRenamed( oriChildName, newName );
            groupCache.groupRenamed( oriChildName, newName );
            return;
        }

        Set<DN> userGroups = groupCache.getGroups( principalDn.getNormName() );
        Collection<ACITuple> tuples = new HashSet<ACITuple>();
        addPerscriptiveAciTuples( moveContext, tuples, oriChildName, entry.getOriginalEntry() );
        addEntryAciTuples( tuples, entry );
        addSubentryAciTuples( moveContext, tuples, oriChildName, entry );

        engine.checkPermission( schemaManager, moveContext, userGroups, principalDn,
            principal.getAuthenticationLevel(), oriChildName, null,
View Full Code Here

    {
        DN name = opContext.getDn();
        String oid = opContext.getOid();
        Value<?> value = ( Value<?> ) opContext.getValue();

        ClonedServerEntry entry = opContext.lookup( name, ByPassConstants.LOOKUP_BYPASS );

        LdapPrincipal principal = opContext.getSession().getEffectivePrincipal();
        DN principalDn = principal.getClonedName();

        if ( isPrincipalAnAdministrator( principalDn ) || !opContext.getSession().getDirectoryService().isAccessControlEnabled() )
        {
            return next.compare( opContext );
        }

        Set<DN> userGroups = groupCache.getGroups( principalDn.toNormName() );
        Collection<ACITuple> tuples = new HashSet<ACITuple>();
        addPerscriptiveAciTuples( opContext, tuples, name, entry.getOriginalEntry() );
        addEntryAciTuples( tuples, entry );
        addSubentryAciTuples( opContext, tuples, name, entry );

        engine.checkPermission( schemaManager, opContext, userGroups, principalDn,
            principal.getAuthenticationLevel(), name, null, null,
View Full Code Here

        {
            return next.getMatchedName( opContext );
        }

        // get the present matched name
        ClonedServerEntry entry;
        DN matched = next.getMatchedName( opContext );

        // check if we have disclose on error permission for the entry at the matched dn
        // if not remove rdn and check that until nothing is left in the name and return
        // that but if permission is granted then short the process and return the dn
        while ( matched.size() > 0 )
        {
            entry = opContext.lookup( matched, ByPassConstants.GETMATCHEDDN_BYPASS );
           
            Set<DN> userGroups = groupCache.getGroups( principalDn.getNormName() );
            Collection<ACITuple> tuples = new HashSet<ACITuple>();
            addPerscriptiveAciTuples( opContext, tuples, matched, entry.getOriginalEntry() );
            addEntryAciTuples( tuples, entry );
            addSubentryAciTuples( opContext, tuples, matched, entry );

            if ( engine.hasPermission( schemaManager, opContext, userGroups, principalDn,
                principal.getAuthenticationLevel(), matched, null,
View Full Code Here

       
        if ( ! notAnAlias )
        {
            // We don't know if the parent is an alias or not, so we will launch a
            // lookup, and update the cache if it's not an alias
            ClonedServerEntry attrs;
           
            try
            {
                attrs = opContext.lookup( parentDn, ByPassConstants.LOOKUP_BYPASS );
            }
            catch ( Exception e )
            {
                LdapNameNotFoundException e2 = new LdapNameNotFoundException( I18n.err( I18n.ERR_251,
                    parentDn.getName() ) );
                e2.setResolvedName( new DN( nexus.getMatchedName(
                    new GetMatchedNameOperationContext( opContext.getSession(), parentDn ) ).getName() ) );
                throw e2;
            }
           
            EntryAttribute objectClass = attrs.getOriginalEntry().get( SchemaConstants.OBJECT_CLASS_AT );
           
            if ( objectClass.contains( SchemaConstants.ALIAS_OC ) )
            {
                String msg = I18n.err( I18n.ERR_252, name.getName() );
                ResultCodeEnum rc = ResultCodeEnum.ALIAS_PROBLEM;
View Full Code Here

           
            EntryFilteringCursor results = nexus.search( searchOperationContext );
           
            while ( results.next() )
            {
                ClonedServerEntry resultEntry = results.get();
                DN subentryDn = resultEntry.getDn();
                EntryAttribute triggerSpec = resultEntry.get( PRESCRIPTIVE_TRIGGER_ATTR );
               
                if ( triggerSpec == null )
                {
                    LOG.warn( "Found triggerExecutionSubentry '" + subentryDn + "' without any " + PRESCRIPTIVE_TRIGGER_ATTR );
                    continue;
View Full Code Here

    }


    public void modify( NextInterceptor next, final ModifyOperationContext opContext ) throws Exception
    {
        ClonedServerEntry oriEntry = opContext.lookup( opContext.getDn(), ByPassConstants.LOOKUP_BYPASS );
        List<RegistrationEntry> selecting = getSelectingRegistrations( opContext.getDn(), oriEntry );
       
        next.modify( opContext );

        if ( selecting.isEmpty() )
        {
            return;
        }

        // Get the modified entry
        ClonedServerEntry alteredEntry = opContext.lookup( opContext.getDn(), ByPassConstants.LOOKUP_BYPASS );
        opContext.setAlteredEntry( alteredEntry );

        for ( final RegistrationEntry registration : selecting )
        {
            if ( EventType.isModify( registration.getCriteria().getEventMask() ) )
View Full Code Here

    }


    public void rename( NextInterceptor next, RenameOperationContext opContext ) throws Exception
    {
        ClonedServerEntry oriEntry = opContext.lookup( opContext.getDn(), ByPassConstants.LOOKUP_BYPASS );
        List<RegistrationEntry> selecting = getSelectingRegistrations( opContext.getDn(), oriEntry );
       
        next.rename( opContext );

        if ( selecting.isEmpty() )
        {
            return;
        }

        // Get the modifed entry
        ClonedServerEntry alteredEntry = opContext.lookup( opContext.getNewDn(), ByPassConstants.LOOKUP_BYPASS );
        opContext.setAlteredEntry( alteredEntry );
       
        for ( final RegistrationEntry registration : selecting )
        {
            if ( EventType.isRename( registration.getCriteria().getEventMask() ) )
View Full Code Here

    }


    public void moveAndRename( NextInterceptor next, final MoveAndRenameOperationContext opContext ) throws Exception
    {
        ClonedServerEntry oriEntry = opContext.lookup( opContext.getDn(), ByPassConstants.LOOKUP_BYPASS );
        List<RegistrationEntry> selecting = getSelectingRegistrations( opContext.getDn(), oriEntry );
        next.moveAndRename( opContext );

        if ( selecting.isEmpty() )
        {
View Full Code Here

    }


    public void move( NextInterceptor next, MoveOperationContext opContext ) throws Exception
    {
        ClonedServerEntry oriEntry = opContext.lookup( opContext.getDn(), ByPassConstants.LOOKUP_BYPASS );
        List<RegistrationEntry> selecting = getSelectingRegistrations( opContext.getDn(), oriEntry );
       
        next.move( opContext );

        if ( selecting.isEmpty() )
View Full Code Here

TOP

Related Classes of org.apache.directory.server.core.entry.ClonedServerEntry$EmptyEntry

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.