public static Map < String , List < TraceEvent > > filterLifecycleEvents ( List < TraceEvent > data ) throws Exception { Map < String , List < TraceEvent > > result = new TreeMap < String , List < TraceEvent > > ( ) ; for ( TraceEvent te : data ) { if ( te . getType ( ) == TraceEvent . CREATE_CONNECTION_LISTENER_GET || te . getType ( ) == TraceEvent . CREATE_CONNECTION_LISTENER_PREFILL || te . getType ( ) == TraceEvent . CREATE_CONNECTION_LISTENER_INCREMENTER || te . getType ( ) == TraceEvent . DESTROY_CONNECTION_LISTENER_RETURN || te . getType ( ) == TraceEvent . DESTROY_CONNECTION_LISTENER_IDLE || te . getType ( ) == TraceEvent . DESTROY_CONNECTION_LISTENER_INVALID || te . getType ( ) == TraceEvent . DESTROY_CONNECTION_LISTENER_FLUSH || te . getType ( ) == TraceEvent . DESTROY_CONNECTION_LISTENER_ERROR || te . getType ( ) == TraceEvent . DESTROY_CONNECTION_LISTENER_PREFILL || te . getType ( ) == TraceEvent . DESTROY_CONNECTION_LISTENER_INCREMENTER || te . getType ( ) == TraceEvent . MANAGED_CONNECTION_POOL_CREATE || te . getType ( ) == TraceEvent . MANAGED_CONNECTION_POOL_DESTROY ) { List < TraceEvent > l = result . get ( te . getPool ( ) ) ; if ( l == null ) l = new ArrayList < TraceEvent > ( ) ; l . add ( te ) ; result . put ( te . getPool ( ) , l ) ; } } return result ; }
Filter the lifecycle events