本文整理汇总了Java中com.unboundid.ldap.sdk.ResultCode.INSUFFICIENT_ACCESS_RIGHTS_INT_VALUE属性的典型用法代码示例。如果您正苦于以下问题:Java ResultCode.INSUFFICIENT_ACCESS_RIGHTS_INT_VALUE属性的具体用法?Java ResultCode.INSUFFICIENT_ACCESS_RIGHTS_INT_VALUE怎么用?Java ResultCode.INSUFFICIENT_ACCESS_RIGHTS_INT_VALUE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.unboundid.ldap.sdk.ResultCode
的用法示例。
在下文中一共展示了ResultCode.INSUFFICIENT_ACCESS_RIGHTS_INT_VALUE属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addEntry
@Override
public boolean addEntry(String dn, Collection<Attribute> atts) throws DuplicateEntryException, ConnectionException {
try {
LDAPResult result = getConnectionPool().add(dn, atts);
if (result.getResultCode().getName().equalsIgnoreCase(LdapOperationsServiceImpl.success))
return true;
} catch (final LDAPException ex) {
int errorCode = ex.getResultCode().intValue();
if (errorCode == ResultCode.ENTRY_ALREADY_EXISTS_INT_VALUE) {
throw new DuplicateEntryException();
}
if (errorCode == ResultCode.INSUFFICIENT_ACCESS_RIGHTS_INT_VALUE) {
throw new ConnectionException("LDAP config error: insufficient access rights.", ex);
}
if (errorCode == ResultCode.TIME_LIMIT_EXCEEDED_INT_VALUE) {
throw new ConnectionException("LDAP Error: time limit exceeded", ex);
}
if (errorCode == ResultCode.OBJECT_CLASS_VIOLATION_INT_VALUE) {
throw new ConnectionException("LDAP config error: schema violation contact LDAP admin.", ex);
}
throw new ConnectionException("Error adding entry to directory. LDAP error number " + errorCode, ex);
}
return false;
}
示例2: modifyEntry
/**
* Use this method to add / replace / delete attribute from entry
*
* @param modifyRequest
* @return true if modification is successful
* @throws DuplicateEntryException
* @throws ConnectionException
*/
protected boolean modifyEntry(ModifyRequest modifyRequest) throws DuplicateEntryException, ConnectionException {
LDAPResult modifyResult = null;
try {
modifyResult = getConnectionPool().modify(modifyRequest);
return ResultCode.SUCCESS.equals(modifyResult.getResultCode());
} catch (final LDAPException ex) {
int errorCode = ex.getResultCode().intValue();
if (errorCode == ResultCode.INSUFFICIENT_ACCESS_RIGHTS_INT_VALUE) {
throw new ConnectionException("LDAP config error: insufficient access rights.", ex);
}
if (errorCode == ResultCode.TIME_LIMIT_EXCEEDED_INT_VALUE) {
throw new ConnectionException("LDAP Error: time limit exceeded", ex);
}
if (errorCode == ResultCode.OBJECT_CLASS_VIOLATION_INT_VALUE) {
throw new ConnectionException("LDAP config error: schema violation contact LDAP admin.", ex);
}
throw new ConnectionException("Error updating entry in directory. LDAP error number " + errorCode, ex);
}
}