@ -95,7 +95,7 @@ public final class yacyClient {
// but they appear to be another peer by comparisment of the other peer's hash
// but they appear to be another peer by comparisment of the other peer's hash
// this works of course only if we know the other peer's hash.
// this works of course only if we know the other peer's hash.
HashMap result = null ;
HashMap < String , String > result = null ;
final serverObjects post = yacyNetwork . basicRequestPost ( plasmaSwitchboard . getSwitchboard ( ) , null ) ;
final serverObjects post = yacyNetwork . basicRequestPost ( plasmaSwitchboard . getSwitchboard ( ) , null ) ;
for ( int retry = 0 ; retry < 3 ; retry + + ) try {
for ( int retry = 0 ; retry < 3 ; retry + + ) try {
// generate request
// generate request
@ -244,7 +244,7 @@ public final class yacyClient {
// send request
// send request
try {
try {
final HashMap result = nxTools . table (
final HashMap < String , String > result = nxTools . table (
httpc . wput ( new yacyURL ( "http://" + target . getClusterAddress ( ) + "/yacy/query.html" , null ) ,
httpc . wput ( new yacyURL ( "http://" + target . getClusterAddress ( ) + "/yacy/query.html" , null ) ,
target . getHexHash ( ) + ".yacyh" ,
target . getHexHash ( ) + ".yacyh" ,
8000 ,
8000 ,
@ -274,7 +274,7 @@ public final class yacyClient {
// send request
// send request
try {
try {
final HashMap result = nxTools . table (
final HashMap < String , String > result = nxTools . table (
httpc . wput ( new yacyURL ( "http://" + target . getClusterAddress ( ) + "/yacy/query.html" , null ) ,
httpc . wput ( new yacyURL ( "http://" + target . getClusterAddress ( ) + "/yacy/query.html" , null ) ,
target . getHexHash ( ) + ".yacyh" ,
target . getHexHash ( ) + ".yacyh" ,
8000 ,
8000 ,
@ -306,7 +306,7 @@ public final class yacyClient {
// send request
// send request
try {
try {
final HashMap result = nxTools . table (
final HashMap < String , String > result = nxTools . table (
httpc . wput ( new yacyURL ( "http://" + target . getClusterAddress ( ) + "/yacy/query.html" , null ) ,
httpc . wput ( new yacyURL ( "http://" + target . getClusterAddress ( ) + "/yacy/query.html" , null ) ,
target . getHexHash ( ) + ".yacyh" ,
target . getHexHash ( ) + ".yacyh" ,
6000 ,
6000 ,
@ -386,7 +386,7 @@ public final class yacyClient {
yacySeed target ,
yacySeed target ,
plasmaWordIndex wordIndex ,
plasmaWordIndex wordIndex ,
plasmaSearchRankingProcess containerCache ,
plasmaSearchRankingProcess containerCache ,
Map abstractCache ,
Map < String , TreeMap < String , String > > abstractCache ,
plasmaURLPattern blacklist ,
plasmaURLPattern blacklist ,
plasmaSearchRankingProfile rankingProfile ,
plasmaSearchRankingProfile rankingProfile ,
kelondroBitfield constraint
kelondroBitfield constraint
@ -426,7 +426,7 @@ public final class yacyClient {
final long timestamp = System . currentTimeMillis ( ) ;
final long timestamp = System . currentTimeMillis ( ) ;
// send request
// send request
HashMap result = null ;
HashMap < String , String > result = null ;
try {
try {
result = nxTools . table (
result = nxTools . table (
httpc . wput ( new yacyURL ( "http://" + target . getClusterAddress ( ) + "/yacy/search.html" , null ) ,
httpc . wput ( new yacyURL ( "http://" + target . getClusterAddress ( ) + "/yacy/search.html" , null ) ,
@ -585,7 +585,7 @@ public final class yacyClient {
if ( ( ( String ) entry . getKey ( ) ) . startsWith ( "indexabstract." ) ) {
if ( ( ( String ) entry . getKey ( ) ) . startsWith ( "indexabstract." ) ) {
wordhash = ( ( String ) entry . getKey ( ) ) . substring ( 14 ) ;
wordhash = ( ( String ) entry . getKey ( ) ) . substring ( 14 ) ;
synchronized ( abstractCache ) {
synchronized ( abstractCache ) {
singleAbstract = ( TreeMap ) abstractCache . get ( wordhash ) ; // a mapping from url-hashes to a string of peer-hashes
singleAbstract = ( TreeMap <String , String > ) abstractCache . get ( wordhash ) ; // a mapping from url-hashes to a string of peer-hashes
if ( singleAbstract = = null ) singleAbstract = new TreeMap ( ) ;
if ( singleAbstract = = null ) singleAbstract = new TreeMap ( ) ;
ci = new serverByteBuffer ( ( ( String ) entry . getValue ( ) ) . getBytes ( ) ) ;
ci = new serverByteBuffer ( ( ( String ) entry . getValue ( ) ) . getBytes ( ) ) ;
//System.out.println("DEBUG-ABSTRACTFETCH: for word hash " + wordhash + " received " + ci.toString());
//System.out.println("DEBUG-ABSTRACTFETCH: for word hash " + wordhash + " received " + ci.toString());
@ -632,7 +632,7 @@ public final class yacyClient {
// send request
// send request
try {
try {
final HashMap result = nxTools . table (
final HashMap < String , String > result = nxTools . table (
httpc . wput ( new yacyURL ( "http://" + targetAddress ( targetHash ) + "/yacy/message.html" , null ) ,
httpc . wput ( new yacyURL ( "http://" + targetAddress ( targetHash ) + "/yacy/message.html" , null ) ,
yacySeed . b64Hash2hexHash ( targetHash ) + ".yacyh" ,
yacySeed . b64Hash2hexHash ( targetHash ) + ".yacyh" ,
8000 ,
8000 ,
@ -667,7 +667,7 @@ public final class yacyClient {
// send request
// send request
try {
try {
final HashMap result = nxTools . table (
final HashMap < String , String > result = nxTools . table (
httpc . wput ( new yacyURL ( "http://" + targetAddress ( targetHash ) + "/yacy/message.html" , null ) ,
httpc . wput ( new yacyURL ( "http://" + targetAddress ( targetHash ) + "/yacy/message.html" , null ) ,
yacySeed . b64Hash2hexHash ( targetHash ) + ".yacyh" ,
yacySeed . b64Hash2hexHash ( targetHash ) + ".yacyh" ,
20000 ,
20000 ,
@ -712,7 +712,7 @@ public final class yacyClient {
// send request
// send request
try {
try {
final yacyURL url = new yacyURL ( "http://" + targetAddress + "/yacy/transfer.html" , null ) ;
final yacyURL url = new yacyURL ( "http://" + targetAddress + "/yacy/transfer.html" , null ) ;
final HashMap result = nxTools . table (
final HashMap < String , String > result = nxTools . table (
httpc . wput ( url ,
httpc . wput ( url ,
url . getHost ( ) ,
url . getHost ( ) ,
6000 ,
6000 ,
@ -747,7 +747,7 @@ public final class yacyClient {
// send request
// send request
try {
try {
final yacyURL url = new yacyURL ( "http://" + targetAddress + "/yacy/transfer.html" , null ) ;
final yacyURL url = new yacyURL ( "http://" + targetAddress + "/yacy/transfer.html" , null ) ;
final HashMap result = nxTools . table (
final HashMap < String , String > result = nxTools . table (
httpc . wput ( url ,
httpc . wput ( url ,
url . getHost ( ) ,
url . getHost ( ) ,
20000 ,
20000 ,
@ -790,7 +790,7 @@ public final class yacyClient {
return "wrong protocol: " + protocol ;
return "wrong protocol: " + protocol ;
}
}
public static HashMap crawlReceipt ( yacySeed target , String process , String result , String reason , indexURLEntry entry , String wordhashes ) {
public static HashMap < String , String > crawlReceipt ( yacySeed target , String process , String result , String reason , indexURLEntry entry , String wordhashes ) {
assert ( target ! = null ) ;
assert ( target ! = null ) ;
assert ( yacyCore . seedDB . mySeed ( ) ! = null ) ;
assert ( yacyCore . seedDB . mySeed ( ) ! = null ) ;
assert ( yacyCore . seedDB . mySeed ( ) ! = target ) ;
assert ( yacyCore . seedDB . mySeed ( ) ! = target ) ;
@ -868,14 +868,14 @@ public final class yacyClient {
}
}
// transfer the RWI without the URLs
// transfer the RWI without the URLs
HashMap in = transferRWI ( targetSeed , indexes , gzipBody , timeout ) ;
HashMap < String , String > in = transferRWI ( targetSeed , indexes , gzipBody , timeout ) ;
resultObj . put ( "resultTransferRWI" , in ) ;
resultObj . put ( "resultTransferRWI" , in ) ;
if ( in = = null ) {
if ( in = = null ) {
resultObj . put ( "result" , "no_connection_1" ) ;
resultObj . put ( "result" , "no_connection_1" ) ;
return resultObj ;
return resultObj ;
}
}
if ( in . containsKey ( "indexPayloadSize" ) ) payloadSize + = ( ( Integer ) in . get ( "indexPayloadSize" ) ) . intValue ( ) ;
if ( in . containsKey ( "indexPayloadSize" ) ) payloadSize + = Integer . parseInt ( in . get ( "indexPayloadSize" ) ) ;
String result = ( String ) in . get ( "result" ) ;
String result = ( String ) in . get ( "result" ) ;
if ( result = = null ) {
if ( result = = null ) {
@ -916,7 +916,7 @@ public final class yacyClient {
resultObj . put ( "result" , "no_connection_2" ) ;
resultObj . put ( "result" , "no_connection_2" ) ;
return resultObj ;
return resultObj ;
}
}
if ( in . containsKey ( "urlPayloadSize" ) ) payloadSize + = ( ( Integer ) in . get ( "urlPayloadSize" ) ) . intValue ( ) ;
if ( in . containsKey ( "urlPayloadSize" ) ) payloadSize + = Integer . parseInt ( in . get ( "urlPayloadSize" ) ) ;
result = ( String ) in . get ( "result" ) ;
result = ( String ) in . get ( "result" ) ;
if ( result = = null ) {
if ( result = = null ) {
@ -975,9 +975,9 @@ public final class yacyClient {
}
}
post . put ( "entryc" , indexcount ) ;
post . put ( "entryc" , indexcount ) ;
post . put ( "indexes" , entrypost . toString ( ) ) ;
post . put ( "indexes" , entrypost . toString ( ) ) ;
try {
try {
final ArrayList v = nxTools . strings (
final ArrayList < String > v = nxTools . strings (
httpc . wput (
httpc . wput (
new yacyURL ( "http://" + address + "/yacy/transferRWI.html" , null ) ,
new yacyURL ( "http://" + address + "/yacy/transferRWI.html" , null ) ,
targetSeed . getHexHash ( ) + ".yacyh" ,
targetSeed . getHexHash ( ) + ".yacyh" ,
@ -993,9 +993,9 @@ public final class yacyClient {
yacyCore . seedDB . mySeed ( ) . incSI ( indexcount ) ;
yacyCore . seedDB . mySeed ( ) . incSI ( indexcount ) ;
}
}
final HashMap result = nxTools . table ( v ) ;
final HashMap < String , String > result = nxTools . table ( v ) ;
// return the transfered index data in bytes (for debugging only)
// return the transfered index data in bytes (for debugging only)
result . put ( "indexPayloadSize" , new Integer ( entrypost . length ( ) ) ) ;
result . put ( "indexPayloadSize" , Integer . toString ( entrypost . length ( ) ) ) ;
return result ;
return result ;
} catch ( Exception e ) {
} catch ( Exception e ) {
yacyCore . log . logSevere ( "yacyClient.transferRWI error:" + e . getMessage ( ) ) ;
yacyCore . log . logSevere ( "yacyClient.transferRWI error:" + e . getMessage ( ) ) ;
@ -1003,7 +1003,7 @@ public final class yacyClient {
}
}
}
}
private static HashMap transferURL ( yacySeed targetSeed , indexURLEntry [ ] urls , boolean gzipBody , int timeout ) {
private static HashMap < String , String > transferURL ( yacySeed targetSeed , indexURLEntry [ ] urls , boolean gzipBody , int timeout ) {
// this post a message to the remote message board
// this post a message to the remote message board
final String address = targetSeed . getPublicAddress ( ) ;
final String address = targetSeed . getPublicAddress ( ) ;
if ( address = = null ) { return null ; }
if ( address = = null ) { return null ; }
@ -1031,7 +1031,7 @@ public final class yacyClient {
}
}
post . put ( "urlc" , urlc ) ;
post . put ( "urlc" , urlc ) ;
try {
try {
final ArrayList v = nxTools . strings (
final ArrayList < String > v = nxTools . strings (
httpc . wput (
httpc . wput (
new yacyURL ( "http://" + address + "/yacy/transferURL.html" , null ) ,
new yacyURL ( "http://" + address + "/yacy/transferURL.html" , null ) ,
targetSeed . getHexHash ( ) + ".yacyh" ,
targetSeed . getHexHash ( ) + ".yacyh" ,
@ -1047,9 +1047,9 @@ public final class yacyClient {
yacyCore . seedDB . mySeed ( ) . incSU ( urlc ) ;
yacyCore . seedDB . mySeed ( ) . incSU ( urlc ) ;
}
}
HashMap result = nxTools . table ( v ) ;
HashMap < String , String > result = nxTools . table ( v ) ;
// return the transfered url data in bytes (for debugging only)
// return the transfered url data in bytes (for debugging only)
result . put ( "urlPayloadSize" , new Integer ( urlPayloadSize ) ) ;
result . put ( "urlPayloadSize" , Integer . toString ( urlPayloadSize ) ) ;
return result ;
return result ;
} catch ( Exception e ) {
} catch ( Exception e ) {
yacyCore . log . logSevere ( "yacyClient.transferURL error:" + e . getMessage ( ) ) ;
yacyCore . log . logSevere ( "yacyClient.transferURL error:" + e . getMessage ( ) ) ;
@ -1057,7 +1057,7 @@ public final class yacyClient {
}
}
}
}
public static HashMap getProfile ( yacySeed targetSeed ) {
public static HashMap < String , String > getProfile ( yacySeed targetSeed ) {
// this post a message to the remote message board
// this post a message to the remote message board
final serverObjects post = yacyNetwork . basicRequestPost ( plasmaSwitchboard . getSwitchboard ( ) , targetSeed . hash ) ;
final serverObjects post = yacyNetwork . basicRequestPost ( plasmaSwitchboard . getSwitchboard ( ) , targetSeed . hash ) ;
@ -1102,7 +1102,7 @@ public final class yacyClient {
( sb . remoteProxyConfig . useProxy ( ) ) & &
( sb . remoteProxyConfig . useProxy ( ) ) & &
( sb . remoteProxyConfig . useProxy4Yacy ( ) ) ;
( sb . remoteProxyConfig . useProxy4Yacy ( ) ) ;
final HashMap result = nxTools . table (
final HashMap < String , String > result = nxTools . table (
httpc . wget (
httpc . wget (
new yacyURL ( "http://" + target . getPublicAddress ( ) + "/yacy/search.html" +
new yacyURL ( "http://" + target . getPublicAddress ( ) + "/yacy/search.html" +
"?myseed=" + yacyCore . seedDB . mySeed ( ) . genSeedStr ( null ) +
"?myseed=" + yacyCore . seedDB . mySeed ( ) . genSeedStr ( null ) +