Top Description Constructors Methods
org.java_websocket.extensions

public Class DefaultExtension

extends Object
implements IExtension
Class Inheritance
All Implemented Interfaces
org.java_websocket.extensions.IExtension
Known Direct Subclasses
org.java_websocket.extensions.CompressionExtension
Imports
org.java_websocket.exceptions.InvalidDataException, .InvalidFrameException, org.java_websocket.framing.Framedata

Class which represents the normal websocket implementation specified by rfc6455.

This is a fallback and will always be available for a Draft_6455

Since
1.3.5

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
acceptProvidedExtensionAsClient(String inputExtension)

Implements org.java_websocket.extensions.IExtension.acceptProvidedExtensionAsClient.

Check if the received Sec-WebSocket-Extensions header field contains a offer for the specific extension if the endpoint is in the role of a client

public boolean
acceptProvidedExtensionAsServer(String inputExtension)

Implements org.java_websocket.extensions.IExtension.acceptProvidedExtensionAsServer.

Check if the received Sec-WebSocket-Extensions header field contains a offer for the specific extension if the endpoint is in the role of a server

public IExtension
copyInstance()

Implements org.java_websocket.extensions.IExtension.copyInstance.

Extensions must only be by one websocket at all.

public void
decodeFrame(Framedata inputFrame)

Implements org.java_websocket.extensions.IExtension.decodeFrame.

Decode a frame with a extension specific algorithm.

public void
encodeFrame(Framedata inputFrame)

Implements org.java_websocket.extensions.IExtension.encodeFrame.

Encode a frame with a extension specific algorithm.

public boolean
equals(Object o)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public String
getProvidedExtensionAsClient()

Implements org.java_websocket.extensions.IExtension.getProvidedExtensionAsClient.

Return the specific Sec-WebSocket-Extensions header offer for this extension if the endpoint is in the role of a client.

public String
getProvidedExtensionAsServer()

Implements org.java_websocket.extensions.IExtension.getProvidedExtensionAsServer.

Return the specific Sec-WebSocket-Extensions header offer for this extension if the endpoint is in the role of a server.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public void
isFrameValid(Framedata inputFrame)

Implements org.java_websocket.extensions.IExtension.isFrameValid.

Check if the received frame is correctly implemented by the other endpoint and there are no specification errors (like wrongly set RSV)

public void
reset()

Implements org.java_websocket.extensions.IExtension.reset.

Cleaning up internal stats when the draft gets reset.

public String
toString()

Overrides java.lang.Object.toString.

Implements org.java_websocket.extensions.IExtension.toString.

Return a string which should contain the class name as well as additional information about the current configurations for this extension (DEBUG purposes)

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Constructor Detail

DefaultExtensionback to summary
public DefaultExtension()

Method Detail

acceptProvidedExtensionAsClientback to summary
public boolean acceptProvidedExtensionAsClient(String inputExtension)

Implements org.java_websocket.extensions.IExtension.acceptProvidedExtensionAsClient.

Doc from org.java_websocket.extensions.IExtension.acceptProvidedExtensionAsClient.

Check if the received Sec-WebSocket-Extensions header field contains a offer for the specific extension if the endpoint is in the role of a client

Annotations
@Override
acceptProvidedExtensionAsServerback to summary
public boolean acceptProvidedExtensionAsServer(String inputExtension)

Implements org.java_websocket.extensions.IExtension.acceptProvidedExtensionAsServer.

Doc from org.java_websocket.extensions.IExtension.acceptProvidedExtensionAsServer.

Check if the received Sec-WebSocket-Extensions header field contains a offer for the specific extension if the endpoint is in the role of a server

Annotations
@Override
copyInstanceback to summary
public IExtension copyInstance()

Implements org.java_websocket.extensions.IExtension.copyInstance.

Doc from org.java_websocket.extensions.IExtension.copyInstance.

Extensions must only be by one websocket at all. To prevent extensions to be used more than once the Websocket implementation should call this method in order to create a new usable version of a given extension instance.
The copy can be safely used in conjunction with a new websocket connection.

Annotations
@Override
decodeFrameback to summary
public void decodeFrame(Framedata inputFrame) throws InvalidDataException

Implements org.java_websocket.extensions.IExtension.decodeFrame.

Doc from org.java_websocket.extensions.IExtension.decodeFrame.

Decode a frame with a extension specific algorithm. The algorithm is subject to be implemented by the specific extension. The resulting frame will be used in the application

Annotations
@Override
Exceptions
InvalidDataException:
Throw InvalidDataException if the received frame is not correctly implemented by the other endpoint or there are other protocol errors/decoding errors
encodeFrameback to summary
public void encodeFrame(Framedata inputFrame)

Implements org.java_websocket.extensions.IExtension.encodeFrame.

Doc from org.java_websocket.extensions.IExtension.encodeFrame.

Encode a frame with a extension specific algorithm. The algorithm is subject to be implemented by the specific extension. The resulting frame will be send to the other endpoint.

Annotations
@Override
equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Annotations
@Override
getProvidedExtensionAsClientback to summary
public String getProvidedExtensionAsClient()

Implements org.java_websocket.extensions.IExtension.getProvidedExtensionAsClient.

Doc from org.java_websocket.extensions.IExtension.getProvidedExtensionAsClient.

Return the specific Sec-WebSocket-Extensions header offer for this extension if the endpoint is in the role of a client. If the extension returns an empty string (""), the offer will not be included in the handshake.

Annotations
@Override
getProvidedExtensionAsServerback to summary
public String getProvidedExtensionAsServer()

Implements org.java_websocket.extensions.IExtension.getProvidedExtensionAsServer.

Doc from org.java_websocket.extensions.IExtension.getProvidedExtensionAsServer.

Return the specific Sec-WebSocket-Extensions header offer for this extension if the endpoint is in the role of a server. If the extension returns an empty string (""), the offer will not be included in the handshake.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Annotations
@Override
isFrameValidback to summary
public void isFrameValid(Framedata inputFrame) throws InvalidDataException

Implements org.java_websocket.extensions.IExtension.isFrameValid.

Doc from org.java_websocket.extensions.IExtension.isFrameValid.

Check if the received frame is correctly implemented by the other endpoint and there are no specification errors (like wrongly set RSV)

Annotations
@Override
Exceptions
InvalidDataException:
Throw InvalidDataException if the received frame is not correctly implementing the specification for the specific extension
resetback to summary
public void reset()

Implements org.java_websocket.extensions.IExtension.reset.

Doc from org.java_websocket.extensions.IExtension.reset.

Cleaning up internal stats when the draft gets reset.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Implements org.java_websocket.extensions.IExtension.toString.

Doc from org.java_websocket.extensions.IExtension.toString.

Return a string which should contain the class name as well as additional information about the current configurations for this extension (DEBUG purposes)

Annotations
@Override