Ejemplo n.º 1
0
 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";
 }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
 @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;
 }