Draft_6455public abstract class Draft
extends java.lang.Object
| Modifier and Type | Class | Description |
|---|---|---|
static class |
Draft.CloseHandshakeType |
Enum which represents type of handshake is required for a close
|
static class |
Draft.HandshakeState |
Enum which represents the states a handshake may be in
|
| Modifier and Type | Field | Description |
|---|---|---|
protected Framedata.Opcode |
continuousFrameType |
|
static int |
INITIAL_FAMESIZE |
|
static int |
MAX_FAME_SIZE |
|
protected WebSocket.Role |
role |
In some cases the handshake will be parsed different depending on whether
|
| Constructor | Description |
|---|---|
Draft() |
| Modifier and Type | Method | Description |
|---|---|---|
abstract Draft.HandshakeState |
acceptHandshakeAsClient(ClientHandshake request,
ServerHandshake response) |
|
abstract Draft.HandshakeState |
acceptHandshakeAsServer(ClientHandshake handshakedata) |
|
protected boolean |
basicAccept(Handshakedata handshakedata) |
|
int |
checkAlloc(int bytecount) |
|
java.util.List<Framedata> |
continuousFrame(Framedata.Opcode op,
java.nio.ByteBuffer buffer,
boolean fin) |
|
abstract Draft |
copyInstance() |
Drafts must only be by one websocket at all.
|
abstract java.nio.ByteBuffer |
createBinaryFrame(Framedata framedata) |
|
abstract java.util.List<Framedata> |
createFrames(java.lang.String text,
boolean mask) |
|
abstract java.util.List<Framedata> |
createFrames(java.nio.ByteBuffer binary,
boolean mask) |
|
java.util.List<java.nio.ByteBuffer> |
createHandshake(Handshakedata handshakedata,
WebSocket.Role ownrole) |
|
java.util.List<java.nio.ByteBuffer> |
createHandshake(Handshakedata handshakedata,
WebSocket.Role ownrole,
boolean withcontent) |
|
abstract Draft.CloseHandshakeType |
getCloseHandshakeType() |
|
WebSocket.Role |
getRole() |
|
abstract ClientHandshakeBuilder |
postProcessHandshakeRequestAsClient(ClientHandshakeBuilder request) |
|
abstract HandshakeBuilder |
postProcessHandshakeResponseAsServer(ClientHandshake request,
ServerHandshakeBuilder response) |
|
abstract void |
processFrame(WebSocketImpl webSocketImpl,
Framedata frame) |
Handle the frame specific to the draft
|
static java.nio.ByteBuffer |
readLine(java.nio.ByteBuffer buf) |
|
static java.lang.String |
readStringLine(java.nio.ByteBuffer buf) |
|
abstract void |
reset() |
|
void |
setParseMode(WebSocket.Role role) |
|
java.lang.String |
toString() |
|
abstract java.util.List<Framedata> |
translateFrame(java.nio.ByteBuffer buffer) |
|
Handshakedata |
translateHandshake(java.nio.ByteBuffer buf) |
|
static HandshakeBuilder |
translateHandshakeHttp(java.nio.ByteBuffer buf,
WebSocket.Role role) |
public static int MAX_FAME_SIZE
public static int INITIAL_FAMESIZE
protected WebSocket.Role role
protected Framedata.Opcode continuousFrameType
public static java.nio.ByteBuffer readLine(java.nio.ByteBuffer buf)
public static java.lang.String readStringLine(java.nio.ByteBuffer buf)
public static HandshakeBuilder translateHandshakeHttp(java.nio.ByteBuffer buf, WebSocket.Role role) throws InvalidHandshakeException, IncompleteHandshakeException
public abstract Draft.HandshakeState acceptHandshakeAsClient(ClientHandshake request, ServerHandshake response) throws InvalidHandshakeException
InvalidHandshakeExceptionpublic abstract Draft.HandshakeState acceptHandshakeAsServer(ClientHandshake handshakedata) throws InvalidHandshakeException
InvalidHandshakeExceptionprotected boolean basicAccept(Handshakedata handshakedata)
public abstract java.nio.ByteBuffer createBinaryFrame(Framedata framedata)
public abstract java.util.List<Framedata> createFrames(java.nio.ByteBuffer binary, boolean mask)
public abstract java.util.List<Framedata> createFrames(java.lang.String text, boolean mask)
public abstract void processFrame(WebSocketImpl webSocketImpl, Framedata frame) throws InvalidDataException
webSocketImpl - the websocketimpl used for this draftframe - the frame which is supposed to be handledInvalidDataException - will be thrown on invalid datapublic java.util.List<Framedata> continuousFrame(Framedata.Opcode op, java.nio.ByteBuffer buffer, boolean fin)
public abstract void reset()
public java.util.List<java.nio.ByteBuffer> createHandshake(Handshakedata handshakedata, WebSocket.Role ownrole)
public java.util.List<java.nio.ByteBuffer> createHandshake(Handshakedata handshakedata, WebSocket.Role ownrole, boolean withcontent)
public abstract ClientHandshakeBuilder postProcessHandshakeRequestAsClient(ClientHandshakeBuilder request) throws InvalidHandshakeException
InvalidHandshakeExceptionpublic abstract HandshakeBuilder postProcessHandshakeResponseAsServer(ClientHandshake request, ServerHandshakeBuilder response) throws InvalidHandshakeException
InvalidHandshakeExceptionpublic abstract java.util.List<Framedata> translateFrame(java.nio.ByteBuffer buffer) throws InvalidDataException
InvalidDataExceptionpublic abstract Draft.CloseHandshakeType getCloseHandshakeType()
public abstract Draft copyInstance()
public Handshakedata translateHandshake(java.nio.ByteBuffer buf) throws InvalidHandshakeException
InvalidHandshakeExceptionpublic int checkAlloc(int bytecount)
throws LimitExedeedException,
InvalidDataException
public void setParseMode(WebSocket.Role role)
public WebSocket.Role getRole()
public java.lang.String toString()
toString in class java.lang.Object