本文整理汇总了Java中org.graylog2.plugin.alarms.callbacks.AlarmCallbackConfigurationException类的典型用法代码示例。如果您正苦于以下问题:Java AlarmCallbackConfigurationException类的具体用法?Java AlarmCallbackConfigurationException怎么用?Java AlarmCallbackConfigurationException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AlarmCallbackConfigurationException类属于org.graylog2.plugin.alarms.callbacks包,在下文中一共展示了AlarmCallbackConfigurationException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initialize
import org.graylog2.plugin.alarms.callbacks.AlarmCallbackConfigurationException; //导入依赖的package包/类
@Override
public void initialize(Map<String, String> config)
throws AlarmCallbackConfigurationException {
if (config == null) {
throw new AlarmCallbackConfigurationException(
"Configuration not finished.");
} else if (!config.containsKey("senderHostName")
|| config.get("senderHostName").isEmpty()) {
throw new AlarmCallbackConfigurationException(
"Required config parameter senderHostName is missing.");
} else if (!config.containsKey("host") || config.get("host").isEmpty()) {
throw new AlarmCallbackConfigurationException(
"Required config parameter host is missing.");
}
this.senderHostName = config.get("senderHostName");
this.host = config.get("host");
}
开发者ID:frederikhappel,项目名称:graylog2-plugin-alarmcallback-nsca,代码行数:19,代码来源:NscaAlarmCallback.java
示例2: initialize
import org.graylog2.plugin.alarms.callbacks.AlarmCallbackConfigurationException; //导入依赖的package包/类
@Override
public void initialize(final Configuration config) throws AlarmCallbackConfigurationException {
this.configuration = config;
try {
checkConfiguration(config);
} catch (ConfigurationException e) {
throw new AlarmCallbackConfigurationException("Configuration error. " + e.getMessage());
}
}
开发者ID:tjackiw,项目名称:graylog-plugin-jira,代码行数:10,代码来源:JiraAlarmCallback.java
示例3: testGetAttributes
import org.graylog2.plugin.alarms.callbacks.AlarmCallbackConfigurationException; //导入依赖的package包/类
@Test
public void testGetAttributes() throws AlarmCallbackConfigurationException {
alarmCallback.initialize(configuration);
final Map<String, Object> attributes = alarmCallback.getAttributes();
assertThat(attributes.keySet(), hasItems("project_key", "labels", "issue_type", "components", "instance_url", "username", "password", "graylog_url", "priority"));
assertThat((String) attributes.get("password"), equalTo("****"));
}
开发者ID:tjackiw,项目名称:graylog-plugin-jira,代码行数:9,代码来源:JiraAlarmCallbackTest.java
示例4: checkConfigurationFailsIfInstanceUrlIsMissing
import org.graylog2.plugin.alarms.callbacks.AlarmCallbackConfigurationException; //导入依赖的package包/类
@Test(expected = AlarmCallbackConfigurationException.class)
public void checkConfigurationFailsIfInstanceUrlIsMissing() throws AlarmCallbackConfigurationException, ConfigurationException {
Map<String, Object> config = new HashMap<String, Object>();
config.put("project_key", "TEST");
alarmCallback.initialize(new Configuration(config));
alarmCallback.checkConfiguration();
}
开发者ID:tjackiw,项目名称:graylog-plugin-jira,代码行数:8,代码来源:JiraAlarmCallbackTest.java
示例5: initialize
import org.graylog2.plugin.alarms.callbacks.AlarmCallbackConfigurationException; //导入依赖的package包/类
@Override
public void initialize(final Configuration configuration) throws AlarmCallbackConfigurationException
{
try
{
String s = "*** " + DF_PLUGIN_NAME + "::initialize()";
LOG.debug(s);
_configuration = configuration;
_isRunning = true;
LOG.trace("DF_SCRIPT_ENGINE : %s\r\n", _configuration.getString("DF_SCRIPT_ENGINE"));
LOG.trace("DF_SCRIPT_PATH_AND_NAME : %s\r\n", _configuration.getString("DF_SCRIPT_PATH_AND_NAME"));
LOG.trace("DF_DISPLAY_SCRIPT_OUTPUT : %b\r\n", _configuration.getBoolean("DF_DISPLAY_SCRIPT_OUTPUT"));
LOG.trace("DF_SCRIPT_CACHE_CONTENTS : %b\r\n", _configuration.getBoolean("DF_SCRIPT_CACHE_CONTENTS"));
_file = new File(_configuration.getString("DF_SCRIPT_PATH_AND_NAME"));
_scriptEngine = _scriptEngineManager.getEngineByName(_configuration.getString("DF_SCRIPT_ENGINE"));
if(null == _scriptEngine)
{
throw new AlarmCallbackConfigurationException(String.format("%s: Unsupported script engine.", _configuration.getString("DF_SCRIPT_ENGINE")));
}
_scriptContext = _scriptEngine.getContext();
}
catch(Exception ex)
{
_isRunning = false;
LOG.error("*** " + DF_PLUGIN_NAME + "::write() - Exception");
ex.printStackTrace();
throw ex;
}
}
开发者ID:dfch,项目名称:biz.dfch.j.graylog2.plugin.alarm.execscript,代码行数:35,代码来源:dfchBizExecScript.java
示例6: testGetAttributes
import org.graylog2.plugin.alarms.callbacks.AlarmCallbackConfigurationException; //导入依赖的package包/类
@Test
public void testGetAttributes() throws AlarmCallbackConfigurationException {
final Configuration configuration = new Configuration(VALID_CONFIG_SOURCE);
alarmCallback.initialize(configuration);
final Map<String, Object> attributes = alarmCallback.getAttributes();
assertThat(attributes.keySet(), hasItems("rundeck_url", "job_id", "api_token", "args",
"filter_include", "filter_exclude", "exclude_precedence"));
assertThat((String) attributes.get("api_token"), equalTo("****"));
}
开发者ID:graylog-labs,项目名称:graylog-plugin-rundeck,代码行数:11,代码来源:RundeckAlarmCallbackTest.java
示例7: checkConfigurationFailsIfArgsContainsInvalidCharacters
import org.graylog2.plugin.alarms.callbacks.AlarmCallbackConfigurationException; //导入依赖的package包/类
@Test(expected = ConfigurationException.class)
public void checkConfigurationFailsIfArgsContainsInvalidCharacters()
throws AlarmCallbackConfigurationException, ConfigurationException {
final Map<String, Object> configSource = ImmutableMap.<String, Object>builder()
.put("job_id", "TEST-job-id")
.put("api_token", "TEST_api_token")
.put("args", "&-invalid arg")
.build();
alarmCallback.initialize(new Configuration(configSource));
alarmCallback.checkConfiguration();
}
开发者ID:graylog-labs,项目名称:graylog-plugin-rundeck,代码行数:13,代码来源:RundeckAlarmCallbackTest.java
示例8: checkConfigurationFailsIfFieldArgsContainsInvalidCharacters
import org.graylog2.plugin.alarms.callbacks.AlarmCallbackConfigurationException; //导入依赖的package包/类
@Test(expected = ConfigurationException.class)
public void checkConfigurationFailsIfFieldArgsContainsInvalidCharacters()
throws AlarmCallbackConfigurationException, ConfigurationException {
final Map<String, Object> configSource = ImmutableMap.<String, Object>builder()
.put("job_id", "TEST-job-id")
.put("api_token", "TEST_api_token")
.put("field_args", "&-invalid field arg")
.build();
alarmCallback.initialize(new Configuration(configSource));
alarmCallback.checkConfiguration();
}
开发者ID:graylog-labs,项目名称:graylog-plugin-rundeck,代码行数:13,代码来源:RundeckAlarmCallbackTest.java
示例9: checkConfigurationFailsIfUsernameContainsInvalidCharacters
import org.graylog2.plugin.alarms.callbacks.AlarmCallbackConfigurationException; //导入依赖的package包/类
@Test(expected = ConfigurationException.class)
public void checkConfigurationFailsIfUsernameContainsInvalidCharacters()
throws AlarmCallbackConfigurationException, ConfigurationException {
final Map<String, Object> configSource = ImmutableMap.<String, Object>builder()
.put("job_id", "TEST-job-id")
.put("api_token", "TEST_api_token")
.put("as_user", "invalid&user")
.build();
alarmCallback.initialize(new Configuration(configSource));
alarmCallback.checkConfiguration();
}
开发者ID:graylog-labs,项目名称:graylog-plugin-rundeck,代码行数:13,代码来源:RundeckAlarmCallbackTest.java
示例10: checkConfigurationFailsIfRundeckUrlIsInvalid
import org.graylog2.plugin.alarms.callbacks.AlarmCallbackConfigurationException; //导入依赖的package包/类
@Test(expected = ConfigurationException.class)
public void checkConfigurationFailsIfRundeckUrlIsInvalid()
throws AlarmCallbackConfigurationException, ConfigurationException {
final Map<String, Object> configSource = ImmutableMap.<String, Object>builder()
.put("job_id", "TEST-job-id")
.put("api_token", "TEST_api_token")
.put("rundeck_url", "Definitely$$Not#A!!URL")
.build();
alarmCallback.initialize(new Configuration(configSource));
alarmCallback.checkConfiguration();
}
开发者ID:graylog-labs,项目名称:graylog-plugin-rundeck,代码行数:13,代码来源:RundeckAlarmCallbackTest.java
示例11: checkConfigurationFailsIfRundeckUrlIsNotHttpOrHttps
import org.graylog2.plugin.alarms.callbacks.AlarmCallbackConfigurationException; //导入依赖的package包/类
@Test(expected = ConfigurationException.class)
public void checkConfigurationFailsIfRundeckUrlIsNotHttpOrHttps()
throws AlarmCallbackConfigurationException, ConfigurationException {
final Map<String, Object> configSource = ImmutableMap.<String, Object>builder()
.put("job_id", "TEST-job-id")
.put("api_token", "TEST_api_token")
.put("rundeck_url", "ftp://example.net")
.build();
alarmCallback.initialize(new Configuration(configSource));
alarmCallback.checkConfiguration();
}
开发者ID:graylog-labs,项目名称:graylog-plugin-rundeck,代码行数:13,代码来源:RundeckAlarmCallbackTest.java
示例12: initialize
import org.graylog2.plugin.alarms.callbacks.AlarmCallbackConfigurationException; //导入依赖的package包/类
@Override
public void initialize(final Configuration config) throws AlarmCallbackConfigurationException {
try {
super.setConfiguration(config);
} catch (ConfigurationException e) {
throw new AlarmCallbackConfigurationException("Configuration error. " + e.getMessage());
}
}
开发者ID:graylog-labs,项目名称:graylog-plugin-slack,代码行数:9,代码来源:SlackAlarmCallback.java
示例13: testGetAttributes
import org.graylog2.plugin.alarms.callbacks.AlarmCallbackConfigurationException; //导入依赖的package包/类
@Test
public void testGetAttributes() throws AlarmCallbackConfigurationException {
final Configuration configuration = new Configuration(VALID_CONFIG_SOURCE);
alarmCallback.initialize(configuration);
final Map<String, Object> attributes = alarmCallback.getAttributes();
assertThat(attributes.keySet(), hasItems("webhook_url", "channel", "user_name",
"notify_channel", "link_names", "icon_url", "icon_emoji", "graylog2_url", "color"));
}
开发者ID:graylog-labs,项目名称:graylog-plugin-slack,代码行数:10,代码来源:SlackAlarmCallbackTest.java
示例14: testInitialize
import org.graylog2.plugin.alarms.callbacks.AlarmCallbackConfigurationException; //导入依赖的package包/类
@Test
public void testInitialize() throws AlarmCallbackConfigurationException {
final Configuration configuration = new Configuration(ImmutableMap.<String, Object>of(
"api_token", "TEST_api_token",
"room", "TEST_room",
"color", "yellow",
"notify", true
));
alarmCallback.initialize(configuration);
}
开发者ID:graylog-labs,项目名称:graylog-plugin-hipchat,代码行数:11,代码来源:HipChatAlarmCallbackTest.java
示例15: testGetAttributes
import org.graylog2.plugin.alarms.callbacks.AlarmCallbackConfigurationException; //导入依赖的package包/类
@Test
public void testGetAttributes() throws AlarmCallbackConfigurationException {
final Configuration configuration = new Configuration(ImmutableMap.<String, Object>of(
"api_token", "TEST_api_token",
"room", "TEST_room",
"color", "yellow",
"notify", true
));
alarmCallback.initialize(configuration);
final Map<String, Object> attributes = alarmCallback.getAttributes();
assertThat(attributes.keySet(), hasItems("api_token", "room", "color", "notify"));
assertThat((String) attributes.get("api_token"), equalTo("****"));
}
开发者ID:graylog-labs,项目名称:graylog-plugin-hipchat,代码行数:15,代码来源:HipChatAlarmCallbackTest.java
示例16: checkConfigurationSucceedsWithValidConfiguration
import org.graylog2.plugin.alarms.callbacks.AlarmCallbackConfigurationException; //导入依赖的package包/类
@Test
public void checkConfigurationSucceedsWithValidConfiguration()
throws AlarmCallbackConfigurationException, ConfigurationException {
final Configuration configuration = new Configuration(ImmutableMap.<String, Object>of(
"api_token", "TEST_api_token",
"room", "TEST_room",
"color", "yellow",
"notify", true
));
alarmCallback.initialize(configuration);
alarmCallback.checkConfiguration();
}
开发者ID:graylog-labs,项目名称:graylog-plugin-hipchat,代码行数:14,代码来源:HipChatAlarmCallbackTest.java
示例17: checkConfigurationFailsIfApiTokenIsMissing
import org.graylog2.plugin.alarms.callbacks.AlarmCallbackConfigurationException; //导入依赖的package包/类
@Test(expected = ConfigurationException.class)
public void checkConfigurationFailsIfApiTokenIsMissing()
throws AlarmCallbackConfigurationException, ConfigurationException {
final Configuration configuration = new Configuration(ImmutableMap.<String, Object>of(
"room", "TEST_room"
));
alarmCallback.initialize(configuration);
alarmCallback.checkConfiguration();
}
开发者ID:graylog-labs,项目名称:graylog-plugin-hipchat,代码行数:10,代码来源:HipChatAlarmCallbackTest.java
示例18: checkConfigurationFailsIfRoomIsMissing
import org.graylog2.plugin.alarms.callbacks.AlarmCallbackConfigurationException; //导入依赖的package包/类
@Test(expected = ConfigurationException.class)
public void checkConfigurationFailsIfRoomIsMissing()
throws AlarmCallbackConfigurationException, ConfigurationException {
final Configuration configuration = new Configuration(ImmutableMap.<String, Object>of(
"api_token", "TEST_api_token"
));
alarmCallback.initialize(configuration);
alarmCallback.checkConfiguration();
}
开发者ID:graylog-labs,项目名称:graylog-plugin-hipchat,代码行数:10,代码来源:HipChatAlarmCallbackTest.java
示例19: checkConfigurationFailsIfRoomIsTooLong
import org.graylog2.plugin.alarms.callbacks.AlarmCallbackConfigurationException; //导入依赖的package包/类
@Test(expected = ConfigurationException.class)
public void checkConfigurationFailsIfRoomIsTooLong()
throws AlarmCallbackConfigurationException, ConfigurationException {
final Configuration configuration = new Configuration(ImmutableMap.<String, Object>of(
"api_token", "TEST_api_token",
"room", Strings.repeat("a", 101)
));
alarmCallback.initialize(configuration);
alarmCallback.checkConfiguration();
}
开发者ID:graylog-labs,项目名称:graylog-plugin-hipchat,代码行数:11,代码来源:HipChatAlarmCallbackTest.java
示例20: checkConfigurationFailsIfColorIsInvalid
import org.graylog2.plugin.alarms.callbacks.AlarmCallbackConfigurationException; //导入依赖的package包/类
@Test(expected = ConfigurationException.class)
public void checkConfigurationFailsIfColorIsInvalid()
throws AlarmCallbackConfigurationException, ConfigurationException {
final Configuration configuration = new Configuration(ImmutableMap.<String, Object>of(
"api_token", "TEST_api_token",
"room", "TEST_room",
"color", "INVALID"
));
alarmCallback.initialize(configuration);
alarmCallback.checkConfiguration();
}
开发者ID:graylog-labs,项目名称:graylog-plugin-hipchat,代码行数:12,代码来源:HipChatAlarmCallbackTest.java
注:本文中的org.graylog2.plugin.alarms.callbacks.AlarmCallbackConfigurationException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论