本文整理汇总了Java中org.graylog2.plugin.streams.Stream.getId方法的典型用法代码示例。如果您正苦于以下问题:Java Stream.getId方法的具体用法?Java Stream.getId怎么用?Java Stream.getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.graylog2.plugin.streams.Stream
的用法示例。
在下文中一共展示了Stream.getId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildStreamURL
import org.graylog2.plugin.streams.Stream; //导入方法依赖的package包/类
/**
* Build stream URL string
* @param baseUrl
* @param stream
* @return
*/
protected String buildStreamURL (final String configURL, final Stream stream) {
String baseUrl = configURL;
if (!baseUrl.endsWith("/")) {
baseUrl += "/";
}
return baseUrl + "streams/" + stream.getId() + "/messages?q=*&rangetype=relative&relative=3600";
}
示例2: formatAlarmNotification
import org.graylog2.plugin.streams.Stream; //导入方法依赖的package包/类
private String formatAlarmNotification(final Stream stream, final AlertCondition.CheckResult result) {
return "Graylog alert for stream <" + stream.getTitle() + ">\n\n"
+ "Date: " + result.getTriggeredAt() + "\n"
+ "Stream ID: " + stream.getId() + "\n"
+ "Stream title: " + stream.getTitle() + "\n"
+ "Triggered condition: " + result.getTriggeredCondition() + "\n";
}
示例3: buildStreamLink
import org.graylog2.plugin.streams.Stream; //导入方法依赖的package包/类
protected String buildStreamLink(String baseUrl, Stream stream) {
if (!baseUrl.endsWith("/")) {
baseUrl = baseUrl + "/";
}
return baseUrl + "streams/" + stream.getId() + "/messages?q=%2A&rangetype=relative&relative=3600";
}
示例4: buildStreamDetailsURL
import org.graylog2.plugin.streams.Stream; //导入方法依赖的package包/类
public static String buildStreamDetailsURL(URI baseUri, AlertCondition.CheckResult checkResult, Stream stream) throws AlarmCallbackException {
if (baseUri != null && !Strings.isNullOrEmpty(baseUri.getHost())) {
int time = 5;
if (checkResult.getTriggeredCondition().getParameters().get("time") != null) {
time = ((Integer) checkResult.getTriggeredCondition().getParameters().get("time")).intValue();
}
DateTime dateAlertEnd = checkResult.getTriggeredAt();
DateTime dateAlertStart = dateAlertEnd.minusMinutes(time);
String alertStart = Tools.getISO8601String(dateAlertStart);
String alertEnd = Tools.getISO8601String(dateAlertEnd);
return baseUri + "/streams/" + stream.getId() + "/messages?rangetype=absolute&from=" + alertStart + "&to=" + alertEnd + "&q=*";
} else {
throw new AlarmCallbackException("Please configure a valid Graylog Base URL in the alarm callback parameters.");
}
}
示例5: buildStreamURL
import org.graylog2.plugin.streams.Stream; //导入方法依赖的package包/类
protected String buildStreamURL(String baseUrl, Stream stream) {
if (!baseUrl.endsWith("/")) {
baseUrl += "/";
}
return baseUrl + "streams/" + stream.getId() + "/messages?q=*&rangetype=relative&relative=3600";
}