当前位置: 首页>>代码示例>>Java>>正文


Java LdapNetworkConnection.modifyDn方法代码示例

本文整理汇总了Java中org.apache.directory.ldap.client.api.LdapNetworkConnection.modifyDn方法的典型用法代码示例。如果您正苦于以下问题:Java LdapNetworkConnection.modifyDn方法的具体用法?Java LdapNetworkConnection.modifyDn怎么用?Java LdapNetworkConnection.modifyDn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.directory.ldap.client.api.LdapNetworkConnection的用法示例。


在下文中一共展示了LdapNetworkConnection.modifyDn方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: test817RenameAccount

import org.apache.directory.ldap.client.api.LdapNetworkConnection; //导入方法依赖的package包/类
@Test
   public void test817RenameAccount() throws Exception {
	final String TEST_NAME = "test817RenameAccount";
       TestUtil.displayTestTile(this, TEST_NAME);

       // GIVEN
       Task task = taskManager.createTaskInstance(this.getClass().getName() + "." + TEST_NAME);
       OperationResult result = task.getResult();
       
       long tsStart = System.currentTimeMillis();
       
       // WHEN
       TestUtil.displayWhen(TEST_NAME);
       LdapNetworkConnection connection = ldapConnect();
       
       ModifyDnRequest modDnRequest = new ModifyDnRequestImpl();
       modDnRequest.setName(new Dn(toAccountDn(ACCOUNT_HT_UID, ACCOUNT_HT_CN)));
       modDnRequest.setNewRdn(toAccountRdn(ACCOUNT_HTM_UID, ACCOUNT_HTM_CN));
       modDnRequest.setDeleteOldRdn(true);
	ModifyDnResponse modDnResponse = connection.modifyDn(modDnRequest);
	display("Modified "+toAccountDn(ACCOUNT_HT_UID, ACCOUNT_HT_CN)+" -> "+toAccountRdn(ACCOUNT_HTM_UID, ACCOUNT_HTM_CN)+": "+modDnResponse);
	
	doAdditionalRenameModifications(connection);
	
	ldapDisconnect(connection);

	waitForTaskNextRunAssertSuccess(getSyncTaskOid(), true);
       
       // THEN
       TestUtil.displayThen(TEST_NAME);
       result.computeStatus();
       TestUtil.assertSuccess(result);
       
       long tsEnd = System.currentTimeMillis();
       
       PrismObject<UserType> user = findUserByUsername(ACCOUNT_HTM_UID);
       assertNotNull("No user "+ACCOUNT_HTM_UID+" created", user);
       assertUser(user, user.getOid(), ACCOUNT_HTM_UID, getAccountHtmCnAfterRename(), ACCOUNT_HT_GIVENNAME, ACCOUNT_HT_SN_MODIFIED);
       assertNull("User "+ACCOUNT_HT_UID+" still exist", findUserByUsername(ACCOUNT_HT_UID));

       assertStepSyncToken(getSyncTaskOid(), 4, tsStart, tsEnd);

}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:44,代码来源:AbstractLdapSynchronizationTest.java

示例2: test837RenameAccount

import org.apache.directory.ldap.client.api.LdapNetworkConnection; //导入方法依赖的package包/类
@Test
   public void test837RenameAccount() throws Exception {
	final String TEST_NAME = "test837RenameAccount";
       TestUtil.displayTestTile(this, TEST_NAME);

       // GIVEN
       Task task = taskManager.createTaskInstance(this.getClass().getName() + "." + TEST_NAME);
       OperationResult result = task.getResult();
       
       long tsStart = System.currentTimeMillis();
       
       // WHEN
       TestUtil.displayWhen(TEST_NAME);
       LdapNetworkConnection connection = ldapConnect();
       
       ModifyDnRequest modDnRequest = new ModifyDnRequestImpl();
       modDnRequest.setName(new Dn(toAccountDn(ACCOUNT_HT_UID, ACCOUNT_HT_CN)));
       modDnRequest.setNewRdn(toAccountRdn(ACCOUNT_HTM_UID, ACCOUNT_HTM_CN));
       modDnRequest.setDeleteOldRdn(true);
	ModifyDnResponse modDnResponse = connection.modifyDn(modDnRequest);
	display("Modified "+toAccountDn(ACCOUNT_HT_UID,ACCOUNT_HT_CN)+" -> "+toAccountRdn(ACCOUNT_HTM_UID, ACCOUNT_HTM_CN)+": "+modDnResponse);
	
	doAdditionalRenameModifications(connection);
	
	ldapDisconnect(connection);

	waitForTaskNextRunAssertSuccess(getSyncTaskOid(), true);
       
       // THEN
       TestUtil.displayThen(TEST_NAME);
       result.computeStatus();
       TestUtil.assertSuccess(result);
       
       long tsEnd = System.currentTimeMillis();
       
       PrismObject<UserType> user = findUserByUsername(ACCOUNT_HTM_UID);
       assertNotNull("No user "+ACCOUNT_HTM_UID+" created", user);
       assertUser(user, user.getOid(), ACCOUNT_HTM_UID, getAccountHtmCnAfterRename(), ACCOUNT_HT_GIVENNAME, ACCOUNT_HT_SN_MODIFIED);
       assertNull("User "+ACCOUNT_HT_UID+" still exist", findUserByUsername(ACCOUNT_HT_UID));

       assertStepSyncToken(getSyncTaskOid(), 9, tsStart, tsEnd);

}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:44,代码来源:AbstractLdapSynchronizationTest.java

示例3: test817RenameAccount

import org.apache.directory.ldap.client.api.LdapNetworkConnection; //导入方法依赖的package包/类
@Test
   public void test817RenameAccount() throws Exception {
	final String TEST_NAME = "test817RenameAccount";
       TestUtil.displayTestTitle(this, TEST_NAME);

       // GIVEN
       Task task = taskManager.createTaskInstance(this.getClass().getName() + "." + TEST_NAME);
       OperationResult result = task.getResult();

       long tsStart = System.currentTimeMillis();

       // WHEN
       TestUtil.displayWhen(TEST_NAME);
       LdapNetworkConnection connection = ldapConnect();

       ModifyDnRequest modDnRequest = new ModifyDnRequestImpl();
       modDnRequest.setName(new Dn(toAccountDn(ACCOUNT_HT_UID, ACCOUNT_HT_CN)));
       modDnRequest.setNewRdn(toAccountRdn(ACCOUNT_HTM_UID, ACCOUNT_HTM_CN));
       modDnRequest.setDeleteOldRdn(true);
	ModifyDnResponse modDnResponse = connection.modifyDn(modDnRequest);
	display("Modified "+toAccountDn(ACCOUNT_HT_UID, ACCOUNT_HT_CN)+" -> "+toAccountRdn(ACCOUNT_HTM_UID, ACCOUNT_HTM_CN)+": "+modDnResponse);

	doAdditionalRenameModifications(connection);

	ldapDisconnect(connection);

	waitForTaskNextRunAssertSuccess(getSyncTaskOid(), true);

       // THEN
       TestUtil.displayThen(TEST_NAME);
       result.computeStatus();
       TestUtil.assertSuccess(result);

       long tsEnd = System.currentTimeMillis();

       PrismObject<UserType> user = findUserByUsername(ACCOUNT_HTM_UID);
       assertNotNull("No user "+ACCOUNT_HTM_UID+" created", user);
       assertUser(user, user.getOid(), ACCOUNT_HTM_UID, getAccountHtmCnAfterRename(), ACCOUNT_HT_GIVENNAME, ACCOUNT_HT_SN_MODIFIED);
       assertNull("User "+ACCOUNT_HT_UID+" still exist", findUserByUsername(ACCOUNT_HT_UID));

       assertStepSyncToken(getSyncTaskOid(), 4, tsStart, tsEnd);

}
 
开发者ID:Evolveum,项目名称:midpoint,代码行数:44,代码来源:AbstractLdapSynchronizationTest.java

示例4: test837RenameAccount

import org.apache.directory.ldap.client.api.LdapNetworkConnection; //导入方法依赖的package包/类
@Test
   public void test837RenameAccount() throws Exception {
	final String TEST_NAME = "test837RenameAccount";
       TestUtil.displayTestTitle(this, TEST_NAME);

       // GIVEN
       Task task = taskManager.createTaskInstance(this.getClass().getName() + "." + TEST_NAME);
       OperationResult result = task.getResult();

       long tsStart = System.currentTimeMillis();

       // WHEN
       TestUtil.displayWhen(TEST_NAME);
       LdapNetworkConnection connection = ldapConnect();

       ModifyDnRequest modDnRequest = new ModifyDnRequestImpl();
       modDnRequest.setName(new Dn(toAccountDn(ACCOUNT_HT_UID, ACCOUNT_HT_CN)));
       modDnRequest.setNewRdn(toAccountRdn(ACCOUNT_HTM_UID, ACCOUNT_HTM_CN));
       modDnRequest.setDeleteOldRdn(true);
	ModifyDnResponse modDnResponse = connection.modifyDn(modDnRequest);
	display("Modified "+toAccountDn(ACCOUNT_HT_UID,ACCOUNT_HT_CN)+" -> "+toAccountRdn(ACCOUNT_HTM_UID, ACCOUNT_HTM_CN)+": "+modDnResponse);

	doAdditionalRenameModifications(connection);

	ldapDisconnect(connection);

	waitForTaskNextRunAssertSuccess(getSyncTaskOid(), true);

       // THEN
       TestUtil.displayThen(TEST_NAME);
       result.computeStatus();
       TestUtil.assertSuccess(result);

       long tsEnd = System.currentTimeMillis();

       PrismObject<UserType> user = findUserByUsername(ACCOUNT_HTM_UID);
       assertNotNull("No user "+ACCOUNT_HTM_UID+" created", user);
       assertUser(user, user.getOid(), ACCOUNT_HTM_UID, getAccountHtmCnAfterRename(), ACCOUNT_HT_GIVENNAME, ACCOUNT_HT_SN_MODIFIED);
       assertNull("User "+ACCOUNT_HT_UID+" still exist", findUserByUsername(ACCOUNT_HT_UID));

       assertStepSyncToken(getSyncTaskOid(), 9, tsStart, tsEnd);

}
 
开发者ID:Evolveum,项目名称:midpoint,代码行数:44,代码来源:AbstractLdapSynchronizationTest.java


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