SNSLogWriter.java 文件源码

java
阅读 23 收藏 0 点赞 0 评论 0

项目:log4j-aws-appenders 作者:
/**
 *  Attempts to find the configured topicName in the list of topics for
 *  the current account. If successful, configures the writer and returns
 *  true. If unsucessful, attempts to create the topic and configure as
 *  above.
 */
private boolean configureByName()
{
    if (! Pattern.matches(SNSConstants.TOPIC_NAME_REGEX, config.topicName))
    {
        return initializationFailure("invalid topic name: " + config.topicName, null);
    }

    topicArn = retrieveAllTopicsByName().get(config.topicName);
    if (topicArn != null)
    {
        return true;
    }
    else
    {
        LogLog.debug("creating SNS topic: " + config.topicName);
        CreateTopicResult response = client.createTopic(config.topicName);
        topicArn = response.getTopicArn();
        return true;
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号