本文整理汇总了Java中org.graylog2.plugin.configuration.Configuration.getBoolean方法的典型用法代码示例。如果您正苦于以下问题:Java Configuration.getBoolean方法的具体用法?Java Configuration.getBoolean怎么用?Java Configuration.getBoolean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.graylog2.plugin.configuration.Configuration
的用法示例。
在下文中一共展示了Configuration.getBoolean方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SerializedLogEventCodec
import org.graylog2.plugin.configuration.Configuration; //导入方法依赖的package包/类
@Inject
public SerializedLogEventCodec(@Assisted Configuration configuration,
NodeId nodeId,
NodeService nodeService,
ClusterConfigService clusterConfigService) {
super(configuration);
this.includeSource = configuration.getBoolean(CK_INCLUDE_SOURCE, true);
this.includeThreadContext = configuration.getBoolean(CK_INCLUDE_THREAD_CONTEXT, true);
this.includeStackTrace = configuration.getBoolean(CK_INCLUDE_STACK_TRACE, true);
this.includeExceptionCause = configuration.getBoolean(CK_INCLUDE_EXCEPTION_CAUSE, true);
final ClusterId clusterIdBean = clusterConfigService.get(ClusterId.class);
this.clusterId = clusterIdBean == null ? null : clusterIdBean.clusterId();
this.nodeId = nodeId.toString();
String nodeHostname;
try {
final Node node = nodeService.byNodeId(nodeId);
nodeHostname = node.getHostname();
} catch (NodeNotFoundException e) {
nodeHostname = null;
}
this.hostname = nodeHostname;
}
示例2: CEFCodec
import org.graylog2.plugin.configuration.Configuration; //导入方法依赖的package包/类
@AssistedInject
public CEFCodec(@Assisted Configuration configuration) {
this.configuration = configuration;
this.parser = CEFParserFactory.create();
DateTimeZone timezone;
try {
timezone = DateTimeZone.forID(configuration.getString(CK_TIMEZONE));
} catch (Exception e) {
LOG.warn("Could not configure CEF input timezone. Falling back to local default. Please check the error message:", e);
timezone = DateTimeZone.getDefault();
}
this.timezone = timezone;
this.locale = Locale.forLanguageTag(configuration.getString(CK_LOCALE, ""));
this.useFullNames = configuration.getBoolean(CK_USE_FULL_NAMES);
}
示例3: login
import org.graylog2.plugin.configuration.Configuration; //导入方法依赖的package包/类
private XMPPConnection login(final Configuration config) throws IOException, XMPPException, SmackException, KeyManagementException, NoSuchAlgorithmException {
final String serviceName = isNullOrEmpty(config.getString(CK_SERVICE_NAME))
? config.getString(CK_HOSTNAME) : config.getString(CK_SERVICE_NAME);
final XMPPTCPConnectionConfiguration.Builder configBuilder = XMPPTCPConnectionConfiguration.builder()
.setHost(config.getString(CK_HOSTNAME))
.setPort(config.getInt(CK_PORT))
.setServiceName(serviceName)
.setSendPresence(false);
if (config.getBoolean(CK_ACCEPT_SELFSIGNED)) {
TLSUtils.acceptAllCertificates(configBuilder);
}
final boolean requireSecurity = config.getBoolean(CK_REQUIRE_SECURITY);
configBuilder.setSecurityMode(requireSecurity ?
ConnectionConfiguration.SecurityMode.required : ConnectionConfiguration.SecurityMode.ifpossible);
final XMPPTCPConnectionConfiguration connectionConfiguration = configBuilder.build();
if (LOG.isDebugEnabled()) {
LOG.debug("Supported SASL authentications: {}", SASLAuthentication.getRegisterdSASLMechanisms());
LOG.debug("require_security: {}", requireSecurity);
LOG.debug("Security mode: {}", connectionConfiguration.getSecurityMode());
LOG.debug("Socket factory: {}", connectionConfiguration.getSocketFactory());
LOG.debug("Keystore: {}", connectionConfiguration.getKeystorePath());
LOG.debug("Keystore type: {}", connectionConfiguration.getKeystoreType());
}
final XMPPTCPConnection xmppConnection = new XMPPTCPConnection(connectionConfiguration);
xmppConnection.connect();
xmppConnection.login(config.getString(CK_USERNAME), config.getString(CK_PASSWORD));
return xmppConnection;
}
示例4: createSlackMessage
import org.graylog2.plugin.configuration.Configuration; //导入方法依赖的package包/类
protected static SlackMessage createSlackMessage(Configuration configuration, String message) {
return new SlackMessage(
configuration.getString(SlackConfiguration.CK_COLOR),
configuration.getString(SlackConfiguration.CK_ICON_EMOJI),
configuration.getString(SlackConfiguration.CK_ICON_URL),
message,
configuration.getString(SlackConfiguration.CK_USER_NAME),
configuration.getString(SlackConfiguration.CK_CHANNEL),
configuration.getBoolean(SlackConfiguration.CK_LINK_NAMES)
);
}
示例5: launch
import org.graylog2.plugin.configuration.Configuration; //导入方法依赖的package包/类
@Override
public void launch(MessageInput input) throws MisfireException {
serverStatus.awaitRunning(() -> lifecycleStateChange(Lifecycle.RUNNING));
serverEventBus.register(this);
LOG.debug("Launching MongoDB profiler reader.");
final Configuration configuration = input.getConfiguration();
final int port = configuration.getInt(CK_MONGO_PORT);
final MongoClient mongoClient;
final List<MongoCredential> credentialList;
final String db = configuration.getString(CK_MONGO_DB);
if (configuration.getBoolean(CK_MONGO_USE_AUTH)) {
final MongoCredential credentials = MongoCredential.createCredential(
configuration.getString(CK_MONGO_USER),
db,
configuration.getString(CK_MONGO_PW).toCharArray()
);
credentialList = ImmutableList.of(credentials);
} else {
credentialList = ImmutableList.of();
}
final String mongoHost = configuration.getString(CK_MONGO_HOST);
final String[] hosts = mongoHost.split(",");
final List<ServerAddress> replicaHosts = new ArrayList<>(hosts.length);
for (String host : hosts) {
replicaHosts.add(new ServerAddress(host, port));
}
mongoClient = new MongoClient(replicaHosts, credentialList);
// Try the connection.
try {
mongoClient.getDB(db).getStats();
} catch (Exception e) {
throw new MisfireException("Could not verify MongoDB profiler connection.", e);
}
subscriber = new ProfileSubscriber(mongoClient, db, input, localRegistry);
subscriber.start();
}