APISonar


com.linkedin.cruisecontrol.servlet.parameters.CruiseControlParameters.json

> com > linkedin > cruisecontrol > servlet > parameters > CruiseControlParameters > json
com APIs linkedin APIs cruisecontrol APIs servlet APIs parameters APIs CruiseControlParameters APIs json APIs

Example 1
public void writeSuccessResponse(CruiseControlParameters parameters, HttpServletResponse response) throws IOException {
    boolean json = parameters.json();
    discardIrrelevantResponse(parameters);
    writeResponseToOutputStream(response, SC_OK, json, _cachedResponse, _config);
  }
Example 2
protected void discardIrrelevantAndCacheRelevant(CruiseControlParameters parameters) {
    // Cache relevant response.
    String message = "Metric sampling paused.";
    _cachedResponse = parameters.json() ? getBaseJSONString(message) : message;
  }
Example 3
public void discardIrrelevantResponse(CruiseControlParameters parameters) {
    if (_cachedJSONResponse == null || _cachedPlainTextResponse == null) {
      discardIrrelevantAndCacheRelevant(parameters);
      if (_cachedJSONResponse == null || _cachedPlainTextResponse == null) {
        throw new IllegalStateException("Failed to cache the relevant response.");
      }
    }
    _cachedResponse = parameters.json() ? _cachedJSONResponse : _cachedPlainTextResponse;
  }
Example 4
protected void discardIrrelevantAndCacheRelevant(CruiseControlParameters parameters) {
    // Cache relevant response.
    _cachedResponse = parameters.json() ? getJSONString() : getPlaintext();
    // Discard irrelevant response.
    _selfHealingEnabledBefore.clear();
    _selfHealingEnabledAfter.clear();
    _ongoingConcurrencyChangeRequest = null;
    _dropRecentBrokersRequest = null;
  }