public void init( DirectoryService directoryService ) { this.nexus = directoryService.getPartitionNexus(); }
@Override public PartitionNexus getPartitionNexus() { return wrapped.getPartitionNexus(); }
/** * Creates a TriggerSpecification cache. * * @param directoryService the directory service core * @throws LdapException with problems initializing cache */ public TriggerSpecCache( DirectoryService directoryService ) throws LdapException { this.nexus = directoryService.getPartitionNexus(); final SchemaManager schemaManager = directoryService.getSchemaManager(); triggerSpecParser = new TriggerSpecificationParser( new NormalizerMappingResolver() { @Override public Map<String, OidNormalizer> getNormalizerMapping() throws Exception { return schemaManager.getNormalizerMapping(); } } ); initialize( directoryService ); }
/** * Registers the specified {@link ExtendedOperationHandler} to this * protocol provider to provide a specific LDAP extended operation. * * @param eoh an extended operation handler * @throws Exception on failure to add the handler */ public void addExtendedOperationHandler( ExtendedOperationHandler<? extends ExtendedRequest, ? extends ExtendedResponse> eoh ) throws Exception { if ( started ) { eoh.setLdapServer( this ); PartitionNexus nexus = getDirectoryService().getPartitionNexus(); nexus.registerSupportedExtensions( eoh.getExtensionOids() ); } else { extendedOperationHandlers.add( eoh ); } }
/** * Registers and initializes all AdministrativePoints to this service. */ @Override public void init( DirectoryService directoryService ) throws LdapException { LOG.debug( "Initializing the AdministrativeInterceptor" ); super.init( directoryService ); nexus = directoryService.getPartitionNexus(); // Load all the AdministratvePoint : // Autonomous Administrative Point first, then Specific // administrative point, finally the Inner administrative Point // get the list of all the AAPs List<Entry> administrativePoints = getAdministrativePoints(); lockWrite(); try { addAdminPointCache( administrativePoints ); } finally { unlock(); } }
@Override public void init( DirectoryService directoryService ) throws LdapException { super.init( directoryService ); // stuff for dealing with subentries (garbage for now) Value subschemaSubentry = directoryService.getPartitionNexus().getRootDseValue( directoryService.getAtProvider().getSubschemaSubentry() ); subschemaSubentryDn = dnFactory.create( subschemaSubentry.getValue() ); // Create the Admin Dn adminDn = dnFactory.create( ServerDNConstants.ADMIN_SYSTEM_DN ); }
/** * * Creates a new instance of ReferralManagerImpl. * * @param directoryService The directory service * @throws LdapException If we can't initialize the manager */ public ReferralManagerImpl( DirectoryService directoryService ) throws LdapException { lockWrite(); try { referrals = new DnNode<>(); PartitionNexus nexus = directoryService.getPartitionNexus(); Set<String> suffixes = nexus.listSuffixes(); objectClassAT = directoryService.getSchemaManager().getAttributeType( SchemaConstants.OBJECT_CLASS_AT ); init( directoryService, suffixes.toArray( new String[] {} ) ); } finally { unlock(); } }
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 ); } }
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 ); } }
@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 ); } };
Partition partition = directoryService.getPartitionNexus().getPartition( entry.getDn() ); Subordinates subordinates = partition.getSubordinates( operationContext.getTransaction(), entry );
/** * {@inheritDoc} */ @Override public boolean accept( SearchOperationContext operation, Entry entry ) throws LdapException { if ( operation.getReturningAttributesString() == null ) { return true; } // Add the SubschemaSubentry AttributeType if it's requested SchemaManager schemaManager = operation.getSession().getDirectoryService().getSchemaManager(); if ( operation.isAllOperationalAttributes() || operation.getReturningAttributes().contains( new AttributeTypeOptions( schemaManager.getAttributeType( SchemaConstants.SUBSCHEMA_SUBENTRY_AT ) ) ) ) { AttributeType subschemaSubentryAt = schemaManager.getAttributeType( SchemaConstants.SUBSCHEMA_SUBENTRY_AT ); entry.add( new DefaultAttribute( subschemaSubentryAt, directoryService.getPartitionNexus().getRootDseValue( subschemaSubentryAt ) ) ); } return true; }
/** * 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 ) ); } }
modifyContext.setTransaction( opContext.getTransaction() ); session.getDirectoryService().getPartitionNexus().modify( modifyContext );
/** * {@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 ); }
PartitionNexus nexus = directoryService.getPartitionNexus();
/** * {@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 ); }
/** * 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; } }
PartitionNexus nexus = ds.getPartitionNexus();
Partition partition = directoryService.getPartitionNexus().getPartition( replConsumerDn );