*) direct access to responseheaders of sbQueue.Entry removed to make it more http independent

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2487 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
theli 19 years ago
parent ffbf416e76
commit 7a35b8e237

@ -161,7 +161,7 @@ public class IndexCreateIndexingQueue_p {
prop.put("indexing-queue_list_"+entryCount+"_dark", (inProcess)? 2: ((dark) ? 1 : 0));
prop.put("indexing-queue_list_"+entryCount+"_initiator", ((initiator == null) ? "proxy" : wikiCode.replaceHTML(initiator.getName())));
prop.put("indexing-queue_list_"+entryCount+"_depth", pcentry.depth());
prop.put("indexing-queue_list_"+entryCount+"_modified", (pcentry.responseHeader() == null) ? "" : daydate(pcentry.responseHeader().lastModified()));
prop.put("indexing-queue_list_"+entryCount+"_modified", pcentry.getModificationDate());
prop.put("indexing-queue_list_"+entryCount+"_anchor", (pcentry.anchorName()==null)?"":wikiCode.replaceHTML(pcentry.anchorName()));
prop.put("indexing-queue_list_"+entryCount+"_url", wikiCode.replaceHTML(pcentry.normalizedURLString()));
prop.put("indexing-queue_list_"+entryCount+"_size", bytesToString(entrySize));

@ -1396,11 +1396,8 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
private plasmaParserDocument parseResource(plasmaSwitchboardQueue.Entry entry, String initiatorHash) throws InterruptedException {
plasmaParserDocument document = null;
// the http header that belongs to this entry
httpHeader entryRespHeader = entry.responseHeader();
// the mimetype of this entry
String mimeType = (entryRespHeader == null)?null:entryRespHeader.mime();
String mimeType = entry.getMimeType();
// the parser logger
serverLog parserLogger = parser.getLogger();
@ -1465,7 +1462,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
", maxDepth=" + ((entry.profile() == null) ? "null" : Integer.toString(entry.profile().generalDepth())) +
", filter=" + ((entry.profile() == null) ? "null" : entry.profile().generalFilter()) +
", initiatorHash=" + initiatorPeerHash +
", responseHeader=" + ((entry.responseHeader() == null) ? "null" : entry.responseHeader().toString()) +
//", responseHeader=" + ((entry.responseHeader() == null) ? "null" : entry.responseHeader().toString()) +
", url=" + entry.url()); // DEBUG
/* =========================================================================
@ -1480,12 +1477,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
parsingEndTime = System.currentTimeMillis();
// getting the document date
Date docDate = null;
if (entry.responseHeader() != null) {
docDate = entry.responseHeader().lastModified();
if (docDate == null) docDate = entry.responseHeader().date();
}
if (docDate == null) docDate = new Date();
Date docDate = entry.getModificationDate();
/* =========================================================================
* put anchors on crawl stack

@ -306,7 +306,7 @@ public class plasmaSwitchboardQueue {
return profileEntry;
}
public httpHeader responseHeader() {
private httpHeader responseHeader() {
if (responseHeader == null) try {
responseHeader = htCache.getCachedResponse(indexURL.urlHash(url));
} catch (IOException e) {
@ -316,6 +316,24 @@ public class plasmaSwitchboardQueue {
return responseHeader;
}
public String getMimeType() {
httpHeader headers = this.responseHeader();
return (headers == null) ? null : headers.mime();
}
public Date getModificationDate() {
Date docDate = null;
httpHeader headers = this.responseHeader();
if (headers != null) {
docDate = headers.lastModified();
if (docDate == null) docDate = headers.date();
}
if (docDate == null) docDate = new Date();
return docDate;
}
public URL referrerURL() {
if (referrerURL == null) {
if ((referrerHash == null) || (referrerHash.equals(indexURL.dummyHash))) return null;

Loading…
Cancel
Save