com.networknt.utility.Util.getUUID()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(182)

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

Util.getUUID介绍

[英]Generate UUID across the entire app and it is used for correlationId.
[中]在整个应用程序中生成UUID,并用于correlationId。

代码示例

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

@Override
public void handleRequest(final HttpServerExchange exchange) throws Exception {
  // check if the cid is in the request header
  String cId = exchange.getRequestHeaders().getFirst(HttpStringConstants.CORRELATION_ID);
  if(cId == null) {
    // if not, generate a UUID and put it into the request header
    cId = Util.getUUID();
    exchange.getRequestHeaders().put(HttpStringConstants.CORRELATION_ID, cId);
  }
  // Add the cId into MDC so that all log statement will have cId as part of it.
  MDC.put(CID, cId);
  //logger.debug("Init cId:" + cId);
  Handler.next(exchange, next);
}

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

private String jwtReference(String jwt, String clientId) {
    String uuid = Util.getUUID();
    Map<String, String> referenceMap = new HashMap<>();
    referenceMap.put("jwt", jwt);
    if(clientId != null) {
      referenceMap.put("clientId", clientId);
    }
    CacheStartupHookProvider.hz.getMap("references").set(uuid, referenceMap);
    return uuid;
  }
}

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

codeMap.put("userId", userId);
String code = Util.getUUID();
String redirectUri = params.get("redirect_uri");
if(redirectUri == null) {

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

String code = Util.getUUID();
String redirectUri = params.get("redirect_uri");
if(redirectUri == null) {

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

processAudit(exchange);
} else {
  String code = Util.getUUID();
  final SecurityContext context = exchange.getSecurityContext();
  String userId = context.getAuthenticatedAccount().getPrincipal().getName();

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

processAudit(exchange);
} else {
  String code = Util.getUUID();
  final SecurityContext context = exchange.getSecurityContext();
  String userId = context.getAuthenticatedAccount().getPrincipal().getName();

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

String clientSecret = Util.getUUID();
client.setClientSecret(HashUtil.generateStrongPasswordHash(clientSecret));

相关文章