/** * 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; }
/** * Retrieves an {@code LDAPResult} object that represents the server response * described by this access log entry, if any. Note that for some types of * operations, like abandon and unbind operations, the server will not return * a result to the client. * * @return An {@code LDAPResult} object that represents the server response * described by this access log entry, or {@code null} if no response * information is available. */ public final LDAPResult toLDAPResult() { if (resultCode == null) { return null; } return new LDAPResult(-1, resultCode, diagnosticMessage, null, referralURLs, responseControls); }
/** * Creates a new LDAP result object with the provided message ID and with the * protocol op and controls read from the given ASN.1 stream reader. * * @param messageID The LDAP message ID for the LDAP message that is * associated with this LDAP result. * @param messageSequence The ASN.1 stream reader sequence used in the * course of reading the LDAP message elements. * @param reader The ASN.1 stream reader from which to read the * protocol op and controls. * * @return The decoded LDAP result object. * * @throws LDAPException If a problem occurs while reading or decoding data * from the ASN.1 stream reader. */ @InternalUseOnly() public static LDAPResult readLDAPResultFrom(final int messageID, final ASN1StreamReaderSequence messageSequence, final ASN1StreamReader reader) throws LDAPException { return LDAPResult.readLDAPResultFrom(messageID, messageSequence, reader); }
/** * Sets the response controls for this connection. * * @param ldapResult The result containing the controls to use. */ private void setResponseControls(final LDAPResult ldapResult) { if (ldapResult.hasResponseControl()) { responseControls = LDAPControl.toLDAPControls(ldapResult.getResponseControls()); } else { responseControls = null; } }
if ((result.getResultCode().equals(ResultCode.REFERRAL)) && followReferrals(connection)) return new LDAPResult(messageID, ResultCode.REFERRAL_LIMIT_EXCEEDED, ERR_TOO_MANY_REFERRALS.get(), result.getMatchedDN(), result.getReferralURLs(), result.getResponseControls()); result.getResultCode()); if (retryResult != null)
/** * Retrieves the result code for this LDAP response. * * @return The result code for this LDAP response. */ public int getResultCode() { return ldapResult.getResultCode().intValue(); }
switch (result.getResultCode().intValue()) if (! ResultCode.isConnectionUsable(result.getResultCode())) results.add(new LDAPResult(request.getLastMessageID(), le.getResultCode(), le.getMessage(), le.getMatchedDN(), le.getReferralURLs(),
throws JSONRPC2Error { final ResultCode ldapCode = result.getResultCode(); String message = result.getDiagnosticMessage();
/** * Retrieves the list of controls for this LDAP response, if any. * * @return The list of controls for this LDAP response, or {@code null} if * there are none. */ public LDAPControl[] getControls() { final Control[] controls = ldapResult.getResponseControls(); if (controls.length == 0) { return null; } return LDAPControl.toLDAPControls(controls); }
/** * Retrieves the error message for this LDAP response, if available. * * @return The error message for this LDAP response, or {@code null} if there * is none. */ public String getErrorMessage() { return ldapResult.getDiagnosticMessage(); }
/** * Retrieves a string representation of this LDAP response. * * @return A string representation of this LDAP response. */ @Override() public String toString() { return ldapResult.toString(); } }
/** * Retrieves the matched DN for this LDAP response, if available. * * @return The matched DN for this LDAP response, or {@code null} if there * is none. */ public String getMatchedDN() { return ldapResult.getMatchedDN(); }
/** * 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; } }
if ((result.getResultCode().equals(ResultCode.REFERRAL)) && followReferrals(connection)) return new LDAPResult(messageID, ResultCode.REFERRAL_LIMIT_EXCEEDED, ERR_TOO_MANY_REFERRALS.get(), result.getMatchedDN(), result.getReferralURLs(), result.getResponseControls()); result.getResultCode()); if (retryResult != null)
/** * Processes the provided delete request. * * @param deleteRequest The delete request to be processed. It must not be * {@code null}. * * @return The result of processing the delete operation. * * @throws LDAPException If the server rejects the delete request, or if a * problem is encountered while sending the request or * reading the response. */ public LDAPResult delete(final DeleteRequest deleteRequest) throws LDAPException { ensureNotNull(deleteRequest); final LDAPResult ldapResult = deleteRequest.process(this, 1); switch (ldapResult.getResultCode().intValue()) { case ResultCode.SUCCESS_INT_VALUE: case ResultCode.NO_OPERATION_INT_VALUE: return ldapResult; default: throw new LDAPException(ldapResult); } }
switch (result.getResultCode().intValue()) if (! ResultCode.isConnectionUsable(result.getResultCode())) results.add(new LDAPResult(request.getLastMessageID(), le.getResultCode(), le.getMessage(), le.getMatchedDN(), le.getReferralURLs(),
/** * Ensures that the provided LDAP result includes at least one control with * the specified OID. * * @param result The LDAP result to examine. * @param oid The OID of the control which is expected to be present in * the result. * * @return The first control found with the specified OID. * * @throws AssertionError If the provided LDAP result does not include any * control with the specified OID. */ public static Control assertHasControl(final LDAPResult result, final String oid) throws AssertionError { for (final Control c : result.getResponseControls()) { if (c.getOID().equals(oid)) { return c; } } throw new AssertionError(ERR_TEST_RESULT_MISSING_CONTROL.get( String.valueOf(result), oid)); }
/** * Retrieves a string representation of this LDAP result. * * @return A string representation of this LDAP result. */ @Override() public String toString() { final StringBuilder buffer = new StringBuilder(); toString(buffer); return buffer.toString(); }
/** * Ensures that the provided LDAP result does not contain a matched DN value. * * @param result The LDAP result to examine. * * @throws AssertionError If the provided result contained a matched DN * value. */ public static void assertMissingMatchedDN(final LDAPResult result) throws AssertionError { if (result.getMatchedDN() != null) { throw new AssertionError(ERR_TEST_RESULT_CONTAINS_MATCHED_DN.get( String.valueOf(result), result.getMatchedDN())); } }
/** * 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))); } }