/** * {@inheritDoc} */ @Override public Dn getSuffixDn( Dn dn ) throws LdapException { Partition partition = getPartition( dn ); return partition.getSuffixDn(); }
public void removePartition( Partition partition ) throws Exception { // Do the backend cleanup first try { // can be null when called before starting up if ( partitionNexus != null ) { partitionNexus.removeContextPartition( partition.getSuffixDn() ); } } catch ( LdapException le ) { // Bad ! We can't go any further throw le; } // And update the set of managed partitions partitions.remove( partition ); }
Partition testPartition = addPartition("test", "ou=test,dc=apache,dc=org"); Partition servicePartition = addPartition("service", "ou=service,ou=test,dc=apache,dc=org"); addIndex(infopulsePartition, "objectClass", "ou", "uid"); addIndex(servicePartition, "objectClass", "ou", "uid"); service.startup(); if (!service.getAdminSession().exists(infopulsePartition.getSuffixDn())) { Dn dnApache = new Dn("ou=test,dc=apache,dc=org"); Entry entryApache = service.newEntry(dnApache); entryApache.add("objectClass", "top", "domain", "extensibleObject"); entryApache.add("dc", "Apache"); service.getAdminSession().add(entryApache); } if (!service.getAdminSession().exists(servicePartition.getSuffixDn())) { Dn dnApache = new Dn("ou=service,ou=test,dc=apache,dc=org"); Entry entryApache = service.newEntry(dnApache); entryApache.add("objectClass", "top", "domain", "extensibleObject"); entryApache.add("dc", "Apache"); service.getAdminSession().add(entryApache); }
/** * Unregisters an ContextPartition with this BackendManager. Called for each * registered Backend right befor it is to be stopped. This prevents * protocol server requests from reaching the Backend and effectively puts * the ContextPartition's naming context offline. * * Operations against the naming context should result in an LDAP BUSY * result code in the returnValue if the naming context is not online. * * @param partition ContextPartition component to unregister with this * BackendNexus. * @throws Exception if there are problems unregistering the partition */ private void unregister( Partition partition ) throws LdapException { Attribute namingContexts = rootDse.get( SchemaConstants.NAMING_CONTEXTS_AT ); if ( namingContexts != null ) { namingContexts.remove( partition.getSuffixDn().getName() ); } partitions.remove( partition.getSuffixDn().getName() ); }
LookupOperationContext loc = new LookupOperationContext( getAdminSession(), systemPartition.getSuffixDn(), SchemaConstants.ALL_ATTRIBUTES_ARRAY );
String partitionSuffix = partition.getSuffixDn().getNormName(); partitionLookupTree.remove( partition.getSuffixDn() );
LOG.warn( "Failed to destroy a partition: " + partition.getSuffixDn(), e );
String key = partition.getSuffixDn().getNormName(); Dn partitionSuffix = partition.getSuffixDn(); partitionLookupTree.add( partition.getSuffixDn(), partition );
Cursor<Entry> cursor = session.search( partition.getSuffixDn(), SearchScope.SUBTREE, filter, AliasDerefMode.NEVER_DEREF_ALIASES, MANDATORY_ENTRY_ATOP_AT ); cursor.beforeFirst();
EntryFilteringCursor cursor = session.search( partition.getSuffixDn(), SearchScope.SUBTREE, filter, AliasDerefMode.NEVER_DEREF_ALIASES, SchemaConstants.OBJECT_CLASS_AT_OID, SchemaConstants.ENTRY_UUID_AT_OID, SchemaConstants.ENTRY_CSN_AT_OID, SchemaConstants.CREATORS_NAME_AT_OID, SchemaConstants.CREATORS_NAME_AT_OID); cursor.beforeFirst();
Dn contextDn = partition.getSuffixDn(); PartitionTxn partitionTxn = partition.beginReadTransaction(); HasEntryOperationContext hasEntryContext = new HasEntryOperationContext( Dn contextDn = partition.getSuffixDn(); HasEntryOperationContext hasEntryContext = new HasEntryOperationContext( searchContext.getSession(), contextDn );
partitions.add( schemaPartition ); systemPartition.setCacheService( cacheService ); systemPartition.getSuffixDn().apply( schemaManager ); .getSuffixDn().getName(); partitionNexus.getRootDse( null ).add( SchemaConstants.CHANGELOG_CONTEXT_AT, clSuffix );
if (!session.exists(rodaPartition.getSuffixDn())) {