Packages

t

com.twitter.finatra.httpclient.modules

HttpClientModuleTrait

trait HttpClientModuleTrait extends TwitterModule with StackClientModuleTrait[Request, Response, Client]

Extending this trait allows for configuring an com.twitter.finagle.Http.Client and/or a com.twitter.finatra.httpclient.HttpClient.

Example:
  1. class MyHttpClientModule
      extends HttpClientModuleTrait {
    
      override def dest: String = "/s/my/service"
      override def label: String = "myservice"
    
      override protected def sessionAcquisitionTimeout: Duration = 1.seconds
      override protected def requestTimeout: Duration = 5.seconds
      override protected def retryBudget: RetryBudget = RetryBudget(15.seconds, 5, .1)
    
      // if you want to customize the client configuration
      // you can:
      //
      // override def configureClient(
      //  injector: Injector,
      //  client: Http.Client
      // ): Http.Client =
      //   client.
      //     withTracer(NullTracer)
      //     withStatsReceiver(NullStatsReceiver)
      //
      // You can configure TLS on the client directly
      //
      // override def configureClient(
      //  injector: Injector,
      //  client: Http.Client
      // ): Http.Client = client.withTls("yourSslHostName")
      //
      // depending on your client type, you may want to provide a global instance,
      // otherwise you might want to specify how your consumers can provide a binding
      // for an instance to the client
      //
      // ex:
      // @Provides
      // @Singleton
      // final def provideFinagleClient(
      //   injector: Injector,
      //   statsReceiver: StatsReceiver
      // ): Http.Client = newClient(injector, statsReceiver)
      //
      // Or create a service directly
      //
      // ex:
      // @Provides
      // @Singleton
      // final def provideMyService(
      //   injector: Injector,
      //   statsReceiver: StatsReceiver
      // ): Service[Request, Response] =
      //     myCoolFilter.andThen(newService(injector, statsReceiver))
      //
      // Or provide the `com.twitter.finatra.httpclient.HttpClient`
      //
      // ex:
      // @Provides
      // @Singleton
      // final def provideMyHttpClient(
      //   injector: Injector,
      //   statsReceiver: StatsReceiver,
      //   mapper: ScalaObjectMapper
      // ): HttpClient = newHttpClient(injector, statsReceiver, mapper)
    
    }
Note

This trait does not define any @Provide annotations or bindings.

Linear Supertypes
StackClientModuleTrait[Request, Response, Client], TwitterModule, ScalaModule, InternalModule[Binder], TwitterBaseModule, TwitterModuleLifecycle, Logging, TwitterModuleFlags, AbstractModule, Module, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. HttpClientModuleTrait
  2. StackClientModuleTrait
  3. TwitterModule
  4. ScalaModule
  5. InternalModule
  6. TwitterBaseModule
  7. TwitterModuleLifecycle
  8. Logging
  9. TwitterModuleFlags
  10. AbstractModule
  11. Module
  12. AnyRef
  13. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. class BindingBuilder[T] extends ScalaAnnotatedBindingBuilder[T]
    Definition Classes
    InternalModule

Abstract Value Members

  1. abstract def dest: String
    Definition Classes
    StackClientModuleTrait
  2. abstract def label: String
    Definition Classes
    StackClientModuleTrait

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def addError(arg0: Message): Unit
    Attributes
    protected[google.inject]
    Definition Classes
    AbstractModule
  5. def addError(arg0: Throwable): Unit
    Attributes
    protected[google.inject]
    Definition Classes
    AbstractModule
  6. def addError(arg0: String, arg1: <repeated...>[AnyRef]): Unit
    Attributes
    protected[google.inject]
    Definition Classes
    AbstractModule
    Annotations
    @transient()
  7. def addFlagConverter[T <: AnyRef](typeMatcher: Matcher[_ >: TypeLiteral[_]], F: Flaggable[T]): Unit
    Attributes
    protected
    Definition Classes
    TwitterModule
  8. def addFlagConverter[T <: AnyRef](implicit arg0: Manifest[T], F: Flaggable[T]): Unit
    Attributes
    protected
    Definition Classes
    TwitterModule
  9. def addTypeConverter[T](converter: TypeConverter)(implicit arg0: Manifest[T]): Unit
    Attributes
    protected
    Definition Classes
    TwitterModule
  10. def annotatedWith[A <: Annotation](implicit arg0: ClassTag[A]): Matcher[AnnotatedElement]
    Attributes
    protected[this]
    Definition Classes
    InternalModule
  11. def asClosable(client: Client): Closable
    Attributes
    protected
    Definition Classes
    StackClientModuleTrait
  12. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  13. final def baseClient: Client
    Attributes
    protected
    Definition Classes
    HttpClientModuleTrait → StackClientModuleTrait
  14. def bind[T](implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): BindingBuilder[T]
    Attributes
    protected[this]
    Definition Classes
    InternalModule
  15. def bind[T <: AnyRef](arg0: Class[T]): AnnotatedBindingBuilder[T]
    Attributes
    protected[google.inject]
    Definition Classes
    AbstractModule
  16. def bind[T <: AnyRef](arg0: TypeLiteral[T]): AnnotatedBindingBuilder[T]
    Attributes
    protected[google.inject]
    Definition Classes
    AbstractModule
  17. def bind[T <: AnyRef](arg0: Key[T]): LinkedBindingBuilder[T]
    Attributes
    protected[google.inject]
    Definition Classes
    AbstractModule
  18. def bindAssistedFactory[T]()(implicit arg0: Manifest[T]): Unit
    Attributes
    protected
    Definition Classes
    TwitterModule
  19. def bindConstant(): AnnotatedConstantBindingBuilder
    Attributes
    protected[google.inject]
    Definition Classes
    AbstractModule
  20. def bindInterceptor[I <: MethodInterceptor](classMatcher: Matcher[_ >: Class[_]], methodMatcher: Matcher[_ >: AnnotatedElement])(implicit arg0: ClassTag[I]): Unit
    Attributes
    protected[this]
    Definition Classes
    InternalModule
  21. def bindInterceptor(arg0: Matcher[_ >: Class[_ <: AnyRef] <: AnyRef], arg1: Matcher[_ >: Method <: AnyRef], arg2: <repeated...>[MethodInterceptor]): Unit
    Attributes
    protected[google.inject]
    Definition Classes
    AbstractModule
    Annotations
    @transient()
  22. def bindListener(arg0: Matcher[_ >: Binding[_ <: AnyRef] <: AnyRef], arg1: <repeated...>[ProvisionListener]): Unit
    Attributes
    protected[google.inject]
    Definition Classes
    AbstractModule
    Annotations
    @transient()
  23. def bindListener(arg0: Matcher[_ >: TypeLiteral[_ <: AnyRef] <: AnyRef], arg1: TypeListener): Unit
    Attributes
    protected[google.inject]
    Definition Classes
    AbstractModule
  24. def bindMultiple[T](annotation: Annotation)(implicit arg0: Manifest[T]): ScalaMultibinder[T]
    Attributes
    protected
    Definition Classes
    TwitterModule
  25. def bindMultiple[T, A <: Annotation](implicit arg0: Manifest[T], arg1: Manifest[A]): ScalaMultibinder[T]
    Attributes
    protected
    Definition Classes
    TwitterModule
  26. def bindMultiple[T](implicit arg0: Manifest[T]): ScalaMultibinder[T]
    Attributes
    protected
    Definition Classes
    TwitterModule
  27. def bindOption[T](annotation: Annotation)(implicit arg0: Manifest[T]): ScalaOptionBinder[T]
    Attributes
    protected
    Definition Classes
    TwitterModule
  28. def bindOption[T, A <: Annotation](implicit arg0: Manifest[T], arg1: Manifest[A]): ScalaOptionBinder[T]
    Attributes
    protected
    Definition Classes
    TwitterModule
  29. def bindOption[T](implicit arg0: Manifest[T]): ScalaOptionBinder[T]
    Attributes
    protected
    Definition Classes
    TwitterModule
  30. def bindScope[T <: Annotation](scope: Scope)(implicit arg0: ClassTag[T]): Unit
    Attributes
    protected[this]
    Definition Classes
    InternalModule
  31. def bindScope(arg0: Class[_ <: Annotation], arg1: Scope): Unit
    Attributes
    protected[google.inject]
    Definition Classes
    AbstractModule
  32. def binder(): Binder
    Attributes
    protected[google.inject]
    Definition Classes
    AbstractModule
  33. def binderAccess: Binder
    Attributes
    protected[this]
    Definition Classes
    ScalaModule → InternalModule
  34. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  35. def configure(): Unit
    Attributes
    protected[google.inject]
    Definition Classes
    AbstractModule
  36. final def configure(arg0: Binder): Unit
    Definition Classes
    AbstractModule → Module
  37. def configureClient(injector: Injector, client: Client): Client
    Attributes
    protected
    Definition Classes
    StackClientModuleTrait
  38. def convertToTypes(arg0: Matcher[_ >: TypeLiteral[_ <: AnyRef] <: AnyRef], arg1: TypeConverter): Unit
    Attributes
    protected[google.inject]
    Definition Classes
    AbstractModule
  39. final def createFlag[T](name: String, default: T, help: String, flaggable: Flaggable[T]): Flag[T]
    Definition Classes
    TwitterModuleFlags
  40. final def createMandatoryFlag[T](name: String, help: String, usage: String, flaggable: Flaggable[T]): Flag[T]
    Definition Classes
    TwitterModuleFlags
  41. def currentStage(): Stage
    Attributes
    protected[google.inject]
    Definition Classes
    AbstractModule
  42. def debug(marker: Marker, message: => Any, cause: Throwable): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  43. def debug(message: => Any, cause: Throwable): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  44. def debug(marker: Marker, message: => Any): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  45. def debug(message: => Any): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  46. def debugResult[T](message: => String)(fn: => T): T
    Attributes
    protected[this]
    Definition Classes
    Logging
  47. def defaultClosableAwaitPeriod: Duration
    Attributes
    protected
    Definition Classes
    StackClientModuleTrait
  48. def defaultClosableGracePeriod: Duration
    Attributes
    protected
    Definition Classes
    StackClientModuleTrait
  49. def defaultHeaders: Map[String, String]
  50. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  51. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  52. def error(marker: Marker, message: => Any, cause: Throwable): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  53. def error(message: => Any, cause: Throwable): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  54. def error(marker: Marker, message: => Any): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  55. def error(message: => Any): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  56. def errorResult[T](message: => String)(fn: => T): T
    Attributes
    protected[this]
    Definition Classes
    Logging
  57. def failfastOnFlagsNotParsed: Boolean
    Attributes
    protected[this]
    Definition Classes
    TwitterModuleFlags
  58. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  59. final def flag[T](name: String, help: String)(implicit arg0: Flaggable[T], arg1: Manifest[T]): Flag[T]
    Definition Classes
    TwitterModuleFlags
  60. final def flag[T](name: String, default: T, help: String)(implicit arg0: Flaggable[T]): Flag[T]
    Definition Classes
    TwitterModuleFlags
  61. val flags: ArrayBuffer[Flag[_]]
    Attributes
    protected[inject]
    Definition Classes
    TwitterModuleFlags
  62. def frameworkConfigureClient(injector: Injector, client: Client): Client
    Attributes
    protected[twitter]
    Definition Classes
    StackClientModuleTrait
  63. def frameworkModules: Seq[Module]
    Attributes
    protected[inject]
    Definition Classes
    StackClientModuleTrait → TwitterBaseModule
  64. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  65. def getMembersInjector[T](implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): MembersInjector[T]
    Attributes
    protected[this]
    Definition Classes
    InternalModule
  66. def getMembersInjector[T <: AnyRef](arg0: TypeLiteral[T]): MembersInjector[T]
    Attributes
    protected[google.inject]
    Definition Classes
    AbstractModule
  67. def getMembersInjector[T <: AnyRef](arg0: Class[T]): MembersInjector[T]
    Attributes
    protected[google.inject]
    Definition Classes
    AbstractModule
  68. def getProvider[T](implicit arg0: ClassTag[T]): Provider[T]
    Attributes
    protected[this]
    Definition Classes
    InternalModule
  69. def getProvider[T <: AnyRef](arg0: Class[T]): Provider[T]
    Attributes
    protected[google.inject]
    Definition Classes
    AbstractModule
  70. def getProvider[T <: AnyRef](arg0: Key[T]): Provider[T]
    Attributes
    protected[google.inject]
    Definition Classes
    AbstractModule
  71. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  72. def hostname: String
  73. def info(marker: Marker, message: => Any, cause: Throwable): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  74. def info(message: => Any, cause: Throwable): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  75. def info(marker: Marker, message: => Any): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  76. def info(message: => Any): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  77. def infoResult[T](message: => String)(fn: => T): T
    Attributes
    protected[this]
    Definition Classes
    Logging
  78. def initialClientConfiguration(injector: Injector, client: Client, statsReceiver: StatsReceiver): Client
    Attributes
    protected
    Definition Classes
    StackClientModuleTrait
  79. def install(module: Module): Unit
    Attributes
    protected
    Definition Classes
    TwitterModule → AbstractModule
    Annotations
    @throws(scala.this.throws.<init>$default$1[UnsupportedOperationException])
  80. def isDebugEnabled(marker: Marker): Boolean
    Attributes
    protected[this]
    Definition Classes
    Logging
  81. def isDebugEnabled: Boolean
    Attributes
    protected[this]
    Definition Classes
    Logging
  82. def isErrorEnabled(marker: Marker): Boolean
    Attributes
    protected[this]
    Definition Classes
    Logging
  83. def isErrorEnabled: Boolean
    Attributes
    protected[this]
    Definition Classes
    Logging
  84. def isInfoEnabled(marker: Marker): Boolean
    Attributes
    protected[this]
    Definition Classes
    Logging
  85. def isInfoEnabled: Boolean
    Attributes
    protected[this]
    Definition Classes
    Logging
  86. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  87. def isTraceEnabled(marker: Marker): Boolean
    Attributes
    protected[this]
    Definition Classes
    Logging
  88. def isTraceEnabled: Boolean
    Attributes
    protected[this]
    Definition Classes
    Logging
  89. def isWarnEnabled(marker: Marker): Boolean
    Attributes
    protected[this]
    Definition Classes
    Logging
  90. def isWarnEnabled: Boolean
    Attributes
    protected[this]
    Definition Classes
    Logging
  91. def javaModules: Collection[Module]
    Attributes
    protected[inject]
    Definition Classes
    TwitterBaseModule
  92. final def logger: Logger
    Attributes
    protected[this]
    Definition Classes
    Logging
  93. final def loggerName: String
    Attributes
    protected[this]
    Definition Classes
    Logging
  94. def modules: Seq[Module]
    Attributes
    protected[inject]
    Definition Classes
    TwitterBaseModule
  95. def monitor: Monitor
    Attributes
    protected
    Definition Classes
    StackClientModuleTrait
  96. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  97. final def newClient(injector: Injector, statsReceiver: StatsReceiver): Client
    Definition Classes
    HttpClientModuleTrait → StackClientModuleTrait
  98. final def newHttpClient(injector: Injector, statsReceiver: StatsReceiver, mapper: ScalaObjectMapper): HttpClient
  99. final def newService(injector: Injector, statsReceiver: StatsReceiver): Service[Request, Response]
    Attributes
    protected
    Definition Classes
    StackClientModuleTrait
  100. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  101. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  102. def onExit(f: => Unit): Unit
    Attributes
    protected
    Definition Classes
    TwitterModuleLifecycle
  103. def requestInjection(arg0: AnyRef): Unit
    Attributes
    protected[google.inject]
    Definition Classes
    AbstractModule
  104. def requestStaticInjection[T]()(implicit arg0: ClassTag[T]): Unit
    Attributes
    protected[this]
    Definition Classes
    InternalModule
  105. def requestStaticInjection(arg0: <repeated...>[Class[_ <: AnyRef]]): Unit
    Attributes
    protected[google.inject]
    Definition Classes
    AbstractModule
    Annotations
    @transient()
  106. def requestTimeout: Duration
    Attributes
    protected
    Definition Classes
    StackClientModuleTrait
  107. def requireBinding(arg0: Class[_ <: AnyRef]): Unit
    Attributes
    protected[google.inject]
    Definition Classes
    AbstractModule
  108. def requireBinding(arg0: Key[_ <: AnyRef]): Unit
    Attributes
    protected[google.inject]
    Definition Classes
    AbstractModule
  109. def retryBudget: RetryBudget
    Attributes
    protected
    Definition Classes
    StackClientModuleTrait
  110. def retryPolicy: Option[RetryPolicy[Try[Response]]]
  111. def scopeStatsReceiver(injector: Injector, statsReceiver: StatsReceiver): StatsReceiver
    Attributes
    protected
    Definition Classes
    StackClientModuleTrait
  112. def sessionAcquisitionTimeout: Duration
    Attributes
    protected
    Definition Classes
    StackClientModuleTrait
  113. def singletonPostWarmupComplete(injector: Injector): Unit
    Attributes
    protected[inject]
    Definition Classes
    TwitterModuleLifecycle
  114. def singletonShutdown(injector: Injector): Unit
    Attributes
    protected[inject]
    Definition Classes
    TwitterModuleLifecycle
  115. def singletonStartup(injector: Injector): Unit
    Attributes
    protected[inject]
    Definition Classes
    TwitterModuleLifecycle
  116. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  117. def toString(): String
    Definition Classes
    AnyRef → Any
  118. def trace(marker: Marker, message: => Any, cause: Throwable): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  119. def trace(message: => Any, cause: Throwable): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  120. def trace(marker: Marker, message: => Any): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  121. def trace(message: => Any): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  122. def traceResult[T](message: => String)(fn: => T): T
    Attributes
    protected[this]
    Definition Classes
    Logging
  123. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  124. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  125. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  126. def warn(marker: Marker, message: => Any, cause: Throwable): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  127. def warn(message: => Any, cause: Throwable): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  128. def warn(marker: Marker, message: => Any): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  129. def warn(message: => Any): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  130. def warnResult[T](message: => String)(fn: => T): T
    Attributes
    protected[this]
    Definition Classes
    Logging

Inherited from StackClientModuleTrait[Request, Response, Client]

Inherited from TwitterModule

Inherited from ScalaModule

Inherited from InternalModule[Binder]

Inherited from TwitterBaseModule

Inherited from TwitterModuleLifecycle

Inherited from Logging

Inherited from TwitterModuleFlags

Inherited from AbstractModule

Inherited from Module

Inherited from AnyRef

Inherited from Any

Ungrouped