-
public abstract class Draft
Base class for everything of a websocket specification which is not common such as the way the handshake is read or frames are transferred.
-
-
Method Summary
-
-
Method Detail
-
readLine
static ByteBuffer readLine(ByteBuffer buf)
-
readStringLine
static String readStringLine(ByteBuffer buf)
-
translateHandshakeHttp
static HandshakeBuilder translateHandshakeHttp(ByteBuffer buf, Role role)
-
acceptHandshakeAsClient
abstract HandshakeState acceptHandshakeAsClient(ClientHandshake request, ServerHandshake response)
-
acceptHandshakeAsServer
abstract HandshakeState acceptHandshakeAsServer(ClientHandshake handshakedata)
-
createBinaryFrame
abstract ByteBuffer createBinaryFrame(Framedata framedata)
-
createFrames
abstract List<Framedata> createFrames(ByteBuffer binary, boolean mask)
-
createFrames
abstract List<Framedata> createFrames(String text, boolean mask)
-
processFrame
abstract void processFrame(WebSocketImpl webSocketImpl, Framedata frame)
Handle the frame specific to the draft
- Parameters:
webSocketImpl
- the websocketimpl used for this draftframe
- the frame which is supposed to be handled
-
continuousFrame
List<Framedata> continuousFrame(Opcode op, ByteBuffer buffer, boolean fin)
-
reset
abstract void reset()
-
createHandshake
@Deprecated() List<ByteBuffer> createHandshake(Handshakedata handshakedata, Role ownrole)
-
createHandshake
List<ByteBuffer> createHandshake(Handshakedata handshakedata)
-
createHandshake
@Deprecated() List<ByteBuffer> createHandshake(Handshakedata handshakedata, Role ownrole, boolean withcontent)
-
createHandshake
List<ByteBuffer> createHandshake(Handshakedata handshakedata, boolean withcontent)
-
postProcessHandshakeRequestAsClient
abstract ClientHandshakeBuilder postProcessHandshakeRequestAsClient(ClientHandshakeBuilder request)
-
postProcessHandshakeResponseAsServer
abstract HandshakeBuilder postProcessHandshakeResponseAsServer(ClientHandshake request, ServerHandshakeBuilder response)
-
translateFrame
abstract List<Framedata> translateFrame(ByteBuffer buffer)
-
getCloseHandshakeType
abstract CloseHandshakeType getCloseHandshakeType()
-
copyInstance
abstract Draft copyInstance()
Drafts must only be by one websocket at all. To prevent drafts to be used more than once theWebsocket implementation should call this method in order to create a new usable version of agiven draft instance. The copy can be safely used in conjunction with a new websocketconnection.
-
translateHandshake
Handshakedata translateHandshake(ByteBuffer buf)
-
checkAlloc
int checkAlloc(int bytecount)
-
setParseMode
void setParseMode(Role role)
-
-
-
-