1*1157Smax.romanov@nginx.com /* 2*1157Smax.romanov@nginx.com * Licensed to the Apache Software Foundation (ASF) under one or more 3*1157Smax.romanov@nginx.com * contributor license agreements. See the NOTICE file distributed with 4*1157Smax.romanov@nginx.com * this work for additional information regarding copyright ownership. 5*1157Smax.romanov@nginx.com * The ASF licenses this file to You under the Apache License, Version 2.0 6*1157Smax.romanov@nginx.com * (the "License"); you may not use this file except in compliance with 7*1157Smax.romanov@nginx.com * the License. You may obtain a copy of the License at 8*1157Smax.romanov@nginx.com * 9*1157Smax.romanov@nginx.com * http://www.apache.org/licenses/LICENSE-2.0 10*1157Smax.romanov@nginx.com * 11*1157Smax.romanov@nginx.com * Unless required by applicable law or agreed to in writing, software 12*1157Smax.romanov@nginx.com * distributed under the License is distributed on an "AS IS" BASIS, 13*1157Smax.romanov@nginx.com * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14*1157Smax.romanov@nginx.com * See the License for the specific language governing permissions and 15*1157Smax.romanov@nginx.com * limitations under the License. 16*1157Smax.romanov@nginx.com */ 17*1157Smax.romanov@nginx.com package javax.websocket; 18*1157Smax.romanov@nginx.com 19*1157Smax.romanov@nginx.com import java.util.List; 20*1157Smax.romanov@nginx.com import java.util.Map; 21*1157Smax.romanov@nginx.com import java.util.concurrent.ConcurrentHashMap; 22*1157Smax.romanov@nginx.com 23*1157Smax.romanov@nginx.com final class DefaultClientEndpointConfig implements ClientEndpointConfig { 24*1157Smax.romanov@nginx.com 25*1157Smax.romanov@nginx.com private final List<String> preferredSubprotocols; 26*1157Smax.romanov@nginx.com private final List<Extension> extensions; 27*1157Smax.romanov@nginx.com private final List<Class<? extends Encoder>> encoders; 28*1157Smax.romanov@nginx.com private final List<Class<? extends Decoder>> decoders; 29*1157Smax.romanov@nginx.com private final Map<String,Object> userProperties = new ConcurrentHashMap<>(); 30*1157Smax.romanov@nginx.com private final Configurator configurator; 31*1157Smax.romanov@nginx.com 32*1157Smax.romanov@nginx.com DefaultClientEndpointConfig(List<String> preferredSubprotocols, List<Extension> extensions, List<Class<? extends Encoder>> encoders, List<Class<? extends Decoder>> decoders, Configurator configurator)33*1157Smax.romanov@nginx.com DefaultClientEndpointConfig(List<String> preferredSubprotocols, 34*1157Smax.romanov@nginx.com List<Extension> extensions, 35*1157Smax.romanov@nginx.com List<Class<? extends Encoder>> encoders, 36*1157Smax.romanov@nginx.com List<Class<? extends Decoder>> decoders, 37*1157Smax.romanov@nginx.com Configurator configurator) { 38*1157Smax.romanov@nginx.com this.preferredSubprotocols = preferredSubprotocols; 39*1157Smax.romanov@nginx.com this.extensions = extensions; 40*1157Smax.romanov@nginx.com this.decoders = decoders; 41*1157Smax.romanov@nginx.com this.encoders = encoders; 42*1157Smax.romanov@nginx.com this.configurator = configurator; 43*1157Smax.romanov@nginx.com } 44*1157Smax.romanov@nginx.com 45*1157Smax.romanov@nginx.com 46*1157Smax.romanov@nginx.com @Override getPreferredSubprotocols()47*1157Smax.romanov@nginx.com public List<String> getPreferredSubprotocols() { 48*1157Smax.romanov@nginx.com return preferredSubprotocols; 49*1157Smax.romanov@nginx.com } 50*1157Smax.romanov@nginx.com 51*1157Smax.romanov@nginx.com 52*1157Smax.romanov@nginx.com @Override getExtensions()53*1157Smax.romanov@nginx.com public List<Extension> getExtensions() { 54*1157Smax.romanov@nginx.com return extensions; 55*1157Smax.romanov@nginx.com } 56*1157Smax.romanov@nginx.com 57*1157Smax.romanov@nginx.com 58*1157Smax.romanov@nginx.com @Override getEncoders()59*1157Smax.romanov@nginx.com public List<Class<? extends Encoder>> getEncoders() { 60*1157Smax.romanov@nginx.com return encoders; 61*1157Smax.romanov@nginx.com } 62*1157Smax.romanov@nginx.com 63*1157Smax.romanov@nginx.com 64*1157Smax.romanov@nginx.com @Override getDecoders()65*1157Smax.romanov@nginx.com public List<Class<? extends Decoder>> getDecoders() { 66*1157Smax.romanov@nginx.com return decoders; 67*1157Smax.romanov@nginx.com } 68*1157Smax.romanov@nginx.com 69*1157Smax.romanov@nginx.com 70*1157Smax.romanov@nginx.com @Override getUserProperties()71*1157Smax.romanov@nginx.com public final Map<String, Object> getUserProperties() { 72*1157Smax.romanov@nginx.com return userProperties; 73*1157Smax.romanov@nginx.com } 74*1157Smax.romanov@nginx.com 75*1157Smax.romanov@nginx.com 76*1157Smax.romanov@nginx.com @Override getConfigurator()77*1157Smax.romanov@nginx.com public Configurator getConfigurator() { 78*1157Smax.romanov@nginx.com return configurator; 79*1157Smax.romanov@nginx.com } 80*1157Smax.romanov@nginx.com } 81