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


Java ResultCode.INSUFFICIENT_ACCESS_RIGHTS_INT_VALUE属性代码示例

本文整理汇总了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;
}
 
开发者ID:GluuFederation,项目名称:oxCore,代码行数:26,代码来源:LdapOperationsServiceImpl.java

示例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);
	}
}
 
开发者ID:GluuFederation,项目名称:oxCore,代码行数:28,代码来源:LdapOperationsServiceImpl.java


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