From 909a4f91c7af4ad19f9a20dbe8fd164d52266f4d Mon Sep 17 00:00:00 2001 From: orbiter Date: Mon, 11 Jan 2010 18:10:39 +0000 Subject: [PATCH] added a logging output for crawl starts that shows the URL that can be used to start the crawl again git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6566 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/WatchCrawler_p.java | 3 +++ source/de/anomic/server/serverObjects.java | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/htroot/WatchCrawler_p.java b/htroot/WatchCrawler_p.java index a5335725f..61b0bb9e5 100644 --- a/htroot/WatchCrawler_p.java +++ b/htroot/WatchCrawler_p.java @@ -130,6 +130,9 @@ public class WatchCrawler_p { if (sb.peers == null) { prop.put("info", "3"); } else { + // log a GET url for this crawl start for possible use in cronjobs + Log.logInfo("CRAWLSTART-URL", "http://localhost:" + sb.getConfig("port", "8080") + "/WatchCrawler_p.html?" + post.toString()); + // set new properties final boolean fullDomain = post.get("range", "wide").equals("domain"); // special property in simple crawl start final boolean subPath = post.get("range", "wide").equals("subpath"); // special property in simple crawl start diff --git a/source/de/anomic/server/serverObjects.java b/source/de/anomic/server/serverObjects.java index 17b074ca9..d1012a68e 100644 --- a/source/de/anomic/server/serverObjects.java +++ b/source/de/anomic/server/serverObjects.java @@ -353,4 +353,20 @@ public class serverObjects extends HashMap implements Cloneable return super.clone(); } + /** + * output the objects in a HTTP GET syntax + */ + public String toString() { + if (this.size() == 0) return ""; + StringBuilder param = new StringBuilder(); + for (Map.Entry entry: this.entrySet()) { + param.append(entry.getKey()); + param.append('='); + param.append(entry.getValue()); + param.append('&'); + } + param.setLength(param.length() - 1); + return param.toString(); + } + }