public void removeFeedJointsPostPipelineTermination(FeedConnectionId connectionId) {
    FeedConnectJobInfo cInfo = connectJobInfos.get(connectionId);
    List<IFeedJoint> feedJoints = feedPipeline.get(connectionId.getFeedId());

    IFeedJoint sourceJoint = cInfo.getSourceFeedJoint();
    List<FeedConnectionId> all = sourceJoint.getReceivers();
    boolean removeSourceJoint = all.size() < 2;
    if (removeSourceJoint) {
      feedJoints.remove(sourceJoint);
    }

    IFeedJoint computeJoint = cInfo.getComputeFeedJoint();
    if (computeJoint != null && computeJoint.getReceivers().size() < 2) {
      feedJoints.remove(computeJoint);
    }
  }
  private void notifyFeedEventSubscribers(FeedJobInfo jobInfo, FeedLifecycleEvent event) {
    JobType jobType = jobInfo.getJobType();
    List<FeedConnectionId> impactedConnections = new ArrayList<FeedConnectionId>();
    if (jobType.equals(JobType.INTAKE)) {
      FeedId feedId = ((FeedIntakeInfo) jobInfo).getFeedId();
      for (FeedConnectionId connId : eventSubscribers.keySet()) {
        if (connId.getFeedId().equals(feedId)) {
          impactedConnections.add(connId);
        }
      }
    } else {
      impactedConnections.add(((FeedConnectJobInfo) jobInfo).getConnectionId());
    }

    for (FeedConnectionId connId : impactedConnections) {
      List<IFeedLifecycleEventSubscriber> subscribers = eventSubscribers.get(connId);
      if (subscribers != null && !subscribers.isEmpty()) {
        for (IFeedLifecycleEventSubscriber subscriber : subscribers) {
          subscriber.handleFeedEvent(event);
        }
      }
    }
  }