/** * {@inheritDoc} */ @Override() public WhoAmIExtendedResult process(final LDAPConnection connection, final int depth) throws LDAPException { final ExtendedResult extendedResponse = super.process(connection, depth); return new WhoAmIExtendedResult(extendedResponse); }
/** * Creates a new "Who Am I?" extended result with the provided information. * * @param messageID The message ID for the LDAP message that is * associated with this LDAP result. * @param resultCode The result code from the response. * @param diagnosticMessage The diagnostic message from the response, if * available. * @param matchedDN The matched DN from the response, if available. * @param referralURLs The set of referral URLs from the response, if * available. * @param authorizationID The authorization ID for this response, if * available. * @param responseControls The set of controls from the response, if * available. */ public WhoAmIExtendedResult(final int messageID, final ResultCode resultCode, final String diagnosticMessage, final String matchedDN, final String[] referralURLs, final String authorizationID, final Control[] responseControls) { super(messageID, resultCode, diagnosticMessage, matchedDN, referralURLs, null, encodeValue(authorizationID), responseControls); this.authorizationID = authorizationID; }
buffer.append(getResultCode()); final int messageID = getMessageID(); if (messageID >= 0) final String diagnosticMessage = getDiagnosticMessage(); if (diagnosticMessage != null) final String matchedDN = getMatchedDN(); if (matchedDN != null) final String[] referralURLs = getReferralURLs(); if (referralURLs.length > 0) final Control[] responseControls = getResponseControls(); if (responseControls.length > 0)
if (whoAmIResult.getResultCode() != ResultCode.SUCCESS) throw new LDAPException(whoAmIResult.getResultCode(), ERR_MOVE_SUBTREE_ERROR_INVOKING_WHO_AM_I.get(connectionName, whoAmIResult.getDiagnosticMessage())); final String authzID = whoAmIResult.getAuthorizationID(); if ((authzID != null) && authzID.startsWith("dn:"))
/** * {@inheritDoc} */ @Override() public ExtendedResult processExtendedOperation( final InMemoryRequestHandler handler, final int messageID, final ExtendedRequest request) { // This extended operation handler does not support any controls. If the // request has any critical controls, then reject it. for (final Control c : request.getControls()) { if (c.isCritical()) { return new ExtendedResult(messageID, ResultCode.UNAVAILABLE_CRITICAL_EXTENSION, ERR_WHO_AM_I_EXTOP_UNSUPPORTED_CONTROL.get(c.getOID()), null, null, null, null, null); } } final String authorizationID = "dn:" + handler.getAuthenticatedDN().toString(); return new WhoAmIExtendedResult(messageID, ResultCode.SUCCESS, null, null, null, authorizationID, null); } }