Skip to content

Package: Extension

Extension

Coverage

1: /*
2: * Copyright (c) 2018, 2019 Oracle and/or its affiliates and others.
3: * All rights reserved.
4: *
5: * This program and the accompanying materials are made available under the
6: * terms of the Eclipse Public License v. 2.0, which is available at
7: * http://www.eclipse.org/legal/epl-2.0.
8: *
9: * This Source Code may also be made available under the following Secondary
10: * Licenses when the conditions for such availability set forth in the
11: * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
12: * version 2 with the GNU Classpath Exception, which is available at
13: * https://www.gnu.org/software/classpath/license.html.
14: *
15: * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16: */
17:
18: package jakarta.websocket;
19:
20: import java.util.List;
21:
22: /**
23: * A simple representation of a websocket extension as a name and map of extension parameters.
24: *
25: * @author dannycoward
26: */
27: public interface Extension {
28:
29: /**
30: * The name of the extension.
31: *
32: * @return the name of the extension.
33: */
34: String getName();
35:
36: /**
37: * The extension parameters for this extension in the order they appear in the http headers.
38: *
39: * @return The read-only Map of extension parameters belonging to this extension.
40: */
41: List<Parameter> getParameters();
42:
43: /**
44: * This member interface defines a single websocket extension parameter.
45: */
46: interface Parameter {
47: /**
48: * Return the name of the extension parameter.
49: *
50: * @return the name of the parameter.
51: */
52: String getName();
53:
54: /**
55: * Return the value of the extension parameter.
56: *
57: * @return the value of the parameter.
58: */
59: String getValue();
60: }
61: }