本文整理汇总了Java中org.apache.directory.server.core.api.partition.Partition类的典型用法代码示例。如果您正苦于以下问题:Java Partition类的具体用法?Java Partition怎么用?Java Partition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Partition类属于org.apache.directory.server.core.api.partition包,在下文中一共展示了Partition类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: delete
import org.apache.directory.server.core.api.partition.Partition; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public Entry delete( DeleteOperationContext deleteContext ) throws LdapException
{
Partition partition = getPartition( deleteContext.getDn() );
Entry deletedEntry = partition.delete( deleteContext );
Entry entry = deleteContext.getEntry();
// MyVD doesn't care about csn
// Attribute csn = entry.get( ENTRY_CSN_AT );
// can be null while doing subentry deletion
// //TODO verify if this gets in the way of replication
// if ( csn != null )
// {
// directoryService.setContextCsn( csn.getString() );
// }
return deletedEntry;
}
示例2: hasEntry
import org.apache.directory.server.core.api.partition.Partition; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public boolean hasEntry( HasEntryOperationContext hasEntryContext ) throws LdapException
{
Dn dn = hasEntryContext.getDn();
if ( IS_DEBUG )
{
LOG.debug( "Check if Dn '" + dn + "' exists." );
}
if ( dn.isRootDse() )
{
return true;
}
Partition partition = getPartition( dn );
return partition.hasEntry( hasEntryContext );
}
示例3: modify
import org.apache.directory.server.core.api.partition.Partition; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public void modify( ModifyOperationContext modifyContext ) throws LdapException
{
// Special case : if we don't have any modification to apply, just return
if ( modifyContext.getModItems().size() == 0 )
{
return;
}
Partition partition = getPartition( modifyContext.getDn() );
partition.modify( modifyContext );
if ( modifyContext.isPushToEvtInterceptor() )
{
directoryService.getInterceptor( InterceptorEnum.EVENT_INTERCEPTOR.getName() ).modify( modifyContext );
}
Entry alteredEntry = modifyContext.getAlteredEntry();
if ( alteredEntry != null )
{
// MyVD doesn't care about csn
// directoryService.setContextCsn( alteredEntry.get( ENTRY_CSN_AT ).getString() );
}
}
示例4: search
import org.apache.directory.server.core.api.partition.Partition; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public EntryFilteringCursor search( SearchOperationContext searchContext ) throws LdapException
{
Dn base = searchContext.getDn();
// TODO since we're handling the *, and + in the EntryFilteringCursor
// we may not need this code: we need see if this is actually the
// case and remove this code.
if ( base.size() == 0 )
{
return searchFromRoot( searchContext );
}
// Not sure we need this code...
base.apply( schemaManager );
// Normal case : do a search on the specific partition
Partition backend = getPartition( base );
return backend.search( searchContext );
}
示例5: getPartition
import org.apache.directory.server.core.api.partition.Partition; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public Partition getPartition( Dn dn ) throws LdapException
{
Partition parent = null;
synchronized ( partitionLookupTree )
{
parent = partitionLookupTree.getElement( dn );
}
if ( parent == null )
{
throw new LdapNoSuchObjectException( I18n.err( I18n.ERR_268, dn ) );
}
else
{
return parent;
}
}
示例6: modify
import org.apache.directory.server.core.api.partition.Partition; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public void modify( ModifyOperationContext modifyContext ) throws LdapException
{
// Special case : if we don't have any modification to apply, just return
if ( modifyContext.getModItems().size() == 0 )
{
return;
}
Partition partition = getPartition( modifyContext.getDn() );
partition.modify( modifyContext );
if ( modifyContext.isPushToEvtInterceptor() )
{
directoryService.getInterceptor( InterceptorEnum.EVENT_INTERCEPTOR.getName() ).modify( modifyContext );
}
}
示例7: getPartition
import org.apache.directory.server.core.api.partition.Partition; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public Partition getPartition( Dn dn ) throws LdapException
{
Partition parent = null;
if ( !dn.isSchemaAware() )
{
dn.apply( schemaManager );
}
synchronized ( partitionLookupTree )
{
parent = partitionLookupTree.getElement( dn );
}
if ( parent == null )
{
throw new LdapNoSuchObjectException( I18n.err( I18n.ERR_268, dn ) );
}
else
{
return parent;
}
}
示例8: addPartition
import org.apache.directory.server.core.api.partition.Partition; //导入依赖的package包/类
/**
* Add a new partition to the directory server.
*
* @param partitionName - The name of the partition.
* @param indexes - The attributes to index.
* @return This Builder for subsequent changes.
*/
public Builder addPartition(final String id, final String partitionName, final int indexSize, final String ... indexes) throws Exception {
assertNotStarted();
if (directoryService == null) {
throw new IllegalStateException("The Directory service has not been created.");
}
SchemaManager schemaManager = directoryService.getSchemaManager();
PartitionFactory partitionFactory = directoryServiceFactory.getPartitionFactory();
Partition partition = partitionFactory.createPartition(schemaManager, directoryService.getDnFactory(), id, partitionName, 1000, workingDir);
for (String current : indexes) {
partitionFactory.addIndex(partition, current, indexSize);
}
partition.initialize();
directoryService.addPartition(partition);
return this;
}
示例9: add
import org.apache.directory.server.core.api.partition.Partition; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public void add( AddOperationContext addContext ) throws LdapException
{
Partition partition = getPartition( addContext.getDn() );
partition.add( addContext );
// MyVD doesn't care about csn
// Attribute at = addContext.getEntry().get( SchemaConstants.ENTRY_CSN_AT );
// directoryService.setContextCsn( at.getString() );
}
示例10: lookup
import org.apache.directory.server.core.api.partition.Partition; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public Entry lookup( LookupOperationContext lookupContext ) throws LdapException
{
Dn dn = lookupContext.getDn();
if ( dn.equals( subschemSubentryDn ) )
{
return new ClonedServerEntry( rootDse.clone() );
}
// This is for the case we do a lookup on the rootDSE
if ( dn.isRootDse() )
{
Entry retval = new ClonedServerEntry( rootDse );
return retval;
}
Partition partition = getPartition( dn );
Entry entry = partition.lookup( lookupContext );
if ( entry == null )
{
LdapNoSuchObjectException e = new LdapNoSuchObjectException( "Attempt to lookup non-existant entry: "
+ dn.getName() );
throw e;
}
return entry;
}
示例11: move
import org.apache.directory.server.core.api.partition.Partition; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public void move( MoveOperationContext moveContext ) throws LdapException
{
// Get the current partition
Partition partition = getPartition( moveContext.getDn() );
partition.move( moveContext );
Entry entry = moveContext.getModifiedEntry();
// MyVD doesn't care about csn
// directoryService.setContextCsn( entry.get( ENTRY_CSN_AT ).getString() );
}
示例12: moveAndRename
import org.apache.directory.server.core.api.partition.Partition; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public void moveAndRename( MoveAndRenameOperationContext moveAndRenameContext ) throws LdapException
{
Partition partition = getPartition( moveAndRenameContext.getDn() );
partition.moveAndRename( moveAndRenameContext );
Entry entry = moveAndRenameContext.getModifiedEntry();
// MyVD doesn't care about csn
// directoryService.setContextCsn( entry.get( ENTRY_CSN_AT ).getString() );
}
示例13: rename
import org.apache.directory.server.core.api.partition.Partition; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public void rename( RenameOperationContext renameContext ) throws LdapException
{
Partition partition = getPartition( renameContext.getDn() );
partition.rename( renameContext );
Entry entry = renameContext.getModifiedEntry();
// MyVD doesn't care about csn
// directoryService.setContextCsn( entry.get( ENTRY_CSN_AT ).getString() );
}
示例14: unbind
import org.apache.directory.server.core.api.partition.Partition; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public void unbind( UnbindOperationContext unbindContext ) throws LdapException
{
Dn unbindContextDn = unbindContext.getDn();
if ( !Dn.isNullOrEmpty( unbindContextDn ) )
{
Partition partition = getPartition( unbindContext.getDn() );
partition.unbind( unbindContext );
}
}
示例15: getSuffixDn
import org.apache.directory.server.core.api.partition.Partition; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public Dn getSuffixDn( Dn dn ) throws LdapException
{
Partition partition = getPartition( dn );
return partition.getSuffixDn();
}