wip #19441 convert from Option to Optional in javadsl
This commit is contained in:
parent
6ba20ac673
commit
a8abbaf36b
10 changed files with 42 additions and 31 deletions
|
|
@ -11,6 +11,7 @@ import akka.stream.io.ClientAuth
|
|||
import scala.compat.java8.OptionConverters
|
||||
|
||||
object ConnectionContext {
|
||||
//#https-context-creation
|
||||
/** Used to serve HTTPS traffic. */
|
||||
def https(sslContext: SSLContext): HttpsConnectionContext =
|
||||
scaladsl.ConnectionContext.https(sslContext)
|
||||
|
|
@ -19,6 +20,7 @@ object ConnectionContext {
|
|||
def https(sslContext: SSLContext, enabledCipherSuites: Optional[JCollection[String]],
|
||||
enabledProtocols: Optional[JCollection[String]], clientAuth: Optional[ClientAuth], sslParameters: Optional[SSLParameters]) =
|
||||
scaladsl.ConnectionContext.https(sslContext, sslParameters = OptionConverters.toScala(sslParameters))
|
||||
//#https-context-creation
|
||||
|
||||
/** Used to serve HTTP traffic. */
|
||||
def noEncryption(): HttpConnectionContext =
|
||||
|
|
@ -52,4 +54,3 @@ abstract class HttpsConnectionContext extends akka.http.javadsl.ConnectionContex
|
|||
/** Java API */
|
||||
def getSslParameters: Optional[SSLParameters]
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ trait ConnectionContext extends akka.http.javadsl.ConnectionContext {
|
|||
}
|
||||
|
||||
object ConnectionContext {
|
||||
//#https-context-creation
|
||||
def https(sslContext: SSLContext,
|
||||
enabledCipherSuites: Option[immutable.Seq[String]] = None,
|
||||
enabledProtocols: Option[immutable.Seq[String]] = None,
|
||||
|
|
@ -25,6 +26,7 @@ object ConnectionContext {
|
|||
sslParameters: Option[SSLParameters] = None) = {
|
||||
new HttpsConnectionContext(sslContext, enabledCipherSuites, enabledProtocols, clientAuth, sslParameters)
|
||||
}
|
||||
//#https-context-creation
|
||||
|
||||
def noEncryption() = HttpConnectionContext
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue