if(transportChannel.getChannelType() == null) { throw new RuntimeException("Can not determine channel type (null)"); if(!transportChannel.getChannelType().equals("direct") && !transportChannel.getChannelType().equals("netty")) { throw new RuntimeException("Unknown channel type "+transportChannel.getChannelType()); getThreadContext().putTransient(ConfigConstants.SG_CHANNEL_TYPE, transportChannel.getChannelType()); getThreadContext().putTransient(ConfigConstants.SG_ACTION_NAME, task.getAction()); if(transportChannel.getChannelType().equals("direct")) { final String userHeader = getThreadContext().getHeader(ConfigConstants.SG_USER_HEADER); getThreadContext().putHeader("_sg_trace"+System.currentTimeMillis()+"#"+UUID.randomUUID().toString(), Thread.currentThread().getName()+" DIR -> "+transportChannel.getChannelType()+" "+getThreadContext().getHeaders()); log.error("Internal or shard requests ("+task.getAction()+") not allowed from a non-server node for transport type "+transportChannel.getChannelType()); transportChannel.sendResponse(new ElasticsearchSecurityException( "Internal or shard requests not allowed from a non-server node for transport type "+transportChannel.getChannelType())); return; "No SSL client certificates found for transport type "+transportChannel.getChannelType()+". Search Guard needs the Search Guard SSL plugin to be installed"); auditLog.logSSLException(request, ex, task.getAction(), task); log.error("No SSL client certificates found for transport type "+transportChannel.getChannelType()+". Search Guard needs the Search Guard SSL plugin to be installed"); transportChannel.sendResponse(ex); return; getThreadContext().putHeader("_sg_trace"+System.currentTimeMillis()+"#"+UUID.randomUUID().toString(), Thread.currentThread().getName()+" NETTI -> "+transportChannel.getChannelType()+" "+getThreadContext().getHeaders().entrySet().stream().filter(p->!p.getKey().startsWith("_sg_trace")).collect(Collectors.toMap(p -> p.getKey(), p -> p.getValue()))); getThreadContext().putHeader("_sg_trace"+System.currentTimeMillis()+"#"+UUID.randomUUID().toString(), Thread.currentThread().getName()+" FIN -> "+transportChannel.getChannelType()+" "+getThreadContext().getHeaders());
@Override public String getChannelType() { return channel.getChannelType(); }
public void processMessageReceived(Request request, TransportChannel channel) throws Exception { final Task task = taskManager.register(channel.getChannelType(), action, request); if (task == null) { handler.messageReceived(request, channel); } else { boolean success = false; try { handler.messageReceived(request, new TaskTransportChannel(taskManager, task, channel), task); success = true; } finally { if (success == false) { taskManager.unregister(task); } } } }
@Override public String getChannelType() { return channel.getChannelType(); }
@Override public String getChannelType() { return channel.getChannelType(); }
@Override public String getChannelType() { return channel.getChannelType(); }
@Override public String getChannelType() { return channel.getChannelType(); }
public void processMessageReceived(Request request, TransportChannel channel) throws Exception { final Task task = taskManager.register(channel.getChannelType(), action, request); if (task == null) { handler.messageReceived(request, channel); } else { boolean success = false; try { handler.messageReceived(request, new TransportChannelWrapper(taskManager, task, channel), task); success = true; } finally { if (success == false) { taskManager.unregister(task); } } } }
public void processMessageReceived(Request request, TransportChannel channel) throws Exception { final Task task = taskManager.register(channel.getChannelType(), action, request); if (task == null) { handler.messageReceived(request, channel); } else { boolean success = false; try { handler.messageReceived(request, new TransportChannelWrapper(taskManager, task, channel), task); success = true; } finally { if (success == false) { taskManager.unregister(task); } } } }
public void processMessageReceived(Request request, TransportChannel channel) throws Exception { final Task task = taskManager.register(channel.getChannelType(), action, request); if (task == null) { handler.messageReceived(request, channel); } else { boolean success = false; try { handler.messageReceived(request, new TaskTransportChannel(taskManager, task, channel), task); success = true; } finally { if (success == false) { taskManager.unregister(task); } } } }
public void processMessageReceived(Request request, TransportChannel channel) throws Exception { final Task task = taskManager.register(channel.getChannelType(), action, request); if (task == null) { handler.messageReceived(request, channel); } else { boolean success = false; try { handler.messageReceived(request, new TaskTransportChannel(taskManager, task, channel), task); success = true; } finally { if (success == false) { taskManager.unregister(task); } } } }
if (!"netty".equals(channel.getChannelType())) { //netty4 messageReceivedDecorate(request, actualHandler, channel, task); return; nettyChannel = (NettyTcpChannel) inner; } else { throw new Exception("Invalid channel of type "+channel.getClass()+ " ("+channel.getChannelType()+")");
if(transportChannel.getChannelType() == null) { throw new RuntimeException("Can not determine channel type (null)"); if(!transportChannel.getChannelType().equals("direct") && !transportChannel.getChannelType().equals("netty")) { throw new RuntimeException("Unknown channel type "+transportChannel.getChannelType()); getThreadContext().putTransient(ConfigConstants.SG_CHANNEL_TYPE, transportChannel.getChannelType()); getThreadContext().putTransient(ConfigConstants.SG_ACTION_NAME, task.getAction()); if(transportChannel.getChannelType().equals("direct")) { final String userHeader = getThreadContext().getHeader(ConfigConstants.SG_USER_HEADER); getThreadContext().putHeader("_sg_trace"+System.currentTimeMillis()+"#"+UUID.randomUUID().toString(), Thread.currentThread().getName()+" DIR -> "+transportChannel.getChannelType()+" "+getThreadContext().getHeaders()); log.error("Internal or shard requests ("+task.getAction()+") not allowed from a non-server node for transport type "+transportChannel.getChannelType()); transportChannel.sendResponse(new ElasticsearchSecurityException( "Internal or shard requests not allowed from a non-server node for transport type "+transportChannel.getChannelType())); return; "No SSL client certificates found for transport type "+transportChannel.getChannelType()+". Search Guard needs the Search Guard SSL plugin to be installed"); auditLog.logSSLException(request, ex, task.getAction(), task); log.error("No SSL client certificates found for transport type "+transportChannel.getChannelType()+". Search Guard needs the Search Guard SSL plugin to be installed"); transportChannel.sendResponse(ex); return; getThreadContext().putHeader("_sg_trace"+System.currentTimeMillis()+"#"+UUID.randomUUID().toString(), Thread.currentThread().getName()+" NETTI -> "+transportChannel.getChannelType()+" "+getThreadContext().getHeaders().entrySet().stream().filter(p->!p.getKey().startsWith("_sg_trace")).collect(Collectors.toMap(p -> p.getKey(), p -> p.getValue()))); getThreadContext().putHeader("_sg_trace"+System.currentTimeMillis()+"#"+UUID.randomUUID().toString(), Thread.currentThread().getName()+" FIN -> "+transportChannel.getChannelType()+" "+getThreadContext().getHeaders());