test_class.file: bigdata-intro/cep-intro/siddhi-kafka-rest/src/test/java/net/redborder/cep/siddhi/SiddhiHandlerTest.java
test_class.identifier: SiddhiHandlerTest
test_class.superclass: extends TestCase
test_case.body: @Test
      public void remove() throws RestException {
          SiddhiHandler siddhiHandler = new SiddhiHandler();
  
          // Build a map with the execution plan data
          Map<String, Object> executionPlanMap = new HashMap<>();
          Map<String, String> outputTopics = new HashMap<>();
          outputTopics.put("testOutput", "outputTopic");
          executionPlanMap.put("id", "testID");
          executionPlanMap.put("input", Arrays.asList("test", "test2"));
          executionPlanMap.put("output", outputTopics);
          executionPlanMap.put("executionPlan", "from test select a insert into testOutput");
  
          // Add it to siddhi handler
          siddhiHandler.add(executionPlanMap);
  
          // Remove it
          siddhiHandler.remove("testID");
  
          assertTrue(siddhiHandler.getSiddhiPlans().isEmpty());
      }
test_case.class_method_signature: SiddhiHandlerTest.remove()
test_case.full_signature: @Test public void remove()
test_case.identifier: remove
test_case.invocations: put put put asList put put add remove assertTrue isEmpty getSiddhiPlans
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void remove()
focal_class.declarator: log = LoggerFactory.getLogger(SiddhiHandler.class)
focal_class.modifier: private final
focal_class.original_string: private final Logger log = LoggerFactory.getLogger(SiddhiHandler.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: siddhiManager
focal_class.modifier: private
focal_class.original_string: private SiddhiManager siddhiManager;
focal_class.type: SiddhiManager
focal_class.var_name: siddhiManager
focal_class.declarator: siddhiCallback
focal_class.modifier: private
focal_class.original_string: private SiddhiCallback siddhiCallback;
focal_class.type: SiddhiCallback
focal_class.var_name: siddhiCallback
focal_class.declarator: objectMapper
focal_class.modifier: private
focal_class.original_string: private ObjectMapper objectMapper;
focal_class.type: ObjectMapper
focal_class.var_name: objectMapper
focal_class.declarator: siddhiPlans
focal_class.modifier: private
focal_class.original_string: private Map<String, SiddhiPlan> siddhiPlans;
focal_class.type: Map<String, SiddhiPlan>
focal_class.var_name: siddhiPlans
focal_class.file: bigdata-intro/cep-intro/siddhi-kafka-rest/src/main/java/net/redborder/cep/siddhi/SiddhiHandler.java
focal_class.identifier: SiddhiHandler
focal_class.interfaces: implements RestListener, EventHandler<MapEvent>
focal_class.class_method_signature: SiddhiHandler.SiddhiHandler(Sink eventReceiver)
focal_class.full_signature: public  SiddhiHandler(Sink eventReceiver)
focal_class.identifier: SiddhiHandler
focal_class.modifiers: public
focal_class.parameters: (Sink eventReceiver)
focal_class.signature:  SiddhiHandler(Sink eventReceiver)
focal_class.class_method_signature: SiddhiHandler.SiddhiHandler()
focal_class.full_signature: public  SiddhiHandler()
focal_class.identifier: SiddhiHandler
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  SiddhiHandler()
focal_class.class_method_signature: SiddhiHandler.stop()
focal_class.full_signature: public void stop()
focal_class.identifier: stop
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void stop()
focal_class.class_method_signature: SiddhiHandler.getSiddhiPlans()
focal_class.full_signature: public Map<String, SiddhiPlan> getSiddhiPlans()
focal_class.identifier: getSiddhiPlans
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Map<String, SiddhiPlan>
focal_class.signature: Map<String, SiddhiPlan> getSiddhiPlans()
focal_class.class_method_signature: SiddhiHandler.onEvent(MapEvent mapEvent, long sequence, boolean endOfBatch)
focal_class.full_signature: @Override public void onEvent(MapEvent mapEvent, long sequence, boolean endOfBatch)
focal_class.identifier: onEvent
focal_class.modifiers: @Override public
focal_class.parameters: (MapEvent mapEvent, long sequence, boolean endOfBatch)
focal_class.return: void
focal_class.signature: void onEvent(MapEvent mapEvent, long sequence, boolean endOfBatch)
focal_class.class_method_signature: SiddhiHandler.add(Map<String, Object> element)
focal_class.full_signature: @Override public void add(Map<String, Object> element)
focal_class.identifier: add
focal_class.modifiers: @Override public
focal_class.parameters: (Map<String, Object> element)
focal_class.return: void
focal_class.signature: void add(Map<String, Object> element)
focal_class.class_method_signature: SiddhiHandler.add(SiddhiPlan siddhiPlan)
focal_class.full_signature: public synchronized void add(SiddhiPlan siddhiPlan)
focal_class.identifier: add
focal_class.modifiers: public synchronized
focal_class.parameters: (SiddhiPlan siddhiPlan)
focal_class.return: void
focal_class.signature: void add(SiddhiPlan siddhiPlan)
focal_class.class_method_signature: SiddhiHandler.remove(String id)
focal_class.full_signature: @Override public synchronized void remove(String id)
focal_class.identifier: remove
focal_class.modifiers: @Override public synchronized
focal_class.parameters: (String id)
focal_class.return: void
focal_class.signature: void remove(String id)
focal_class.class_method_signature: SiddhiHandler.synchronize(List<Map<String, Object>> elements)
focal_class.full_signature: @Override public synchronized void synchronize(List<Map<String, Object>> elements)
focal_class.identifier: synchronize
focal_class.modifiers: @Override public synchronized
focal_class.parameters: (List<Map<String, Object>> elements)
focal_class.return: void
focal_class.signature: void synchronize(List<Map<String, Object>> elements)
focal_class.class_method_signature: SiddhiHandler.list()
focal_class.full_signature: @Override public List<Map<String, Object>> list()
focal_class.identifier: list
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: List<Map<String, Object>>
focal_class.signature: List<Map<String, Object>> list()
focal_class.class_method_signature: SiddhiHandler.save()
focal_class.full_signature: public synchronized void save()
focal_class.identifier: save
focal_class.modifiers: public synchronized
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void save()
focal_class.class_method_signature: SiddhiHandler.restore()
focal_class.full_signature: public synchronized void restore()
focal_class.identifier: restore
focal_class.modifiers: public synchronized
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void restore()
focal_method.body: @Override
      public synchronized void remove(String id) throws RestException {
          SiddhiPlan siddhiPlan = siddhiPlans.get(id);
  
          if (siddhiPlan != null) {
              siddhiPlan.stop();
              siddhiPlans.remove(id);
              save();
  
              log.info("Siddhi plan with the id {} has been removed", id);
              log.info("Current queries: {}", siddhiPlans.keySet());
          } else {
              throw new RestNotFoundException("Siddhi plan with id " + id + " is not present");
          }
      }
focal_method.class_method_signature: SiddhiHandler.remove(String id)
focal_method.full_signature: @Override public synchronized void remove(String id)
focal_method.identifier: remove
focal_method.invocations: get stop remove save info info keySet
focal_method.modifiers: @Override public synchronized
focal_method.parameters: (String id)
focal_method.return: void
focal_method.signature: void remove(String id)