/** * {@inheritDoc} */ @Override public void add( AddOperationContext addContext ) throws LdapException { Partition partition = addContext.getPartition(); partition.add( addContext ); }
/** * {@inheritDoc} */ public void add( AddOperationContext addContext ) throws LdapException { // At this point, the added SchemaObject does not exist in the partition // We have to check if it's enabled and then inject it into the registries // but only if it does not break the server. synchronizer.add( addContext ); // Now, write the newly added SchemaObject into the schemaPartition try { wrapped.add( addContext ); } catch ( LdapException e ) { // If something went wrong, we have to unregister the schemaObject // from the registries // TODO : deregister the newly added element. throw e; } updateSchemaModificationAttributes( addContext ); }
private void initializeSystemPartition() throws Exception { Partition system = getSystemPartition(); // Add root context entry for system partition Dn systemSuffixDn = getDnFactory().create( ServerDNConstants.SYSTEM_DN ); CoreSession adminSession = getAdminSession(); if ( !system.hasEntry( new HasEntryOperationContext( adminSession, systemSuffixDn ) ) ) { Entry systemEntry = new DefaultEntry( schemaManager, systemSuffixDn ); // Add the ObjectClasses systemEntry.put( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.TOP_OC, SchemaConstants.ORGANIZATIONAL_UNIT_OC, SchemaConstants.EXTENSIBLE_OBJECT_OC ); // Add some operational attributes systemEntry.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN ); systemEntry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() ); systemEntry.add( SchemaConstants.ENTRY_CSN_AT, getCSN().toString() ); systemEntry.add( SchemaConstants.ENTRY_UUID_AT, UUID.randomUUID().toString() ); systemEntry.put( DnUtils.getRdnAttributeType( ServerDNConstants.SYSTEM_DN ), DnUtils .getRdnValue( ServerDNConstants.SYSTEM_DN ) ); AddOperationContext addOperationContext = new AddOperationContext( adminSession, systemEntry ); system.add( addOperationContext ); } }
systemPartition.add( addContext ); partitionTxn.commit();