Package com.microsoft.signalr
Class GsonHubProtocol
- java.lang.Object
-
- com.microsoft.signalr.GsonHubProtocol
-
- All Implemented Interfaces:
HubProtocol
public final class GsonHubProtocol extends java.lang.Object implements HubProtocol
-
-
Constructor Summary
Constructors Constructor Description GsonHubProtocol()
GsonHubProtocol(com.google.gson.Gson gson)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getName()
int
getVersion()
java.util.List<HubMessage>
parseMessages(java.nio.ByteBuffer payload, InvocationBinder binder)
Creates a new list ofHubMessage
s.java.nio.ByteBuffer
writeMessage(HubMessage hubMessage)
Writes the specifiedHubMessage
to a String.
-
-
-
Method Detail
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceHubProtocol
-
getVersion
public int getVersion()
- Specified by:
getVersion
in interfaceHubProtocol
-
parseMessages
public java.util.List<HubMessage> parseMessages(java.nio.ByteBuffer payload, InvocationBinder binder)
Description copied from interface:HubProtocol
Creates a new list ofHubMessage
s.- Specified by:
parseMessages
in interfaceHubProtocol
- Parameters:
payload
- A ByteBuffer representation of one or moreHubMessage
s.binder
- TheInvocationBinder
to use for this Protocol instance.- Returns:
- A list of
HubMessage
s.
-
writeMessage
public java.nio.ByteBuffer writeMessage(HubMessage hubMessage)
Description copied from interface:HubProtocol
Writes the specifiedHubMessage
to a String.- Specified by:
writeMessage
in interfaceHubProtocol
- Parameters:
hubMessage
- The message to write.- Returns:
- A ByteBuffer representation of the message.
-
-