Top Description Methods
org.java_websocket.protocols

public Interface IProtocol

Known Direct Implementers
org.java_websocket.protocols.Protocol

Interface which specifies all required methods for a Sec-WebSocket-Protocol
Since
1.3.7

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true, if the offer does fit to this specific protocol
acceptProvidedProtocol
(String
the received Sec-WebSocket-Protocol header field offered by the other endpoint
inputProtocolHeader
)

Check if the received Sec-WebSocket-Protocol header field contains a offer for the specific protocol

public IProtocol

Returns:

a copy of the protocol
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.

public String

Returns:

the specific Sec-WebSocket-Protocol header for this protocol
getProvidedProtocol
()

Return the specific Sec-WebSocket-protocol header offer for this protocol if the endpoint.

public String

Returns:

a string containing the protocol name as well as additional information
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

acceptProvidedProtocolback to summary
public boolean acceptProvidedProtocol(String inputProtocolHeader)

Check if the received Sec-WebSocket-Protocol header field contains a offer for the specific protocol

Parameters
inputProtocolHeader:String

the received Sec-WebSocket-Protocol header field offered by the other endpoint

Returns:boolean

true, if the offer does fit to this specific protocol

Since
1.3.7
copyInstanceback to summary
public 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:IProtocol

a copy of the protocol

Since
1.3.7
getProvidedProtocolback to summary
public 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:String

the specific Sec-WebSocket-Protocol header for this protocol

Since
1.3.7
toStringback to summary
public 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)

Returns:String

a string containing the protocol name as well as additional information

Since
1.3.7