private static String extractSource()

in ingestion-beam/src/main/java/com/mozilla/telemetry/contextualservices/ParseReportingUrl.java [503:519]


  private static String extractSource(String docType) {
    if (DT_TOPSITES.equals(docType) || DT_TOPSITES_CLICK.equals(docType)
        || DT_TOPSITES_IMPRESSION.equals(docType)) {
      return SponsoredInteraction.SOURCE_TOPSITES;
    }

    if (DT_QUICKSUGGEST.equals(docType) || DT_QUICKSUGGEST_IMPRESSION.equals(docType)
        || DT_QUICKSUGGEST_CLICK.equals(docType) || DT_MOBILE_QUICKSUGGEST.equals(docType)) {
      return SponsoredInteraction.SOURCE_SUGGEST;
    }

    if (DT_SEARCHWITH.equals(docType)) {
      return SponsoredInteraction.SOURCE_SEARCHWITH;
    }

    throw new InvalidAttributeException("Unexpected docType: " + docType, docType);
  }