本文整理了Java中com.networknt.utility.Util.getUUID()
方法的一些代码示例,展示了Util.getUUID()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.getUUID()
方法的具体详情如下:
包路径:com.networknt.utility.Util
类名称: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));
内容来源于网络,如有侵权,请联系作者删除!