001: /*
002: * regain - A file search engine providing plenty of formats
003: * Copyright (C) 2004 Til Schneider
004: *
005: * This library is free software; you can redistribute it and/or
006: * modify it under the terms of the GNU Lesser General Public
007: * License as published by the Free Software Foundation; either
008: * version 2.1 of the License, or (at your option) any later version.
009: *
010: * This library is distributed in the hope that it will be useful,
011: * but WITHOUT ANY WARRANTY; without even the implied warranty of
012: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
013: * Lesser General Public License for more details.
014: *
015: * You should have received a copy of the GNU Lesser General Public
016: * License along with this library; if not, write to the Free Software
017: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
018: *
019: * Contact: Til Schneider, info@murfman.de
020: *
021: * CVS information:
022: * $RCSfile$
023: * $Source$
024: * $Date: 2005-05-11 11:21:40 +0200 (Mi, 11 Mai 2005) $
025: * $Author: til132 $
026: * $Revision: 134 $
027: */
028: package net.sf.regain.crawler.config;
029:
030: /**
031: * Ein Eintrag in der Weißen Liste.
032: * <p>
033: * Die Weiße Liste enthält Präfixe, von denen eine URL einen haben <i>muß</i>,
034: * um bearbeitet zu werden.
035: * <p>
036: * Des weiteren wird durch die Weiße Liste festgelegt, welche Teile des Index
037: * vom Crawler bearbeitet werden sollen.
038: *
039: * @author Til Schneider, www.murfman.de
040: */
041: public class WhiteListEntry {
042:
043: /** The UrlMatcher a URL must match to in order to be processed. */
044: private UrlMatcher mUrlMatcher;
045:
046: /** The name of the white list entry. May be <code>null</code>. */
047: private String mName;
048:
049: /** Specifies whether the crawler should update URLs that match to this entry. */
050: private boolean mShouldBeUpdated;
051:
052: /**
053: * Creates a new instance of WhiteListEntry.
054: *
055: * @param urlMatcher The UrlMatcher a URL must match to in order to be
056: * processed.
057: * @param name The name of the white list entry. May be <code>null</code>.
058: */
059: public WhiteListEntry(UrlMatcher urlMatcher, String name) {
060: mUrlMatcher = urlMatcher;
061: mName = name;
062:
063: mShouldBeUpdated = true;
064: }
065:
066: /**
067: * Gets the UrlMatcher a URL must match to in order to be processed.
068: *
069: * @return The UrlMatcher a URL must match to in order to be processed..
070: */
071: public UrlMatcher getUrlMatcher() {
072: return mUrlMatcher;
073: }
074:
075: /**
076: * Gets the name of the white list entry. May be <code>null</code>.
077: *
078: * @return The name. May be <code>null</code>.
079: */
080: public String getName() {
081: return mName;
082: }
083:
084: /**
085: * Gets whether the crawler should update URLs that match to this entry.
086: *
087: * @return Whether the crawler should update URLs that match to this entry.
088: */
089: public boolean shouldBeUpdated() {
090: return mShouldBeUpdated;
091: }
092:
093: /**
094: * Sets whether the crawler should update URLs that match to this entry.
095: *
096: * @param shouldBeUpdated Whether the crawler should update URLs that match to
097: * this entry.
098: */
099: public void setShouldBeUpdated(boolean shouldBeUpdated) {
100: mShouldBeUpdated = shouldBeUpdated;
101: }
102:
103: }
|