Package org.java_websocket.protocols
Interface IProtocol
-
- All Known Implementing Classes:
Protocol
public interface IProtocol
Interface which specifies all required methods for a Sec-WebSocket-Protocol- Since:
- 1.3.7
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
acceptProvidedProtocol(String inputProtocolHeader)
Check if the received Sec-WebSocket-Protocol header field contains a offer for the specific protocolIProtocol
copyInstance()
To prevent protocols to be used more than once the Websocket implementation should call this method in order to create a new usable version of a given protocol instance.String
getProvidedProtocol()
Return the specific Sec-WebSocket-protocol header offer for this protocol if the endpoint.String
toString()
Return a string which should contain the protocol name as well as additional information about the current configurations for this protocol (DEBUG purposes)
-
-
-
Method Detail
-
acceptProvidedProtocol
boolean acceptProvidedProtocol(String inputProtocolHeader)
Check if the received Sec-WebSocket-Protocol header field contains a offer for the specific protocol- Parameters:
inputProtocolHeader
- the received Sec-WebSocket-Protocol header field offered by the other endpoint- Returns:
- true, if the offer does fit to this specific protocol
- Since:
- 1.3.7
-
getProvidedProtocol
String getProvidedProtocol()
Return the specific Sec-WebSocket-protocol header offer for this protocol if the endpoint. If the extension returns an empty string (""), the offer will not be included in the handshake.- Returns:
- the specific Sec-WebSocket-Protocol header for this protocol
- Since:
- 1.3.7
-
copyInstance
IProtocol copyInstance()
To prevent protocols to be used more than once the Websocket implementation should call this method in order to create a new usable version of a given protocol instance.- Returns:
- a copy of the protocol
- Since:
- 1.3.7
-
toString
String toString()
Return a string which should contain the protocol name as well as additional information about the current configurations for this protocol (DEBUG purposes)
-
-