本文整理了Java中org.apache.directory.server.core.api.partition.Partition.add()
方法的一些代码示例,展示了Partition.add()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Partition.add()
方法的具体详情如下:
包路径:org.apache.directory.server.core.api.partition.Partition
类名称:Partition
方法名:add
[英]Adds an entry to this ContextPartition.
[中]向该ContextPartition添加一个条目。
代码示例来源:origin: org.apache.directory.server/apacheds-core-shared
/**
* {@inheritDoc}
*/
@Override
public void add( AddOperationContext addContext ) throws LdapException
{
Partition partition = addContext.getPartition();
partition.add( addContext );
}
代码示例来源:origin: org.apache.directory.server/apacheds-core-api
/**
* {@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 );
}
代码示例来源:origin: org.apache.knox/gateway-test-ldap
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 );
}
}
代码示例来源:origin: org.apache.directory.server/apacheds-interceptors-number
systemPartition.add( addContext );
partitionTxn.commit();
内容来源于网络,如有侵权,请联系作者删除!