当前位置: 首页>>代码示例>>Java>>正文


Java Configuration.getBoolean方法代码示例

本文整理汇总了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;
}
 
开发者ID:graylog-labs,项目名称:graylog-plugin-internal-logs,代码行数:25,代码来源:SerializedLogEventCodec.java

示例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);
}
 
开发者ID:Graylog2,项目名称:graylog-plugin-cef,代码行数:18,代码来源:CEFCodec.java

示例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;
}
 
开发者ID:graylog-labs,项目名称:graylog-plugin-jabber,代码行数:36,代码来源:JabberAlarmCallback.java

示例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)
    );
}
 
开发者ID:graylog-labs,项目名称:graylog-plugin-slack,代码行数:12,代码来源:SlackPluginBase.java

示例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();
}
 
开发者ID:graylog-labs,项目名称:graylog-plugin-mongodb-profiler,代码行数:43,代码来源:MongoDBProfilerTransport.java


注:本文中的org.graylog2.plugin.configuration.Configuration.getBoolean方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。