當前位置: 首頁>>代碼示例>>Java>>正文


Java EntryAttribute類代碼示例

本文整理匯總了Java中org.apache.directory.shared.ldap.entry.EntryAttribute的典型用法代碼示例。如果您正苦於以下問題:Java EntryAttribute類的具體用法?Java EntryAttribute怎麽用?Java EntryAttribute使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


EntryAttribute類屬於org.apache.directory.shared.ldap.entry包,在下文中一共展示了EntryAttribute類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: verify

import org.apache.directory.shared.ldap.entry.EntryAttribute; //導入依賴的package包/類
/**
 * Verifies that an entry exists in the directory with the specified attributes.
 *
 * @param entry
 *            the entry to verify
 * @throws Exception
 *             if there are problems accessing the entry
 */
protected void verify(LdifEntry entry) throws Exception {
    Entry readEntry = getRootDSE().lookup(entry.getDn());

    for (EntryAttribute readAttribute : readEntry) {
        String id = readAttribute.getId();
        EntryAttribute origAttribute = entry.getEntry().get(id);

        for (Value<?> value : origAttribute) {
            if (!readAttribute.contains(value)) {
                LOG.error("Failed to verify entry addition of " + entry.getDn() + ". " + id
                        + " attribute in original entry missing from read entry.");
                throw new AssertionError("Failed to verify entry addition of " + entry.getDn());
            }
        }
    }
}
 
開發者ID:Communote,項目名稱:communote-server,代碼行數:25,代碼來源:AbstractApacheDSServer.java

示例2: addAttribute

import org.apache.directory.shared.ldap.entry.EntryAttribute; //導入依賴的package包/類
public void addAttribute(String dn, String attrName, String attrValue)
    throws Exception {
  EntryAttribute attr = new DefaultClientAttribute(attrName, attrValue);
  Modification addValue = new ClientModification(
      ModificationOperation.ADD_ATTRIBUTE, attr);
  service.getAdminSession().modify(new DN(dn),
      Collections.singletonList(addValue));
}
 
開發者ID:gemxd,項目名稱:gemfirexd-oss,代碼行數:9,代碼來源:LdapTestServer.java

示例3: removeAttribute

import org.apache.directory.shared.ldap.entry.EntryAttribute; //導入依賴的package包/類
public void removeAttribute(String dn, String attrName, String attrValue)
    throws Exception {
  EntryAttribute attr = new DefaultClientAttribute(attrName, attrValue);
  Modification removeValue = new ClientModification(
      ModificationOperation.REMOVE_ATTRIBUTE, attr);
  service.getAdminSession().modify(new DN(dn),
      Collections.singletonList(removeValue));
}
 
開發者ID:gemxd,項目名稱:gemfirexd-oss,代碼行數:9,代碼來源:LdapTestServer.java


注:本文中的org.apache.directory.shared.ldap.entry.EntryAttribute類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。