@Override public ListenableFuture<MetaDataInfo> info(final MetaDataInfo.InfoType infoType) { final String userId = SecurityRequestContext.getUserId(); final String userIp = SecurityRequestContext.getUserIP(); // this is not an async call so we do not need to wait for the future return executor.submit(new Callable<MetaDataInfo>() { @Override public MetaDataInfo call() throws Exception { SecurityRequestContext.setUserId(userId); SecurityRequestContext.setUserIP(userIp); return getInfo(infoType); } }); }
@Override public ListenableFuture<MetaDataInfo> info(final MetaDataInfo.InfoType infoType) { final String userId = SecurityRequestContext.getUserId(); final String userIp = SecurityRequestContext.getUserIP(); // this is not an async call so we do not need to wait for the future return executor.submit(new Callable<MetaDataInfo>() { @Override public MetaDataInfo call() throws Exception { SecurityRequestContext.setUserId(userId); SecurityRequestContext.setUserIP(userIp); return getInfo(infoType); } }); }
private void createLogEntry(HttpRequest httpRequest, HttpResponseStatus responseStatus) throws UnknownHostException { InetAddress clientAddr = InetAddress.getByName(Objects.firstNonNull(SecurityRequestContext.getUserIP(), "0.0.0.0")); AuditLogEntry logEntry = new AuditLogEntry(httpRequest, clientAddr.getHostAddress()); logEntry.setUserName(authenticationContext.getPrincipal().getName()); logEntry.setResponse(responseStatus.code(), 0L); AUDIT_LOG.trace(logEntry.toString()); } }
private void createLogEntry(HttpRequest httpRequest, HttpResponseStatus responseStatus) throws UnknownHostException { InetAddress clientAddr = InetAddress.getByName(Objects.firstNonNull(SecurityRequestContext.getUserIP(), "0.0.0.0")); AuditLogEntry logEntry = new AuditLogEntry(httpRequest, clientAddr.getHostAddress()); logEntry.setUserName(authenticationContext.getPrincipal().getName()); logEntry.setResponse(responseStatus.code(), 0L); AUDIT_LOG.trace(logEntry.toString()); } }
private ListenableFuture<ExploreExecutionResult> getResultsFuture(final HandleProducer handleProducer) { // NOTE: here we have two levels of Future because we want to return the future that actually // finishes the execution of the operation - it is not enough that the future handle // be available final String userId = SecurityRequestContext.getUserId(); final String userIp = SecurityRequestContext.getUserIP(); ListenableFuture<QueryHandle> futureHandle = executor.submit(new Callable<QueryHandle>() { @Override public QueryHandle call() throws Exception { SecurityRequestContext.setUserId(userId); SecurityRequestContext.setUserIP(userIp); return handleProducer.getHandle(); } }); return getFutureResultsFromHandle(futureHandle); }
private ListenableFuture<ExploreExecutionResult> getResultsFuture(final HandleProducer handleProducer) { // NOTE: here we have two levels of Future because we want to return the future that actually // finishes the execution of the operation - it is not enough that the future handle // be available final String userId = SecurityRequestContext.getUserId(); final String userIp = SecurityRequestContext.getUserIP(); ListenableFuture<QueryHandle> futureHandle = executor.submit(new Callable<QueryHandle>() { @Override public QueryHandle call() throws Exception { SecurityRequestContext.setUserId(userId); SecurityRequestContext.setUserIP(userIp); return handleProducer.getHandle(); } }); return getFutureResultsFromHandle(futureHandle); }
if (!status.getStatus().isDone()) { final String userId = SecurityRequestContext.getUserId(); final String userIp = SecurityRequestContext.getUserIP(); executor.schedule(new Runnable() { @Override
if (!status.getStatus().isDone()) { final String userId = SecurityRequestContext.getUserId(); final String userIp = SecurityRequestContext.getUserIP(); executor.schedule(new Runnable() { @Override