/** * Retrieves the set of referrals for this LDAP response, if any. * * @return The set of referrals for this LDAP response, or {@code null} if * there are none. */ public String[] getReferrals() { final String[] referrals = ldapResult.getReferralURLs(); if (referrals.length == 0) { return null; } else { return referrals; } }
/** * Ensures that the provided LDAP result has one or more referral URLs. * * @param result The LDAP result to examine. * * @throws AssertionError If the provided result does not have any referral * URLs. */ public static void assertHasReferral(final LDAPResult result) throws AssertionError { final String[] referralURLs = result.getReferralURLs(); if ((referralURLs == null) || (referralURLs.length == 0)) { throw new AssertionError(ERR_TEST_RESULT_MISSING_REFERRAL.get( String.valueOf(result))); } }
/** * Ensures that the provided LDAP result does not have any referral URLs. * * @param result The LDAP result to examine. * * @throws AssertionError If the provided result has one or more referral * URLs. */ public static void assertMissingReferral(final LDAPResult result) throws AssertionError { final String[] referralURLs = result.getReferralURLs(); if ((referralURLs != null) && (referralURLs.length > 0)) { throw new AssertionError(ERR_TEST_RESULT_HAS_REFERRAL.get( String.valueOf(result))); } }
/** * Creates a new modify DN response protocol op from the provided LDAP result * object. * * @param result The LDAP result object to use to create this protocol op. */ public ModifyDNResponseProtocolOp(final LDAPResult result) { super(LDAPMessage.PROTOCOL_OP_TYPE_MODIFY_DN_RESPONSE, result.getResultCode().intValue(), result.getMatchedDN(), result.getDiagnosticMessage(), StaticUtils.toList(result.getReferralURLs())); }
/** * Creates a new delete response protocol op from the provided LDAP result * object. * * @param result The LDAP result object to use to create this protocol op. */ public DeleteResponseProtocolOp(final LDAPResult result) { super(LDAPMessage.PROTOCOL_OP_TYPE_DELETE_RESPONSE, result.getResultCode().intValue(), result.getMatchedDN(), result.getDiagnosticMessage(), StaticUtils.toList(result.getReferralURLs())); }
/** * Creates a new add response protocol op from the provided LDAP result * object. * * @param result The LDAP result object to use to create this protocol op. */ public AddResponseProtocolOp(final LDAPResult result) { super(LDAPMessage.PROTOCOL_OP_TYPE_ADD_RESPONSE, result.getResultCode().intValue(), result.getMatchedDN(), result.getDiagnosticMessage(), StaticUtils.toList(result.getReferralURLs())); }
/** * Creates a new compare response protocol op from the provided LDAP result * object. * * @param result The LDAP result object to use to create this protocol op. */ public CompareResponseProtocolOp(final LDAPResult result) { super(LDAPMessage.PROTOCOL_OP_TYPE_COMPARE_RESPONSE, result.getResultCode().intValue(), result.getMatchedDN(), result.getDiagnosticMessage(), StaticUtils.toList(result.getReferralURLs())); }
/** * Creates a new modify response protocol op from the provided LDAP result * object. * * @param result The LDAP result object to use to create this protocol op. */ public ModifyResponseProtocolOp(final LDAPResult result) { super(LDAPMessage.PROTOCOL_OP_TYPE_MODIFY_RESPONSE, result.getResultCode().intValue(), result.getMatchedDN(), result.getDiagnosticMessage(), StaticUtils.toList(result.getReferralURLs())); }
/** * Creates a new modify response protocol op from the provided LDAP result * object. * * @param result The LDAP result object to use to create this protocol op. */ public ModifyResponseProtocolOp(final LDAPResult result) { super(LDAPMessage.PROTOCOL_OP_TYPE_MODIFY_RESPONSE, result.getResultCode().intValue(), result.getMatchedDN(), result.getDiagnosticMessage(), StaticUtils.toList(result.getReferralURLs())); }
/** * Creates a new search result done protocol op from the provided LDAP result * object. * * @param result The LDAP result object to use to create this protocol op. */ public SearchResultDoneProtocolOp(final LDAPResult result) { super(LDAPMessage.PROTOCOL_OP_TYPE_SEARCH_RESULT_DONE, result.getResultCode().intValue(), result.getMatchedDN(), result.getDiagnosticMessage(), StaticUtils.toList(result.getReferralURLs())); }
/** * Creates a new add response protocol op from the provided LDAP result * object. * * @param result The LDAP result object to use to create this protocol op. */ public AddResponseProtocolOp(final LDAPResult result) { super(LDAPMessage.PROTOCOL_OP_TYPE_ADD_RESPONSE, result.getResultCode().intValue(), result.getMatchedDN(), result.getDiagnosticMessage(), StaticUtils.toList(result.getReferralURLs())); }
/** * Creates a new compare response protocol op from the provided LDAP result * object. * * @param result The LDAP result object to use to create this protocol op. */ public CompareResponseProtocolOp(final LDAPResult result) { super(LDAPMessage.PROTOCOL_OP_TYPE_COMPARE_RESPONSE, result.getResultCode().intValue(), result.getMatchedDN(), result.getDiagnosticMessage(), StaticUtils.toList(result.getReferralURLs())); }
/** * Creates a new modify DN response protocol op from the provided LDAP result * object. * * @param result The LDAP result object to use to create this protocol op. */ public ModifyDNResponseProtocolOp(final LDAPResult result) { super(LDAPMessage.PROTOCOL_OP_TYPE_MODIFY_DN_RESPONSE, result.getResultCode().intValue(), result.getMatchedDN(), result.getDiagnosticMessage(), StaticUtils.toList(result.getReferralURLs())); }
/** * Creates a new delete response protocol op from the provided LDAP result * object. * * @param result The LDAP result object to use to create this protocol op. */ public DeleteResponseProtocolOp(final LDAPResult result) { super(LDAPMessage.PROTOCOL_OP_TYPE_DELETE_RESPONSE, result.getResultCode().intValue(), result.getMatchedDN(), result.getDiagnosticMessage(), StaticUtils.toList(result.getReferralURLs())); }
/** * Creates a new search result done protocol op from the provided LDAP result * object. * * @param result The LDAP result object to use to create this protocol op. */ public SearchResultDoneProtocolOp(final LDAPResult result) { super(LDAPMessage.PROTOCOL_OP_TYPE_SEARCH_RESULT_DONE, result.getResultCode().intValue(), result.getMatchedDN(), result.getDiagnosticMessage(), StaticUtils.toList(result.getReferralURLs())); }
/** * Creates a new get changelog batch extended result with only the generic * LDAP result information and no extended value. * * @param r An LDAP result with general details of the response. It must * not be {@code null}. */ public GetChangelogBatchExtendedResult(final LDAPResult r) { super(r.getMessageID(), r.getResultCode(), r.getDiagnosticMessage(), r.getMatchedDN(), r.getReferralURLs(), null, null, r.getResponseControls()); resumeToken = null; changesAlreadyPurged = false; moreChangesAvailable = false; estimatedChangesRemaining = -1; entryCount = -1; entryList = null; additionalInfo = null; }
/** * Creates a new LDAP exception using the information contained in the * provided LDAP result object. * * @param ldapResult The LDAP result object containing the information to * use for this LDAP exception. */ public LDAPException(final LDAPResult ldapResult) { super((ldapResult.getDiagnosticMessage() == null) ? ldapResult.getResultCode().getName() : ldapResult.getDiagnosticMessage()); resultCode = ldapResult.getResultCode(); matchedDN = ldapResult.getMatchedDN(); diagnosticMessage = ldapResult.getDiagnosticMessage(); referralURLs = ldapResult.getReferralURLs(); responseControls = ldapResult.getResponseControls(); }
/** * Creates a new LDAP exception using the information contained in the * provided LDAP result object. * * @param ldapResult The LDAP result object containing the information to * use for this LDAP exception. * @param cause The underlying exception that triggered this exception. */ public LDAPException(final LDAPResult ldapResult, final Throwable cause) { super(((ldapResult.getDiagnosticMessage() == null) ? ldapResult.getResultCode().getName() : ldapResult.getDiagnosticMessage()), cause); resultCode = ldapResult.getResultCode(); matchedDN = ldapResult.getMatchedDN(); diagnosticMessage = ldapResult.getDiagnosticMessage(); referralURLs = ldapResult.getReferralURLs(); responseControls = ldapResult.getResponseControls(); }
/** * Creates a new LDAP exception using the information contained in the * provided LDAP result object. * * @param ldapResult The LDAP result object containing the information to * use for this LDAP exception. * @param cause The underlying exception that triggered this exception. */ public LDAPException(final LDAPResult ldapResult, final Throwable cause) { super(((ldapResult.getDiagnosticMessage() == null) ? ldapResult.getResultCode().getName() : ldapResult.getDiagnosticMessage()), cause); resultCode = ldapResult.getResultCode(); matchedDN = ldapResult.getMatchedDN(); diagnosticMessage = ldapResult.getDiagnosticMessage(); referralURLs = ldapResult.getReferralURLs(); responseControls = ldapResult.getResponseControls(); }
/** * Creates a new LDAP exception using the information contained in the * provided LDAP result object. * * @param ldapResult The LDAP result object containing the information to * use for this LDAP exception. */ public LDAPException(final LDAPResult ldapResult) { super((ldapResult.getDiagnosticMessage() == null) ? ldapResult.getResultCode().getName() : ldapResult.getDiagnosticMessage()); resultCode = ldapResult.getResultCode(); matchedDN = ldapResult.getMatchedDN(); diagnosticMessage = ldapResult.getDiagnosticMessage(); referralURLs = ldapResult.getReferralURLs(); responseControls = ldapResult.getResponseControls(); }