private String get(String name) throws ClassNotFoundException, IOException { FutureDHT futureDHT = peer.get(Number160.createHash(name)); futureDHT.awaitUninterruptibly(); if (futureDHT.isSuccess()) { return futureDHT.getData().values().iterator().next().getObject().toString(); } else return "Not Found"; }
private String[] get(Number160 name) throws ClassNotFoundException, IOException { FutureDHT futureDHT = peer.get(name); futureDHT.awaitUninterruptibly(); if (futureDHT.isSuccess()) { return (String[]) futureDHT.getData().values().iterator().next().getObject(); } else return null; }
@SuppressWarnings("unchecked") private Vector<Number160> getPeerList(String name) throws ClassNotFoundException, IOException { FutureDHT futureDHT = peer.get(Number160.createHash(name)); futureDHT.awaitUninterruptibly(); if (futureDHT.isSuccess()) { return (Vector<Number160>) futureDHT.getData().values().iterator().next().getObject(); } else return null; }