private void addTraceForFrame ( WebSocketFrame frame , String type ) { Map < String , Object > trace = new LinkedHashMap <> ( ) ; trace . put ( "type" , type ) ; trace . put ( "direction" , "in" ) ; if ( frame instanceof TextWebSocketFrame ) { trace . put ( "payload" , ( ( TextWebSocketFrame ) frame ) . text ( ) ) ; } if ( traceEnabled ) { websocketTraceRepository . add ( trace ) ; } }
add trace information for received frame