package com.metamx.druid.indexing.worker.executor;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.base.Optional;
import com.google.inject.Inject;
import com.metamx.druid.indexing.common.index.ChatHandler;
import com.metamx.druid.indexing.common.index.EventReceivingChatHandlerProvider;

import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.core.Response;

@Path("/druid/worker/v1")
public class ChatHandlerResource
{
  private final ObjectMapper jsonMapper;
  private final EventReceivingChatHandlerProvider handlers;

  @Inject
  public ChatHandlerResource(ObjectMapper jsonMapper, EventReceivingChatHandlerProvider handlers)
  {
    this.jsonMapper = jsonMapper;
    this.handlers = handlers;
  }

  @Path("/chat/{id}")
  public Object doTaskChat(
      @PathParam("id") String handlerId
  )
  {
    final Optional<ChatHandler> handler = handlers.get(handlerId);

    if (handler.isPresent()) {
      return handler.get();
    } else {
      return Response.status(Response.Status.NOT_FOUND).build();
    }
  }
}

@@ -49,60 +49,8 @@
 r;%0A%0A
-import com.fasterxml.jackson.databind.ObjectMapper;%0A
 impo
@@ -223,30 +223,16 @@
 n.index.
-EventReceiving
 ChatHand
@@ -416,63 +416,8 @@
 nal 
-ObjectMapper jsonMapper;%0A  private final EventReceiving
 Chat
@@ -486,114 +486,41 @@
 rce(
-ObjectMapper jsonMapper, EventReceivingChatHandlerProvider handlers)%0A  %7B%0A    this.jsonMapper = jsonMapper;
+ChatHandlerProvider handlers)%0A  %7B
 %0A   

Fix Guice type errors