Java implementation of p2p