if (!(frame instanceof TextWebSocketFrame)) {
throw new UnsupportedOperationException(String.format("%s frame types not supported", frame.getClass()
.getName()));
}
@SuppressWarnings("unchecked") final EJValue val = JSONDecoder.decode(((TextWebSocketFrame) frame).text());
final QueueSession session;
// this is not an active channel.
if (!activeChannels.containsKey(ctx.channel())) {
if (val == null) {
sendMessage(ctx, getFailedNegotiation("illegal handshake"));
return;
}
final EJObject ejObject = val.isObject();
if (ejObject == null) {
return;
}
final EJValue ejValue = ejObject.get(MessageParts.CommandType.name());
if (ejValue.isNull()) {
sendMessage(ctx, getFailedNegotiation("illegal handshake"));
}
final String commandType = ejValue.isString().stringValue();
// this client apparently wants to connect.
if (BusCommand.Associate.name().equals(commandType)) {
final String sessionKey = ejObject.get(MessageParts.ConnectionSessionKey.name()).isString().stringValue();