001: /*
002: * Copyright 2007 Hippo.
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016: package nl.hippo.cms.brokenlinkchecker;
017:
018: import java.util.Iterator;
019: import nl.hippo.cms.brokenlinkchecker.log.BrokenLinkCheckerLog;
020:
021: /**
022: * <p>
023: * This interface holds the information and resources needed by a
024: * {@link BrokenLinkCheckerRun}.
025: * </p>
026: */
027: public interface BrokenLinkCheckerRunConfiguration {
028: /**
029: * <p>
030: * Get the URL to the root of the tree to search for documents with
031: * broken links. For example:
032: * <code>http://localhost:60000/default/files/default.www/content/bulk</code>.
033: * </p>
034: *
035: * @return the URL of the root of the tree to search.
036: */
037: String getDocumentTreeToCheckRootUrl();
038:
039: /**
040: * <p>
041: * Get the base URL (relative to the host) to which the URLs of the
042: * documents must be relative. For example:
043: * <code>/default/files/default.www</code>.
044: * </p>
045: *
046: * @return the base URL to which the URLs of the documents must be
047: * relative.
048: */
049: String getDocumentsBaseUrl();
050:
051: /**
052: * <p>
053: * Get an iterator over prefixes of URLs of internal links that should
054: * be ignored, i.e. not reported as being broken. Examples of URL
055: * prefixes: <code>/assets/binaries/</code> and
056: * <code>/binaries/</code>.
057: * </p>
058: *
059: * @return an iterator over URL prefixes that should be ignored.
060: */
061: Iterator internalUrlPrefixesToIgnoreIterator();
062:
063: /**
064: * <p>
065: * Get the base URL for internal links. The location to which the URL
066: * points must be part of the repository that is being checked. For
067: * example:
068: * <code>http://localhost:60000/default/files/default.www</code>.
069: * </p>
070: *
071: * @return the base URL for internal links.
072: */
073: String getInternalLinksBaseUrl();
074:
075: /**
076: * <p>
077: * Get the username that must be used to log into the repository.
078: * </p>
079: *
080: * @return the username to use for logging into the repository.
081: */
082: String getRepositoryUsername();
083:
084: /**
085: * <p>
086: * Get the password that must be used to log into the repository.
087: * </p>
088: *
089: * @return the password to use for logging into the repository.
090: */
091: String getRepositoryPassword();
092:
093: /**
094: * <p>
095: * Get the URL of the document to write the results of the link checking
096: * to. The location to which the URL points must be part of the
097: * repository that is being checked. For example:
098: * <code>http://localhost:60000/default/files/default.www/broken-links.xml</code>.
099: * </p>
100: *
101: * <p>
102: * The folder where the document should be stored must already exist.
103: * </p>
104: *
105: * @return the URL of the document to write the results to.
106: */
107: String getResultDocumentUrl();
108:
109: /**
110: * <p>
111: * Get the number of documents to retrieve in one request using a DASL.
112: * </p>
113: *
114: * @return the number of documents to retrieve using a DASL.
115: */
116: int getDocumentBatchSize();
117:
118: /**
119: * <p>
120: * Get the number of threads to use for checking links.
121: * </p>
122: *
123: * @return the number of threads to use for checking links.
124: */
125: int getNumberOfLinkCheckingThreads();
126:
127: /**
128: * <p>
129: * Get the maximum time to wait for a response before a link is
130: * considered broken.
131: * </p>
132: *
133: * @return the number of seconds to wait for a response.
134: */
135: int getLinkCheckTimeoutSeconds();
136:
137: /**
138: * <p>
139: * Get the log to which to write messages.
140: * </p>
141: *
142: * @return the log to which to write messages.
143: */
144: BrokenLinkCheckerLog getLog();
145: }
|