code: public Map<String, AddSpecResponse> put(Spec spec, boolean triggerListener) {
      Map<String, AddSpecResponse> responseMap = new HashMap<>();
      try {
        Preconditions.checkState(state() == State.RUNNING, String.format("%s is not running.", this.getClass().getName()));
        Preconditions.checkNotNull(spec);
  
        long startTime = System.currentTimeMillis();
        log.info(String.format("Adding FlowSpec with URI: %s and Config: %s", spec.getUri(),
            ((FlowSpec) spec).getConfigAsProperties()));
        specStore.addSpec(spec);
        metrics.updatePutSpecTime(startTime);
        if (triggerListener) {
          AddSpecResponse<CallbacksDispatcher.CallbackResults<SpecCatalogListener, AddSpecResponse>> response = this.listeners.onAddSpec(spec);
          for (Map.Entry<SpecCatalogListener, CallbackResult<AddSpecResponse>> entry: response.getValue().getSuccesses().entrySet()) {
            responseMap.put(entry.getKey().getName(), entry.getValue().getResult());
          }
        }
      } catch (IOException e) {
        throw new RuntimeException("Cannot add Spec to Spec store: " + spec, e);
      }
      return responseMap;
    }
docs: Persist {@link Spec} into {@link SpecStore} and notify {@link SpecCatalogListener} if triggerListener
  is set to true.
  
  @param spec The Spec to be added
  @param triggerListener True if listeners should be notified.
  @return