本文整理了Java中org.apache.directory.server.core.api.partition.Partition.getId()
方法的一些代码示例,展示了Partition.getId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Partition.getId()
方法的具体详情如下:
包路径:org.apache.directory.server.core.api.partition.Partition
类名称:Partition
方法名:getId
[英]Gets the unique identifier for this partition.
[中]获取此分区的唯一标识符。
代码示例来源:origin: org.apache.knox/gateway-test-ldap
/**
* Sets {@link Partition}s used by this DirectoryService.
*
* @param partitions the partitions to used
*/
public void setPartitions( Set<? extends Partition> partitions )
{
Set<Partition> cloned = new HashSet<Partition>();
cloned.addAll( partitions );
Set<String> names = new HashSet<String>();
for ( Partition partition : cloned )
{
String id = partition.getId();
if ( names.contains( id ) )
{
LOG.warn( "Encountered duplicate partition {} identifier.", id );
}
names.add( id );
}
this.partitions = cloned;
}
代码示例来源:origin: org.apache.directory.server/apacheds-service
/**
* Try to repair the partitions. Precondition is that this service was started before.
*
* @param instanceLayout the on disk location's layout of the intance to be repaired
* @throws Exception If the repair failed
*/
public void repair( InstanceLayout instanceLayout ) throws Exception
{
File partitionsDir = instanceLayout.getPartitionsDirectory();
System.out.println( "Repairing partition dir " + partitionsDir.getAbsolutePath() );
Set<? extends Partition> partitions = getDirectoryService().getPartitions();
// Iterate on the partitions to repair them
for ( Partition partition : partitions )
{
try
{
partition.repair();
}
catch ( Exception e )
{
System.out.println( "Failed to repair the partition " + partition.getId() );
e.printStackTrace();
return;
}
}
}
代码示例来源:origin: org.apache.directory.server/apacheds-core-shared
throw new LdapOtherException( I18n.err( I18n.ERR_267, partition.getId() ) );
内容来源于网络,如有侵权,请联系作者删除!