Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/rorschach.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/scala/com/getbootstrap/rorschach/http/SuperWire.scala')
-rw-r--r--src/main/scala/com/getbootstrap/rorschach/http/SuperWire.scala20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main/scala/com/getbootstrap/rorschach/http/SuperWire.scala b/src/main/scala/com/getbootstrap/rorschach/http/SuperWire.scala
new file mode 100644
index 0000000..f098cd9
--- /dev/null
+++ b/src/main/scala/com/getbootstrap/rorschach/http/SuperWire.scala
@@ -0,0 +1,20 @@
+package com.getbootstrap.rorschach.http
+
+import java.util.{Collection=>JavaCollection}
+import java.util.Map.{Entry=>MapEntry}
+import java.io.InputStream
+import com.jcabi.github.wire.RetryCarefulWire
+import com.jcabi.http.{Wire,Request,Response}
+
+case class SuperWire(private val wire: Wire, userAgent: UserAgent, threshold: Int) extends Wire {
+ private val wrappedWire = UserAgentWire(wire = new RetryCarefulWire(wire, threshold), userAgent = userAgent)
+
+ @Override
+ def send(
+ request: Request,
+ home: String,
+ method: String,
+ headers: JavaCollection[MapEntry[String, String]],
+ content: InputStream
+ ): Response = wrappedWire.send(request, home, method, headers, content)
+}