ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/jakarta/websocket/ClientEndpointConfig.java

Path
ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/jakarta/websocket/ClientEndpointConfig.java
Status
scanned
Type
file
Name
ClientEndpointConfig.java
Extension
.java
Programming language
Java
Mime type
text/plain
File type
ASCII text, with CRLF line terminators
Tag

      
    
Rootfs path

      
    
Size
4742 (4.6 KB)
MD5
23e52365372fce1a554a4dc0738e0f85
SHA1
7119f265164255ac0b50fba2fef1dbca73585ee9
SHA256
16fa64d2dae9815b077853c87097d41013ce37b2b6db014f939e794ae7b4568f
SHA512

      
    
SHA1_git
3f65719194a50996aee90c5d75c945efb2a9710c
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
ClientEndpointConfig.java | 4.6 KB |

/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package jakarta.websocket; import java.util.Collections; import java.util.List; import java.util.Map; import javax.net.ssl.SSLContext; public interface ClientEndpointConfig extends EndpointConfig { List<String> getPreferredSubprotocols(); List<Extension> getExtensions(); SSLContext getSSLContext(); Configurator getConfigurator(); final class Builder { private static final Configurator DEFAULT_CONFIGURATOR = new Configurator() { }; public static Builder create() { return new Builder(); } private Builder() { // Hide default constructor } private Configurator configurator = DEFAULT_CONFIGURATOR; private List<String> preferredSubprotocols = Collections.emptyList(); private List<Extension> extensions = Collections.emptyList(); private List<Class<? extends Encoder>> encoders = Collections.emptyList(); private List<Class<? extends Decoder>> decoders = Collections.emptyList(); private SSLContext sslContext = null; public ClientEndpointConfig build() { return new DefaultClientEndpointConfig(preferredSubprotocols, extensions, encoders, decoders, sslContext, configurator); } public Builder configurator(Configurator configurator) { if (configurator == null) { this.configurator = DEFAULT_CONFIGURATOR; } else { this.configurator = configurator; } return this; } public Builder preferredSubprotocols(List<String> preferredSubprotocols) { if (preferredSubprotocols == null || preferredSubprotocols.isEmpty()) { this.preferredSubprotocols = Collections.emptyList(); } else { this.preferredSubprotocols = Collections.unmodifiableList(preferredSubprotocols); } return this; } public Builder extensions(List<Extension> extensions) { if (extensions == null || extensions.isEmpty()) { this.extensions = Collections.emptyList(); } else { this.extensions = Collections.unmodifiableList(extensions); } return this; } public Builder encoders(List<Class<? extends Encoder>> encoders) { if (encoders == null || encoders.isEmpty()) { this.encoders = Collections.emptyList(); } else { this.encoders = Collections.unmodifiableList(encoders); } return this; } public Builder decoders(List<Class<? extends Decoder>> decoders) { if (decoders == null || decoders.isEmpty()) { this.decoders = Collections.emptyList(); } else { this.decoders = Collections.unmodifiableList(decoders); } return this; } public Builder sslContext(SSLContext sslContext) { this.sslContext = sslContext; return this; } } class Configurator { /** * Provides the client with a mechanism to inspect and/or modify the headers that are sent to the server to * start the WebSocket handshake. * * @param headers The HTTP headers */ public void beforeRequest(Map<String,List<String>> headers) { // NO-OP } /** * Provides the client with a mechanism to inspect the handshake response that is returned from the server. * * @param handshakeResponse The response */ public void afterResponse(HandshakeResponse handshakeResponse) { // NO-OP } } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
28.95
Copyrights

      
    
Holders

      
    
Authors

      
    
License detections License expression License expression SPDX
apache_2_0-4bde3f57-78aa-4201-96bf-531cba09e7de apache-2.0 Apache-2.0
URL Start line End line
http://www.apache.org/licenses/LICENSE-2.0 9 9