public Map<SocketMetaData, SocketStats> getSocketOperations(Threads threadMatcher, String address, boolean removeStackTraces) {

        Map.Entry<String, Integer> hostAndPort = SocketUtil.parseSocketAddress(address);

        String hostName = hostAndPort.getKey();
        Integer port = hostAndPort.getValue();

        Map<SocketMetaData, SocketStats> socketOperations = new LinkedHashMap<SocketMetaData, SocketStats>();
        for (Map.Entry<SocketMetaData, SocketStats> entry : this.socketOperations.ascendingMap().entrySet()) {

            SocketMetaData socketMetaData = entry.getKey();

            if (removeStackTraces) socketMetaData = new SocketMetaData(
                    socketMetaData.address, socketMetaData.connectionId, null, socketMetaData.ownerThreadId
            );

            InetSocketAddress socketAddress = socketMetaData.address;
            InetAddress inetAddress = socketAddress.getAddress();

            if ( ( (CURRENT == threadMatcher && socketMetaData.ownerThreadId == this.ownerThreadId) ||
                    (OTHERS == threadMatcher && socketMetaData.ownerThreadId != this.ownerThreadId) ||
                    (ANY == threadMatcher || null == threadMatcher) ) &&
                    (null == hostName || hostName.equals(inetAddress.getHostName()) || hostName.equals(inetAddress.getHostAddress())) &&
                    (null == port || port == socketAddress.getPort())
                    ) {
                SocketStats existingSocketStats = socketOperations.get(socketMetaData);
                if (null == existingSocketStats) {
                    socketOperations.put(socketMetaData, new SocketStats(entry.getValue()));
                } else {
                    existingSocketStats.accumulate(entry.getValue());
                }
            }
        }

        return Collections.unmodifiableMap(socketOperations);

    }
public Map < SocketMetaData , SocketStats > getSocketOperations ( Threads threadMatcher , String address , boolean removeStackTraces ) { Map . Entry < String , Integer > hostAndPort = SocketUtil . parseSocketAddress ( address ) ; String hostName = hostAndPort . getKey ( ) ; Integer port = hostAndPort . getValue ( ) ; Map < SocketMetaData , SocketStats > socketOperations = new LinkedHashMap < SocketMetaData , SocketStats > ( ) ; for ( Map . Entry < SocketMetaData , SocketStats > entry : this . socketOperations . ascendingMap ( ) . entrySet ( ) ) { SocketMetaData socketMetaData = entry . getKey ( ) ; if ( removeStackTraces ) socketMetaData = new SocketMetaData ( socketMetaData . address , socketMetaData . connectionId , null , socketMetaData . ownerThreadId ) ; InetSocketAddress socketAddress = socketMetaData . address ; InetAddress inetAddress = socketAddress . getAddress ( ) ; if ( ( ( CURRENT == threadMatcher && socketMetaData . ownerThreadId == this . ownerThreadId ) || ( OTHERS == threadMatcher && socketMetaData . ownerThreadId != this . ownerThreadId ) || ( ANY == threadMatcher || null == threadMatcher ) ) && ( null == hostName || hostName . equals ( inetAddress . getHostName ( ) ) || hostName . equals ( inetAddress . getHostAddress ( ) ) ) && ( null == port || port == socketAddress . getPort ( ) ) ) { SocketStats existingSocketStats = socketOperations . get ( socketMetaData ) ; if ( null == existingSocketStats ) { socketOperations . put ( socketMetaData , new SocketStats ( entry . getValue ( ) ) ) ; } else { existingSocketStats . accumulate ( entry . getValue ( ) ) ; } } } return Collections . unmodifiableMap ( socketOperations ) ; }
@since 3.1