1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.eclipse.jetty.websocket.jsr356.server;
20
21 import javax.websocket.Endpoint;
22 import javax.websocket.server.ServerEndpointConfig;
23
24 import org.eclipse.jetty.websocket.jsr356.client.SimpleEndpointMetadata;
25
26 public class SimpleServerEndpointMetadata extends SimpleEndpointMetadata implements ServerEndpointMetadata
27 {
28 private final ServerEndpointConfig config;
29
30 public SimpleServerEndpointMetadata(Class<? extends Endpoint> endpointClass, ServerEndpointConfig config)
31 {
32 super(endpointClass);
33 this.config = config;
34 if (this.config != null)
35 {
36 getDecoders().addAll(config.getDecoders());
37 getEncoders().addAll(config.getEncoders());
38 }
39 }
40
41 @Override
42 public ServerEndpointConfig getConfig()
43 {
44 return config;
45 }
46
47 @Override
48 public String getPath()
49 {
50 return config.getPath();
51 }
52
53 @Override
54 public String toString()
55 {
56 StringBuilder builder = new StringBuilder();
57 builder.append("SimpleServerEndpointMetadata [");
58 builder.append("config=").append(config.getClass().getName());
59 builder.append(",path=").append(config.getPath());
60 builder.append(",endpoint=").append(config.getEndpointClass());
61 builder.append(",decoders=").append(config.getDecoders());
62 builder.append(",encoders=").append(config.getEncoders());
63 builder.append("]");
64 return builder.toString();
65 }
66 }