Determines whether the result was successful by looking at the response status value contained in the result.

@param result
May contain token secrets, so has been annotated as @Sensitive.
@param endpoint
@return
976940
protected boolean isSuccessfulResult(@Sensitive Map<String, Object> result, String endpoint) {
        if (result == null) {
            Tr.error(tc, "TWITTER_ERROR_OBTAINING_ENDPOINT_RESULT", new Object[] { endpoint });
            return false;
        }
        String responseStatus = result.containsKey(TwitterConstants.RESULT_RESPONSE_STATUS) ? (String) result.get(TwitterConstants.RESULT_RESPONSE_STATUS) : null;
        String responseMsg = result.containsKey(TwitterConstants.RESULT_MESSAGE) ? (String) result.get(TwitterConstants.RESULT_MESSAGE) : null;

        if (responseStatus == null) {
            Tr.error(tc, "TWITTER_RESPONSE_STATUS_MISSING", new Object[] { endpoint });
            return false;
        }

        if (!responseStatus.equals(TwitterConstants.RESULT_SUCCESS)) {
            Tr.error(tc, "TWITTER_RESPONSE_FAILURE", new Object[] { endpoint, (responseMsg == null) ? "" : responseMsg });
            return false;
        }

        return true;
    }
1082208
@Override
    public AuthenticationStatus notifyContainerAboutLogin(CredentialValidationResult result) {
        if (CredentialValidationResult.Status.VALID.equals(result.getStatus())) {
            this.result = result;
            return notifyContainerAboutLogin(result.getCallerPrincipal(), result.getCallerGroups());
        }
        return AuthenticationStatus.SEND_FAILURE;
    }
83304
private boolean isError(Object result) {
		if(result != null){
			if(result instanceof BaseResult){
				BaseResult baseResult = (BaseResult)result;
				return !baseResult.isSuccess();
			}else if(result instanceof MchBase){
				MchBase mchBase = (MchBase)result;
				if("FAIL".equalsIgnoreCase(mchBase.getReturn_code())||
				   "FAIL".equalsIgnoreCase(mchBase.getResult_code())){
					return true;
				}
			}
		}
		return false;
	}
536234
protected boolean isMissingParameter(Map<String, String[]> requestParams, String endpoint) {
        if (TwitterConstants.TWITTER_ENDPOINT_ACCESS_TOKEN.equals(endpoint)) {
            // Must have oauth_token and oauth_verifier parameters in order to send request to oauth/access_token endpoint
            if (!requestParams.containsKey(TwitterConstants.PARAM_OAUTH_TOKEN)) {
                Tr.error(tc, "TWITTER_REQUEST_MISSING_PARAMETER", new Object[] { TwitterConstants.TWITTER_ENDPOINT_ACCESS_TOKEN, TwitterConstants.PARAM_OAUTH_TOKEN });
                return true;
            }
            if (!requestParams.containsKey(TwitterConstants.PARAM_OAUTH_VERIFIER)) {
                Tr.error(tc, "TWITTER_REQUEST_MISSING_PARAMETER", new Object[] { TwitterConstants.TWITTER_ENDPOINT_ACCESS_TOKEN, TwitterConstants.PARAM_OAUTH_VERIFIER });
                return true;
            }
        }
        return false;
    }
1152935
private function checkInputs()
    {
        if (!$this->disableInputCheck && !($this->requestId && $this->connectId)) {
            throw new EndpointException("No request ID or connect ID were provided");
        }
        
        $requestId = $this->getParam("request_id");
        $connectId = $this->getParam("connect_id");
        $code = $this->getParam("code");
        $signature = $this->getParam("signature");
        $status = $this->getParam("result");
        
        if (!$this->disableInputCheck) {
          if ($this->requestId != $requestId) {
              throw new EndpointException("Invalid request ID");
          }

          if ($this->connectId != $connectId) {
              throw new EndpointException("Invalid connect ID");
          }
        }
        
        if ($status == self::STATUS_AUTHORIZED) {
          if (!$code) {
            throw new EndpointException("No auth code");
          }
        }
        
        $this->checkSignature(base64_decode($signature, true), $status, $code);
        
        return ($status == self::STATUS_AUTHORIZED);
    }
574572
@Nullable
    public Object getResult(TBase<?, ?> result) throws TException {
        for (TFieldIdEnum fieldIdEnum : exceptionFields()) {
            if (ThriftFieldAccess.isSet(result, fieldIdEnum)) {
                throw (TException) ThriftFieldAccess.get(result, fieldIdEnum);
            }
        }

        final TFieldIdEnum successField = successField();
        if (successField == null) { //void method
            return null;
        } else if (ThriftFieldAccess.isSet(result, successField)) {
            return ThriftFieldAccess.get(result, successField);
        } else {
            throw new TApplicationException(
                    TApplicationException.MISSING_RESULT,
                    result.getClass().getName() + '.' + successField.getFieldName());
        }
    }
217811
boolean isFailure(ExecutionResult result) {
    return failureConditions.isEmpty() ?
        result.getFailure() != null :
        isFailure((R) result.getResult(), result.getFailure());
  }
1305192
@Override
  public FutureResultImpl<T> setResult(T result) {
    this.result = result;
    succeeded = true;
    checkCallHandler();
    return this;
  }
923728
public void requestProcessed (Object result)
    {
        @SuppressWarnings("unchecked") V value = (V)result;
        _sync.innerSet(value);
    }
713869
public static ReplyObject success(final String name, final Object result) {
        final ReplyObject ret = new ReplyObject(name, result);
        ret.success = true;
        return ret;
    }
1098307
public static <T> Response<T> success(T result, Cache.Entry cacheEntry) {
        return new Response<T>(result, cacheEntry);
    }
1207614
protected void verifyCertificateTrust(WSHandlerResult result) throws WSSecurityException {
        List<WSSecurityEngineResult> signResults = result.getActionResults().getOrDefault(WSConstants.SIGN, emptyList());
        if (signResults.isEmpty()) {
            throw new Wss4jSecurityValidationException("No action results for 'Perform Signature' found");
        } else if (signResults.size() > 1) {
            throw new Wss4jSecurityValidationException("Multiple action results for 'Perform Signature' found. Expected only 1.");
        }
        WSSecurityEngineResult signResult = signResults.get(0);

        if (signResult != null) {
            X509Certificate returnCert =
                    (X509Certificate) signResult.get(WSSecurityEngineResult.TAG_X509_CERTIFICATE);
            Credential credential = new Credential();
            credential.setCertificates(new X509Certificate[]{returnCert});

            RequestData requestData = new RequestData();
            requestData.setSigVerCrypto(validationSignatureCrypto);
            requestData.setEnableRevocation(enableRevocation);
            requestData.setSubjectCertConstraints(OrgnummerExtractor.PATTERNS);

            SignatureTrustValidator validator = new SignatureTrustValidator();
            validator.validate(credential, requestData);
        }
    }
343419
public SensitiveWordStatusResult getSensitiveWordStatus() throws APIConnectionException, APIRequestException {
        ResponseWrapper responseWrapper = _httpClient.sendGet(_baseUrl + sensitiveWordPath + "/status");
        return _gson.fromJson(responseWrapper.responseContent, SensitiveWordStatusResult.class);
    }
6830
public SparqlResult runQuery(String endpoint, String query) {
    return SparqlClient.execute(endpoint, query, username, password);
  }
998405
public static Tag outcome(ContainerResponse response) {
        if (response != null) {
            int status = response.getStatus();
            switch (Response.Status.Family.familyOf(status)) {
                case INFORMATIONAL:
                    return OUTCOME_INFORMATIONAL;

                case SUCCESSFUL:
                    return OUTCOME_SUCCESS;

                case REDIRECTION:
                    return OUTCOME_REDIRECTION;

                case CLIENT_ERROR:
                    return OUTCOME_CLIENT_ERROR;

                case SERVER_ERROR:
                    return OUTCOME_SERVER_ERROR;

                default:
                    return OUTCOME_UNKNOWN;
            }
        }
        /* In case there is no response we are dealing with an unmapped exception. */
        return OUTCOME_SERVER_ERROR;
    }
735368
private void disposeSignInResult(SignInResult result) {
        if (result == null) {
            HMSAgentLog.e("result is null");
            onSignInResult(HMSAgent.AgentResultCode.RESULT_IS_NULL, null);
            return;
        }

        Status status = result.getStatus();
        if (status == null) {
            HMSAgentLog.e("status is null");
            onSignInResult(HMSAgent.AgentResultCode.STATUS_IS_NULL, null);
            return;
        }

        int rstCode = status.getStatusCode();
        HMSAgentLog.d("status=" + status);
        // 需要重试的错误码，并且可以重试
        if ((rstCode == CommonCode.ErrorCode.SESSION_INVALID
                || rstCode == CommonCode.ErrorCode.CLIENT_API_INVALID) && retryTimes > 0) {
            retryTimes--;
            connect();
        } else {
            disposeObtainedResult(result, rstCode);
        }
    }
37887
protected void success(T result) {
    this.result = result;
    this.completed = true;
    for (Callback<T, E> callback : toBeNotified) {
      callback.success(result);
    }
  }