2021-05-17 13:24:10 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2021 Christian Pierre MOMON <christian@momon.org>
|
|
|
|
*
|
|
|
|
* This file is part of StatoolInfos, simple service statistics tool.
|
|
|
|
*
|
|
|
|
* StatoolInfos is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License as
|
|
|
|
* published by the Free Software Foundation, either version 3 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* StatoolInfos is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Affero General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
* along with StatoolInfos. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
package fr.devinsy.statoolinfos.crawl;
|
|
|
|
|
|
|
|
import java.net.URL;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The Class CrawlLog.
|
|
|
|
*/
|
|
|
|
public class CrawlLog
|
|
|
|
{
|
|
|
|
private URL url;
|
2021-05-18 19:40:29 +02:00
|
|
|
private URL parentUrl;
|
2021-05-17 13:24:10 +02:00
|
|
|
private CrawlStatus status;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Instantiates a new crawl log.
|
|
|
|
*
|
|
|
|
* @param url
|
|
|
|
* the url
|
|
|
|
* @param status
|
|
|
|
* the status
|
|
|
|
*/
|
2021-05-18 19:40:29 +02:00
|
|
|
public CrawlLog(final URL url, final URL parentUrl, final CrawlStatus status)
|
2021-05-17 13:24:10 +02:00
|
|
|
{
|
|
|
|
this.url = url;
|
2021-05-18 19:40:29 +02:00
|
|
|
this.parentUrl = parentUrl;
|
2021-05-17 13:24:10 +02:00
|
|
|
this.status = status;
|
|
|
|
}
|
|
|
|
|
2021-05-18 19:40:29 +02:00
|
|
|
public URL getParentUrl()
|
|
|
|
{
|
|
|
|
return this.parentUrl;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the parent url value.
|
|
|
|
*
|
|
|
|
* @return the parent url value
|
|
|
|
*/
|
|
|
|
public String getParentUrlValue()
|
|
|
|
{
|
|
|
|
String result;
|
|
|
|
|
|
|
|
if (this.parentUrl == null)
|
|
|
|
{
|
|
|
|
result = null;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
result = this.parentUrl.toString();
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2021-05-17 13:24:10 +02:00
|
|
|
public CrawlStatus getStatus()
|
|
|
|
{
|
|
|
|
return this.status;
|
|
|
|
}
|
|
|
|
|
|
|
|
public URL getUrl()
|
|
|
|
{
|
|
|
|
return this.url;
|
|
|
|
}
|
|
|
|
}
|