def register()

in http-server/src/main/scala/com/twitter/finatra/http/routing/Registrar.scala [54:97]


  def register(route: Route): Unit = {
    val name = if (route.name.isEmpty) route.path else route.name

    registry.put(Seq(name, route.method.name, "class"), route.clazz.getName)
    registry.put(Seq(name, route.method.name, "path"), route.path)
    registry.put(Seq(name, route.method.name, "constant"), route.constantRoute.toString)

    registry.put(Seq(name, route.method.name, "callback", "request"), route.requestClass.toString)
    registry.put(Seq(name, route.method.name, "callback", "response"), route.responseClass.toString)
    registry.put(Seq(name, route.method.name, "method"), route.method.name)

    if (route.captureNames.nonEmpty) {
      registry.put(Seq(name, route.method.name, "capture_names"), route.captureNames.mkString(","))
    }

    if (route.routeFilter ne Filter.identity) {
      registry.put(Seq(name, route.method.name, "filters"), route.routeFilter.toString)
    }

    route.index match {
      case Some(index) =>
        val adminIndexKey = Seq(name, route.method.name, "admin", "index")
        registry.put(
          key = adminIndexKey :+ "alias",
          value = index.alias
        )
        registry.put(
          key = adminIndexKey :+ "group",
          value = index.group
        )
        registry.put(
          key = adminIndexKey :+ "method",
          value = index.method.name
        )
        if (index.path.isDefined) {
          registry.put(
            key = adminIndexKey :+ "path",
            value = index.path.get
          )
        }
      case _ =>
        registry.put(Seq(name, route.method.name, "admin"), route.admin.toString)
    }
  }