@Test public void matches() { final SockJsHandler.PathParams sessionPath = SockJsHandler.matches("/000/123/xhr_send"); assertThat(sessionPath.matches(), is(true)); assertThat(sessionPath.serverId(), equalTo("000")); assertThat(sessionPath.sessionId(), equalTo("123")); assertThat(sessionPath.transport(), equalTo(Transports.Type.XHR_SEND)); }
static PathParams matches(final String path) { final Matcher matcher = SERVER_SESSION_PATTERN.matcher(path); if (matcher.find()) { final String serverId = matcher.group(1); final String sessionId = matcher.group(2); final String transport = matcher.group(3); return new MatchingSessionPath(serverId, sessionId, transport); } else { return NON_SUPPORTED_PATH; } }
SockJsHandler extends SimpleChannelInboundHandler<FullHttpRequest> { static PathParams matches(final String path) { final Matcher matcher = SERVER_SESSION_PATTERN.matcher(path); if (matcher.find()) { final String serverId = matcher.group(1); final String sessionId = matcher.group(2); final String transport = matcher.group(3); return new MatchingSessionPath(serverId, sessionId, transport); } else { return NON_SUPPORTED_PATH; } } }
SockJsHandler extends SimpleChannelInboundHandler<FullHttpRequest> { static PathParams matches(final String path) { final Matcher matcher = SERVER_SESSION_PATTERN.matcher(path); if (matcher.find()) { final String serverId = matcher.group(1); final String sessionId = matcher.group(2); final String transport = matcher.group(3); return new MatchingSessionPath(serverId, sessionId, transport); } else { return NON_SUPPORTED_PATH; } } SockJsHandler(final SockJsServiceFactory... factories); }
SockJsHandler extends SimpleChannelInboundHandler<FullHttpRequest> { static PathParams matches(final String path) { final Matcher matcher = SERVER_SESSION_PATTERN.matcher(path); if (matcher.find()) { final String serverId = matcher.group(1); final String sessionId = matcher.group(2); final String transport = matcher.group(3); return new MatchingSessionPath(serverId, sessionId, transport); } else { return NON_SUPPORTED_PATH; } } SockJsHandler(final SockJsServiceFactory... factories); @Override void messageReceived(final ChannelHandlerContext ctx, final FullHttpRequest request); @Override void exceptionCaught(ChannelHandlerContext ctx, Throwable cause); }
SockJsHandler extends SimpleChannelInboundHandler<FullHttpRequest> { static PathParams matches(final String path) { final Matcher matcher = SERVER_SESSION_PATTERN.matcher(path); if (matcher.find()) { final String serverId = matcher.group(1); final String sessionId = matcher.group(2); final String transport = matcher.group(3); return new MatchingSessionPath(serverId, sessionId, transport); } else { return NON_SUPPORTED_PATH; } } SockJsHandler(final SockJsServiceFactory... factories); @Override void messageReceived(final ChannelHandlerContext ctx, final FullHttpRequest request); @Override void exceptionCaught(ChannelHandlerContext ctx, Throwable cause);  }