private Entry getDeletedEntry( OperationContext opContext ) throws LdapException { /** * Using LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS here to exclude operational attributes * especially subentry related ones like "triggerExecutionSubentries". */ CoreSession session = opContext.getSession(); LookupOperationContext lookupContext = new LookupOperationContext( session, deletedEntryName, SchemaConstants.ALL_USER_ATTRIBUTES_ARRAY ); lookupContext.setPartition( opContext.getPartition() ); lookupContext.setTransaction( opContext.getTransaction() ); return session.getDirectoryService().getPartitionNexus().lookup( lookupContext ); } }
private Entry getEntry( OperationContext opContext ) throws LdapException { /** * Exclude operational attributes while doing lookup * especially subentry related ones like "triggerExecutionSubentries". */ CoreSession session = opContext.getSession(); LookupOperationContext lookupContext = new LookupOperationContext( session, modifiedEntryName, SchemaConstants.ALL_USER_ATTRIBUTES_ARRAY ); lookupContext.setPartition( opContext.getPartition() ); lookupContext.setTransaction( opContext.getTransaction() ); return session.getDirectoryService().getPartitionNexus().lookup( lookupContext ); } }
@Override public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapException { Generic_LDAP_CONTEXT ldapCtxParam = ( Generic_LDAP_CONTEXT ) param; Dn ldapCtxName = ldapCtxParam.getCtxName(); CoreSession session = opContext.getSession(); LookupOperationContext lookupContext = new LookupOperationContext( session, ldapCtxName, SchemaConstants.ALL_ATTRIBUTES_ARRAY ); lookupContext.setPartition( opContext.getPartition() ); lookupContext.setTransaction( opContext.getTransaction() ); return session.getDirectoryService().getPartitionNexus().lookup( lookupContext ); } };
KerberosAttribute.KRB5_PRINCIPAL_NAME_AT, KerberosAttribute.KRB5_KEY_VERSION_NUMBER_AT ); lookupContext.setPartition( modContext.getPartition() ); lookupContext.setTransaction( modContext.getTransaction() );
public static Entry getSubschemaEntryCloned( DirectoryService directoryService ) throws LdapException { if ( schemaSubentry == null ) { Dn schemaModificationAttributesDn = new Dn( directoryService.getSchemaManager(), SchemaConstants.SCHEMA_MODIFICATIONS_DN ); Partition partition = directoryService.getSchemaPartition(); LookupOperationContext lookupContext = new LookupOperationContext( null, schemaModificationAttributesDn ); lookupContext.setPartition( partition ); try ( PartitionTxn partitionTxn = partition.beginReadTransaction() ) { lookupContext.setTransaction( partitionTxn ); generateSchemaSubentry( directoryService.getSchemaManager(), directoryService.getSchemaPartition().lookup( lookupContext ) ); } catch ( IOException ioe ) { throw new LdapOtherException( ioe.getMessage(), ioe ); } } return schemaSubentry.clone(); }
lookupContext.setPartition( partition );
/** * Get the administrativePoint role */ private void checkAdministrativeRole( OperationContext opContext, Dn apDn ) throws LdapException { CoreSession session = opContext.getSession(); LookupOperationContext lookupContext = new LookupOperationContext( session, apDn, SchemaConstants.ALL_ATTRIBUTES_ARRAY ); lookupContext.setPartition( opContext.getPartition() ); lookupContext.setTransaction( opContext.getTransaction() ); Entry administrationPoint = directoryService.getPartitionNexus().lookup( lookupContext ); // The administrativeRole AT must exist and not be null Attribute administrativeRole = administrationPoint.get( directoryService.getAtProvider() .getAdministrativeRole() ); // check that administrativeRole has something valid in it for us if ( ( administrativeRole == null ) || ( administrativeRole.size() <= 0 ) ) { LOG.error( "The entry on {} is not an AdministrativePoint", apDn ); throw new LdapNoSuchAttributeException( I18n.err( I18n.ERR_306, apDn ) ); } }
lookupContext.setPartition( this );
/** * {@inheritDoc} */ public void move( MoveOperationContext moveContext ) throws LdapException { boolean cascade = moveContext.hasRequestControl( Cascade.OID ); CoreSession session = moveContext.getSession(); LookupOperationContext lookupContext = new LookupOperationContext( session, moveContext.getDn(), SchemaConstants.ALL_ATTRIBUTES_ARRAY ); lookupContext.setPartition( this ); lookupContext.setTransaction( moveContext.getTransaction() ); Entry entry = session.getDirectoryService().getPartitionNexus().lookup( lookupContext ); synchronizer.move( moveContext, entry, cascade ); wrapped.move( moveContext ); updateSchemaModificationAttributes( moveContext ); }
/** * 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; } }
lookupContext.setPartition( systemPartition );
/** * {@inheritDoc} */ public void moveAndRename( MoveAndRenameOperationContext moveAndRenameContext ) throws LdapException { boolean cascade = moveAndRenameContext.hasRequestControl( Cascade.OID ); CoreSession session = moveAndRenameContext.getSession(); LookupOperationContext lookupContext = new LookupOperationContext( session, moveAndRenameContext.getDn(), SchemaConstants.ALL_ATTRIBUTES_ARRAY ); lookupContext.setPartition( this ); lookupContext.setTransaction( moveAndRenameContext.getTransaction() ); Entry entry = session.getDirectoryService().getPartitionNexus().lookup( lookupContext ); synchronizer.moveAndRename( moveAndRenameContext, entry, cascade ); wrapped.moveAndRename( moveAndRenameContext ); updateSchemaModificationAttributes( moveAndRenameContext ); }
lookupContext.setPartition( opContext.getPartition() ); lookupContext.setTransaction( opContext.getTransaction() );
LookupOperationContext lookupContext = new LookupOperationContext( session, dn, SchemaConstants.ALL_USER_ATTRIBUTES_ARRAY ); lookupContext.setPartition( moveContext.getPartition() ); lookupContext.setTransaction( moveContext.getTransaction() );
LookupOperationContext lookupContext = new LookupOperationContext( session, parentDn, SchemaConstants.ALL_ATTRIBUTES_ARRAY ); lookupContext.setPartition( opContext.getPartition() ); lookupContext.setTransaction( opContext.getTransaction() );
LookupOperationContext lookupContext = new LookupOperationContext( session, oldDn, SchemaConstants.ALL_USER_ATTRIBUTES_ARRAY ); lookupContext.setPartition( moveAndRenameContext.getPartition() ); lookupContext.setTransaction( moveAndRenameContext.getTransaction() );
/** * {@inheritDoc} */ public void modify( ModifyOperationContext modifyContext ) throws LdapException { Entry entry = modifyContext.getEntry(); if ( entry == null ) { LookupOperationContext lookupCtx = new LookupOperationContext( modifyContext.getSession(), modifyContext.getDn() ); lookupCtx.setPartition( this ); lookupCtx.setTransaction( modifyContext.getTransaction() ); entry = wrapped.lookup( lookupCtx ); modifyContext.setEntry( entry ); } Entry targetEntry = SchemaUtils.getTargetEntry( modifyContext.getModItems(), entry ); boolean cascade = modifyContext.hasRequestControl( Cascade.OID ); boolean hasModification = synchronizer.modify( modifyContext, targetEntry, cascade ); if ( hasModification ) { wrapped.modify( modifyContext ); } if ( !modifyContext.getDn().equals( schemaModificationDN ) ) { updateSchemaModificationAttributes( modifyContext ); } }
bindContext.getDn(), SchemaConstants.ALL_USER_ATTRIBUTES, SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES ); lookupContext.setPartition( bindContext.getPartition() ); lookupContext.setTransaction( bindContext.getTransaction() );
lookupContext.setPartition( modifyContext.getPartition() ); lookupContext.setTransaction( modifyContext.getTransaction() );
lookupContext.setPartition( partition );