loci.communicator.ws.jetty.WS.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scala-loci-communicator-ws-jetty_2.13 Show documentation
Show all versions of scala-loci-communicator-ws-jetty_2.13 Show documentation
ScalaLoci Jetty WebSocket communicator
The newest version!
package loci
package communicator
package ws.jetty
import org.eclipse.jetty.servlet.ServletContextHandler
import org.eclipse.jetty.websocket.servlet.ServletUpgradeRequest
import scala.concurrent.duration._
trait WS extends
Protocol with
SetupInfo with
SecurityInfo with
SymmetryInfo with Bidirectional {
val path: String
val host: Option[String]
val port: Option[Int]
val request: Option[ServletUpgradeRequest]
override def toString = s"WS($path, $host, $port)"
}
object WS extends WSSetupFactory {
def unapply(ws: WS) = Some((ws.path, ws.host, ws.port))
case class Properties(
heartbeatDelay: FiniteDuration = 3.seconds,
heartbeatTimeout: FiniteDuration = 10.seconds)
def apply(context: ServletContextHandler, pathspec: String): Listener[WS] =
new WSListener[WS](context, pathspec, Properties())
def apply(context: ServletContextHandler, pathspec: String, properties: Properties): Listener[WS] =
new WSListener[WS](context, pathspec, properties)
def apply(url: String): Connector[WS] =
new WSConnector[WS](url, Properties())
def apply(url: String, properties: Properties): Connector[WS] =
new WSConnector[WS](url, properties)
trait Secure extends WS with communicator.Secure {
override def toString = s"WS.Secure($path, $host, $port)"
}
object Secure {
def unapply(ws: Secure) = Some((ws.path, ws.host, ws.port))
def apply(url: String): Connector[WS.Secure] =
new WSConnector[WS.Secure](url, Properties())
def apply(url: String, properties: Properties): Connector[WS.Secure] =
new WSConnector[WS.Secure](url, properties)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy