Formats query.

@param alert {@link net.anotheria.moskito.core.threshold.alerts.ThresholdAlert}
@return query
1792
private String formatQuery(final ThresholdAlert alert) {
        return String.format(SMS_QUERY_FORMAT, user, password, createMessage(alert, smsTemplate), recipients); // TODO: improve not to replace user/password/etc every time
    }
230216
public Collection<AlertCondition> list(Entity entity)
    {
        return list(entity.getId(), entity.getType());
    }
599383
@Override
    public void alertISOpen() {
        if (TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {  
            logger.logp(Level.FINE, CLASS_NAME,"alertISOpen()", "");
        }
        if (WCCustomProperties.CHECK_REQUEST_OBJECT_IN_USE){
            checkRequestObjectInUse();
        }
        _srtRequestHelper._InputStreamClosed=false;
        this.releaseInputStream();
        this.releaseReader();
    }
1220471
def get_alert_log(self,
                      current=0,
                      minimum=0,
                      maximum=100,
                      header="",
                      action_key=None):
        """"""
        return self.get_alert(current=current,
                              minimum=minimum,
                              maximum=maximum,
                              header=header,
                              action_key=action_key,
                              log=True)
153306
public Optional<AlertCondition> create(long policyId, AlertCondition condition)
    {
        return HTTP.POST(String.format("/v2/alerts_conditions/policies/%d.json", policyId), condition, ALERT_CONDITION);
    }
1058774
public static String toPlainText(ThresholdAlert thresholdAlert) {
        String text = "Threshold alert:\n";
        text += "Timestamp: "+thresholdAlert.getTimestamp()+ '\n';
        text += "ISO Timestamp: "+ NumberUtils.makeISO8601TimestampString(thresholdAlert.getTimestamp())+ '\n';
        text += "Threshold: "+thresholdAlert.getThreshold().getName()+ '\n';
        text += "OldStatus: "+thresholdAlert.getOldStatus()+ '\n';
        text += "NewStatus: "+thresholdAlert.getNewStatus()+ '\n';
        text += "OldValue: "+thresholdAlert.getOldValue()+ '\n';
        text += "NewValue: "+thresholdAlert.getNewValue()+ '\n';
        return text;
    }
696533
@NonNull
    public Searcher setQuery(@NonNull Query query) {
        this.query = query;
        this.query.setPage(0);
        return this;
    }
1320519
public void acceptAlert() {
        String action = "Clicking 'OK' on an alert";
        String expected = "Alert is present to be clicked";
        // wait for element to be present
        if (!is.alertPresent()) {
            waitFor.alertPresent();
        }
        if (!is.alertPresent()) {
            reporter.fail(action, expected, "Unable to click alert as it is not present");
            return; // indicates element not present
        }
        accept(action, expected, "alert");
    }
398307
private JSONObject getOrAddCustomAlert() throws JSONException {
		JSONObject alert = getCompatibleProperty("alert", JSONObject.class, "A simple alert (\"%s\") was already added to this payload");
		if (alert == null) {
			alert = new JSONObject();
			put("alert", alert, this.apsDictionary, false);
		}
		return alert;
	}
213832
public static Optional<ButtonType> alert(String title, String content) {
        return alert(title, null, content);
    }
927930
public Collection<AlertChannel> list(List<String> queryParams)
    {
        return HTTP.GET("/v2/alerts_channels.json", null, queryParams, ALERT_CHANNELS).get();
    }
1114134
@Override
	public synchronized RecordAlert read(int alertId) throws DatabaseException {
        try {
			psRead.setInt(1, alertId);
			try (ResultSet rs = psRead.executeQuery()) {
				RecordAlert ra = build(rs);
				return ra;
			}
		} catch (Exception e) {
			throw new DatabaseException(e);
		}
    }
902317
private <T extends IEntity> IntuitMessage prepareQuery(String query) throws FMSException {
        IntuitMessage intuitMessage = new IntuitMessage();
        RequestElements requestElements = intuitMessage.getRequestElements();

        //set the request params
        Map<String, String> requestParameters = requestElements.getRequestParameters();
        if (query.length() > LENGTH_200) {
            requestParameters.put(RequestElements.REQ_PARAM_METHOD_TYPE, MethodType.POST.toString());
            requestElements.setPostString(query);
        } else {
            requestParameters.put(RequestElements.REQ_PARAM_METHOD_TYPE, MethodType.GET.toString());
            requestParameters.put(RequestElements.REQ_PARAM_QUERY, query);
        }

        requestElements.setAction(OperationType.QUERY.toString());
        requestElements.setContext(context);

        return intuitMessage;
    }
951308
public static Alert getAlert(String title, String header, String content, AlertType alertType) {
        return getAlert(title, header, content, alertType, Modality.APPLICATION_MODAL, null, StageStyle.DECORATED);
    }
369834
public JsonResponse deleteAlert(String email, String alertId) throws IOException {
        Map<String, Object> data = new HashMap<String, Object>();
        data.put(Alert.PARAM_EMAIL, email);
        data.put(Alert.PARAM_ALERT_ID, alertId);
        return apiDelete(ApiAction.alert, data);
    }
75665
public Optional<NrqlAlertCondition> update(NrqlAlertCondition condition)
    {
        return HTTP.PUT(String.format("/v2/alerts_nrql_conditions/%d.json", condition.getId()), condition, NRQL_ALERT_CONDITION);
    }
181120
private boolean _shouldEvaluateAlert(Alert alert, BigInteger alertId) {
		if (alert == null) {
			_logger.warn(MessageFormat.format("Could not find alert ID {0}", alertId));
			return false;
		}
		if(!alert.isEnabled()) {
			_logger.warn(MessageFormat.format("Alert {0} has been disabled. Will not evaluate.", alert.getId().intValue()));
			return false;
		}

		return true;
	}