com.networknt.config.Config.getJsonMapConfigNoCache()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(226)

本文整理了Java中com.networknt.config.Config.getJsonMapConfigNoCache()方法的一些代码示例,展示了Config.getJsonMapConfigNoCache()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Config.getJsonMapConfigNoCache()方法的具体详情如下:
包路径:com.networknt.config.Config
类名称:Config
方法名:getJsonMapConfigNoCache

Config.getJsonMapConfigNoCache介绍

暂无

代码示例

代码示例来源:origin: networknt/light-4j

@Override
  public void register() {
    // As passwords are in the config file, we need to mask them.
    List<String> masks = new ArrayList<>();
    masks.add("");
    ModuleRegistry.registerModule(BasicAuthHandler.class.getName(), Config.getInstance().getJsonMapConfigNoCache(CONFIG_NAME), null);
  }
}

代码示例来源:origin: networknt/light-4j

@Override
public void register() {
  ModuleRegistry.registerModule(DumpHandler.class.getName(), Config.getInstance().getJsonMapConfigNoCache(CONFIG_NAME), null);
}

代码示例来源:origin: networknt/light-4j

@Override
public void register() {
  ModuleRegistry.registerModule(MetricsHandler.class.getName(), Config.getInstance().getJsonMapConfigNoCache(CONFIG_NAME), null);
}

代码示例来源:origin: networknt/light-4j

@Override
  public void register() {
    ModuleRegistry.registerModule(LimitHandler.class.getName(), Config.getInstance().getJsonMapConfigNoCache(CONFIG_NAME), null);
  }
}

代码示例来源:origin: networknt/light-4j

@Override
public void register() {
  ModuleRegistry.registerModule(SanitizerHandler.class.getName(), Config.getInstance().getJsonMapConfigNoCache(CONFIG_NAME), null);
}

代码示例来源:origin: networknt/light-4j

@Override
public void register() {
  ModuleRegistry.registerModule(TraceabilityHandler.class.getName(), Config.getInstance().getJsonMapConfigNoCache(CONFIG_NAME), null);
}

代码示例来源:origin: networknt/light-4j

@Override
public void register() {
  ModuleRegistry.registerModule(ExceptionHandler.class.getName(), Config.getInstance().getJsonMapConfigNoCache(CONFIG_NAME), null);
}

代码示例来源:origin: networknt/light-4j

@Override
public void register() {
  ModuleRegistry.registerModule(CorrelationHandler.class.getName(), Config.getInstance().getJsonMapConfigNoCache(CONFIG_NAME), null);
}

代码示例来源:origin: networknt/light-4j

@Override
  public void register() {
    ModuleRegistry.registerModule(HeaderHandler.class.getName(), Config.getInstance().getJsonMapConfigNoCache(CONFIG_NAME), null);
  }
}

代码示例来源:origin: networknt/light-4j

@Override
  public void register() {
    ModuleRegistry.registerModule(BodyHandler.class.getName(), Config.getInstance().getJsonMapConfigNoCache(CONFIG_NAME), null);
  }
}

代码示例来源:origin: networknt/light-4j

@Override
public void register() {
  ModuleRegistry.registerModule(RequestDecodeHandler.class.getName(), Config.getInstance().getJsonMapConfigNoCache(RequestDecodeConfig.CONFIG_NAME), null);
}

代码示例来源:origin: networknt/light-4j

@Override
public void register() {
 ModuleRegistry.registerModule(ContentConfig.class.getName(), Config.getInstance().getJsonMapConfigNoCache(CONFIG_NAME), null);
}

代码示例来源:origin: networknt/light-4j

@Override
public void register() {
  ModuleRegistry.registerModule(CorsHttpHandler.class.getName(), Config.getInstance().getJsonMapConfigNoCache(CONFIG_NAME), null);
}

代码示例来源:origin: networknt/light-4j

@Override
public void register() {
  ModuleRegistry.registerModule(DerefMiddlewareHandler.class.getName(), Config.getInstance().getJsonMapConfigNoCache(CONFIG_NAME), null);
}

代码示例来源:origin: networknt/light-4j

@Override
public void register() {
  ModuleRegistry.registerModule(ResponseEncodeHandler.class.getName(), Config.getInstance().getJsonMapConfigNoCache(ResponseEncodeConfig.CONFIG_NAME), null);
}

代码示例来源:origin: networknt/light-4j

@Override
public void register() {
  ModuleRegistry.registerModule(WhitelistHandler.class.getName(), Config.getInstance().getJsonMapConfigNoCache(CONFIG_NAME), null);
}

代码示例来源:origin: networknt/light-4j

@Override
public void register() {
  ModuleRegistry.registerModule(PrometheusHandler.class.getName(), Config.getInstance().getJsonMapConfigNoCache(CONFIG_NAME), null);
}

代码示例来源:origin: networknt/light-4j

/**
   * We can get it from server module but we don't want mutual dependency. So
   * get it from config and keystore directly
   *
   * @return String TLS server certificate finger print
   */
  private String getServerTlsFingerPrint() {
    String fingerPrint = null;
    Map<String, Object> serverConfig = Config.getInstance().getJsonMapConfigNoCache("server");
    Map<String, Object> secretConfig = Config.getInstance().getJsonMapConfigNoCache("secret");
    // load keystore here based on server config and secret config
    String keystoreName = (String)serverConfig.get("keystoreName");
    String serverKeystorePass = (String)secretConfig.get("serverKeystorePass");
    if(keystoreName != null) {
      try (InputStream stream = Config.getInstance().getInputStreamFromFile(keystoreName)) {
        KeyStore loadedKeystore = KeyStore.getInstance("JKS");
        loadedKeystore.load(stream, serverKeystorePass.toCharArray());
        X509Certificate cert = (X509Certificate)loadedKeystore.getCertificate("server");
        if(cert != null) {
          fingerPrint = FingerPrintUtil.getCertFingerPrint(cert);
        } else {
          logger.error("Unable to find the certificate with alias name as server in the keystore");
        }
      } catch (Exception e) {
        logger.error("Unable to load server keystore ", e);
      }
    }
    return fingerPrint;
  }
}

代码示例来源:origin: networknt/light-4j

@Override
public void handleRequest(final HttpServerExchange exchange) throws Exception {
  ServerInfoConfig config = (ServerInfoConfig)Config.getInstance().getJsonObjectConfig(CONFIG_NAME, ServerInfoConfig.class);
  if(config.isEnableServerInfo()) {
    Map<String, Object> infoMap = new LinkedHashMap<>();
    infoMap.put("deployment", getDeployment());
    infoMap.put("environment", getEnvironment(exchange));
    infoMap.put("security", getSecurity());
    infoMap.put("specification", Config.getInstance().getJsonMapConfigNoCache("swagger"));
    infoMap.put("component", ModuleRegistry.getRegistry());
    exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, "application/json");
    exchange.getResponseSender().send(Config.getInstance().getMapper().writeValueAsString(infoMap));
  } else {
    setExchangeStatus(exchange, STATUS_SERVER_INFO_DISABLED);
  }
}

代码示例来源:origin: com.networknt/exception

@Override
public void register() {
  ModuleRegistry.registerModule(ExceptionHandler.class.getName(), Config.getInstance().getJsonMapConfigNoCache(CONFIG_NAME), null);
}

相关文章