View Javadoc

1   //
2   //  ========================================================================
3   //  Copyright (c) 1995-2016 Mort Bay Consulting Pty. Ltd.
4   //  ------------------------------------------------------------------------
5   //  All rights reserved. This program and the accompanying materials
6   //  are made available under the terms of the Eclipse Public License v1.0
7   //  and Apache License v2.0 which accompanies this distribution.
8   //
9   //      The Eclipse Public License is available at
10  //      http://www.eclipse.org/legal/epl-v10.html
11  //
12  //      The Apache License v2.0 is available at
13  //      http://www.opensource.org/licenses/apache2.0.php
14  //
15  //  You may elect to redistribute this code under either of these licenses.
16  //  ========================================================================
17  //
18  
19  package org.eclipse.jetty.websocket.jsr356.client;
20  
21  import java.util.ArrayList;
22  import java.util.HashMap;
23  import java.util.List;
24  import java.util.Map;
25  
26  import javax.websocket.ClientEndpointConfig;
27  import javax.websocket.Decoder;
28  import javax.websocket.Encoder;
29  import javax.websocket.Extension;
30  
31  public class EmptyClientEndpointConfig implements ClientEndpointConfig
32  {
33      private final List<Class<? extends Decoder>> decoders;
34      private final List<Class<? extends Encoder>> encoders;
35      private final List<Extension> extensions;
36      private final List<String> preferredSubprotocols;
37      private final Configurator configurator;
38      private Map<String, Object> userProperties;
39  
40      public EmptyClientEndpointConfig()
41      {
42          this.decoders = new ArrayList<>();
43          this.encoders = new ArrayList<>();
44          this.preferredSubprotocols = new ArrayList<>();
45          this.extensions = new ArrayList<>();
46          this.userProperties = new HashMap<>();
47          this.configurator = EmptyConfigurator.INSTANCE;
48      }
49  
50      @Override
51      public Configurator getConfigurator()
52      {
53          return configurator;
54      }
55  
56      @Override
57      public List<Class<? extends Decoder>> getDecoders()
58      {
59          return decoders;
60      }
61  
62      @Override
63      public List<Class<? extends Encoder>> getEncoders()
64      {
65          return encoders;
66      }
67  
68      @Override
69      public List<Extension> getExtensions()
70      {
71          return extensions;
72      }
73  
74      @Override
75      public List<String> getPreferredSubprotocols()
76      {
77          return preferredSubprotocols;
78      }
79  
80      @Override
81      public Map<String, Object> getUserProperties()
82      {
83          return userProperties;
84      }
85  }