@Test public void shouldIncludeIdentityInSessionIdFormat() throws Exception { final IoAcceptorEx acceptor = context.mock(IoAcceptorEx.class, "acceptor"); SocketAddress remoteAddress = new InetSocketAddress("host", 12244); SocketAddress localAddress = new InetSocketAddress("host", 8001); context.checking(new Expectations() { { allowing(sessionEx).getService(); will(returnValue(acceptor)); oneOf(sessionEx).getRemoteAddress(); will(returnValue(remoteAddress)); oneOf(sessionEx).getLocalAddress(); will(returnValue(localAddress)); } }); LoggingFilter filter = new ObjectLoggingFilter(logger, sessionEx, "service"); String format = filter.getFormat(); assertTrue("Format did not match expected pattern: " + format, format.matches("service#%s host:12244")); }
public String getFormat() { return format; }
LoggingFilter extends IoFilterAdapter { public String getFormat() { return format; } }
LoggingFilter extends IoFilterAdapter { public String getFormat() { return format; } LoggingFilter(Logger logger);  LoggingFilter(Logger logger, IoSession session, String transportName);  LoggingFilter(Logger logger, String sessionIdFormat); }
LoggingFilter extends IoFilterAdapter { public String getFormat() { return format; } LoggingFilter(Logger logger);  LoggingFilter(Logger logger, IoSession session, String transportName);  LoggingFilter(Logger logger, String sessionIdFormat); static boolean addIfNeeded(Logger logger, IoSession session, String transportName); LogLevel getLevel(); Logger getLogger(); String getFormat(); @Override void sessionCreated(NextFilter nextFilter,
                               IoSession session); @Override void sessionOpened(NextFilter nextFilter,
                              IoSession session); @Override void messageReceived(NextFilter nextFilter,
                                IoSession session,
                                Object message); @Override void messageSent(NextFilter nextFilter,
                            IoSession session,
                            WriteRequest writeRequest); @Override void sessionIdle(NextFilter nextFilter,
                            IoSession session,
                            IdleStatus status); @Override void exceptionCaught(NextFilter nextFilter,
                                IoSession session,
                                Throwable cause); @Override void sessionClosed(NextFilter nextFilter,
                              IoSession session); @Override void filterWrite(NextFilter nextFilter,
                            IoSession session,
                            WriteRequest writeRequest); static void moveAfterCodec(IoSession session); }
LoggingFilter extends IoFilterAdapter { public String getFormat() { return format; } LoggingFilter(Logger logger);  LoggingFilter(Logger logger, IoSession session, String transportName);  LoggingFilter(Logger logger, String sessionIdFormat); static boolean addIfNeeded(Logger logger, IoSession session, String transportName); LogLevel getLevel(); Logger getLogger(); String getFormat(); @Override void sessionCreated(NextFilter nextFilter,
                               IoSession session); @Override void sessionOpened(NextFilter nextFilter,
                              IoSession session); @Override void messageReceived(NextFilter nextFilter,
                                IoSession session,
                                Object message); @Override void messageSent(NextFilter nextFilter,
                            IoSession session,
                            WriteRequest writeRequest); @Override void sessionIdle(NextFilter nextFilter,
                            IoSession session,
                            IdleStatus status); @Override void exceptionCaught(NextFilter nextFilter,
                                IoSession session,
                                Throwable cause); @Override void sessionClosed(NextFilter nextFilter,
                              IoSession session); @Override void filterWrite(NextFilter nextFilter,
                            IoSession session,
                            WriteRequest writeRequest); static void moveAfterCodec(IoSession session);  }