• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Partition类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.directory.server.core.api.partition.Partition的典型用法代码示例。如果您正苦于以下问题:Java Partition类的具体用法?Java Partition怎么用?Java Partition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Partition类属于org.apache.directory.server.core.api.partition包,在下文中一共展示了Partition类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:23,代码来源:DefaultPartitionNexus.java


示例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 );
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:22,代码来源:DefaultPartitionNexus.java


示例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() );
    }
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:29,代码来源:DefaultPartitionNexus.java


示例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 );
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:24,代码来源:DefaultPartitionNexus.java


示例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;
    }
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:22,代码来源:DefaultPartitionNexus.java


示例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 );
    }
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:21,代码来源:DefaultPartitionNexus.java


示例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;
    }
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:27,代码来源:DefaultPartitionNexus.java


示例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;
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:25,代码来源:LdapService.java


示例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() );
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:14,代码来源:DefaultPartitionNexus.java


示例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;
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:34,代码来源:DefaultPartitionNexus.java


示例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() );
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:16,代码来源:DefaultPartitionNexus.java


示例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() );
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:14,代码来源:DefaultPartitionNexus.java


示例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() );
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:14,代码来源:DefaultPartitionNexus.java


示例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 );
    }
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:14,代码来源:DefaultPartitionNexus.java


示例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();
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:10,代码来源:DefaultPartitionNexus.java


示例16: sync

import org.apache.directory.server.core.api.partition.Partition; //导入依赖的package包/类
public void sync() throws Exception
{
    MultiException error = null;

    for ( Partition partition : this.partitions.values() )
    {
        try
        {
            partition.saveContextCsn();
            partition.sync();
        }
        catch ( Exception e )
        {
            LOG.warn( "Failed to flush partition data out.", e );
            if ( error == null )
            {
                //noinspection ThrowableInstanceNeverThrown
                error = new MultiException( I18n.err( I18n.ERR_265 ) );
            }

            // @todo really need to send this info to a monitor
            error.addThrowable( e );
        }
    }

    if ( error != null )
    {
        throw error;
    }
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:31,代码来源:DefaultPartitionNexus.java


示例17: 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 );

    return deletedEntry;
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:11,代码来源:DefaultPartitionNexus.java


示例18: 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 );
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:11,代码来源:DefaultPartitionNexus.java


示例19: addPartition

import org.apache.directory.server.core.api.partition.Partition; //导入依赖的package包/类
private Partition addPartition(String partitionId, String partitionDn, DnFactory dnFactory) throws Exception {
    JdbmPartition partition = new JdbmPartition(directoryService.getSchemaManager(), dnFactory);
    partition.setId(partitionId);
    partition.setPartitionPath(new File(directoryService.getInstanceLayout().getPartitionsDirectory(), partitionId)
            .toURI());
    partition.setSuffixDn(new Dn(directoryService.getSchemaManager(), partitionDn));
    directoryService.addPartition(partition);
    return partition;
}
 
开发者ID:intropro,项目名称:prairie,代码行数:10,代码来源:KerberosServer.java


示例20: addIndex

import org.apache.directory.server.core.api.partition.Partition; //导入依赖的package包/类
private void addIndex(Partition partition, String... attrs) {
    Set indexedAttributes = new HashSet();
    for (String attribute : attrs) {
        indexedAttributes.add(new JdbmIndex<>(attribute, false));
    }
    ((JdbmPartition) partition).setIndexedAttributes(indexedAttributes);
}
 
开发者ID:intropro,项目名称:prairie,代码行数:8,代码来源:KerberosServer.java



注:本文中的org.apache.directory.server.core.api.partition.Partition类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TCharSet类代码示例发布时间:2022-05-22
下一篇:
Java Net类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap