private ReplicaEventLog getEventLog( OperationContext opCtx ) { Dn consumerLogDn = opCtx.getDn(); String name = ReplicaEventLog.REPLICA_EVENT_LOG_NAME_PREFIX + consumerLogDn.getRdn().getValue(); for ( ReplicaEventLog log : replicaLogMap.values() ) { if ( name.equalsIgnoreCase( log.getName() ) ) { return log; } } // end of for return null; }
/** * Check if the current operation has a valid PrincipalDN or not. * * @param operation the operation type * @throws Exception */ private void checkAuthenticated( OperationContext operation ) throws LdapException { if ( operation.getSession().isAnonymous() && !directoryService.isAllowAnonymousAccess() && !operation.getDn().isEmpty() ) { String msg = I18n.err( I18n.ERR_5, operation.getName() ); LOG.error( msg ); throw new LdapNoPermissionException( msg ); } }
modifications = getOperationalModsForRemove( opContext.getDn(), candidate ); break; LOG.debug( "The entry {} has been evaluated to true for subentry {}", candidate.getDn(), opContext.getDn() ); ModifyOperationContext modifyContext = new ModifyOperationContext( opContext.getSession(), candidateDn, modifications ); modifyContext.setPartition( opContext.getPartition() );
/** * Gets attributes required for modifications. * * @param dn the dn of the entry to get * @return the entry's attributes (may be immutable if the schema subentry) * @throws Exception on error accessing the entry's attributes */ private Entry getAttributes( OperationContext opContext ) throws LdapException { Dn dn = opContext.getDn(); Entry serverEntry; // @todo make sure we're not putting in operational attributes that cannot be user modified if ( dn.equals( ServerDNConstants.CN_SCHEMA_DN ) ) { return SchemaService.getSubschemaEntryCloned( directoryService ); } else { CoreSession session = opContext.getSession(); LookupOperationContext lookupContext = new LookupOperationContext( session, dn, SchemaConstants.ALL_ATTRIBUTES_ARRAY ); lookupContext.setPartition( opContext.getPartition() ); lookupContext.setTransaction( opContext.getTransaction() ); serverEntry = directoryService.getPartitionNexus().lookup( lookupContext ); } return serverEntry; } }