@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 ); }
/** * {@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; }
PartitionNexus nexus = ds.getPartitionNexus(); Value subschemaSubentry = nexus.getRootDseValue( ds.getAtProvider().getSubschemaSubentry() ); Dn subschemaSubentryDn = ds.getDnFactory().create( subschemaSubentry.getValue() );