You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by kw...@apache.org on 2010/02/17 16:57:35 UTC
svn commit: r911029 [5/19] - in /incubator/lcf/trunk:
modules/connectors/documentum/connector/org/apache/lcf/crawler/authorities/DCTM/
modules/connectors/documentum/connector/org/apache/lcf/crawler/connectors/DCTM/
modules/connectors/documentum/crawler...
Modified: incubator/lcf/trunk/modules/connectors/rss/connector/org/apache/lcf/crawler/connectors/rss/IThrottledConnection.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/connectors/rss/connector/org/apache/lcf/crawler/connectors/rss/IThrottledConnection.java?rev=911029&r1=911028&r2=911029&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/connectors/rss/connector/org/apache/lcf/crawler/connectors/rss/IThrottledConnection.java (original)
+++ incubator/lcf/trunk/modules/connectors/rss/connector/org/apache/lcf/crawler/connectors/rss/IThrottledConnection.java Wed Feb 17 15:57:27 2010
@@ -51,7 +51,7 @@
* is used solely for logging purposes.
*/
public void beginFetch(String fetchType)
- throws MetacartaException;
+ throws LCFException;
/** Execute the fetch and get the return code. This method uses the
* standard logging mechanism to keep track of the fetch attempt. It also
@@ -69,35 +69,35 @@
public int executeFetch(String protocol, int port, String urlPath, String userAgent, String from,
String proxyHost, int proxyPort, String proxyAuthDomain, String proxyAuthUsername, String proxyAuthPassword,
String lastETag, String lastModified)
- throws MetacartaException, ServiceInterruption;
+ throws LCFException, ServiceInterruption;
/** Get the http response code.
*@return the response code. This is either an HTTP response code, or one of the codes above.
*/
public int getResponseCode()
- throws MetacartaException, ServiceInterruption;
+ throws LCFException, ServiceInterruption;
/** Get the response input stream. It is the responsibility of the caller
* to close this stream when done.
*/
public InputStream getResponseBodyStream()
- throws MetacartaException, ServiceInterruption;
+ throws LCFException, ServiceInterruption;
/** Get a specified response header, if it exists.
*@param headerName is the name of the header.
*@return the header value, or null if it doesn't exist.
*/
public String getResponseHeader(String headerName)
- throws MetacartaException, ServiceInterruption;
+ throws LCFException, ServiceInterruption;
/** Done with the fetch. Call this when the fetch has been completed. A log entry will be generated
* describing what was done.
*/
public void doneFetch(IVersionActivity activities)
- throws MetacartaException;
+ throws LCFException;
/** Close the connection. Call this to end this server connection.
*/
public void close()
- throws MetacartaException;
+ throws LCFException;
}
Modified: incubator/lcf/trunk/modules/connectors/rss/connector/org/apache/lcf/crawler/connectors/rss/RSSConnector.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/connectors/rss/connector/org/apache/lcf/crawler/connectors/rss/RSSConnector.java?rev=911029&r1=911028&r2=911029&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/connectors/rss/connector/org/apache/lcf/crawler/connectors/rss/RSSConnector.java (original)
+++ incubator/lcf/trunk/modules/connectors/rss/connector/org/apache/lcf/crawler/connectors/rss/RSSConnector.java Wed Feb 17 15:57:27 2010
@@ -22,7 +22,7 @@
import org.apache.lcf.agents.interfaces.*;
import org.apache.lcf.crawler.interfaces.*;
import org.apache.lcf.crawler.system.Logging;
-import org.apache.lcf.crawler.system.Metacarta;
+import org.apache.lcf.crawler.system.LCF;
import org.xml.sax.Attributes;
@@ -220,7 +220,7 @@
/** Establish a session */
protected void getSession()
- throws MetacartaException
+ throws LCFException
{
if (!isInitialized)
{
@@ -228,7 +228,7 @@
String emailAddress = params.getParameter(emailParameter);
if (emailAddress == null)
- throw new MetacartaException("Missing email address");
+ throw new LCFException("Missing email address");
userAgent = "ApacheLCFRSSFeedReader; "+((emailAddress==null)?"":emailAddress)+")";
from = emailAddress;
@@ -256,7 +256,7 @@
}
catch (NumberFormatException e)
{
- throw new MetacartaException(e.getMessage(),e);
+ throw new LCFException(e.getMessage(),e);
}
}
@@ -276,7 +276,7 @@
}
catch (NumberFormatException e)
{
- throw new MetacartaException("Bad number: "+e.getMessage(),e);
+ throw new LCFException("Bad number: "+e.getMessage(),e);
}
}
@@ -289,7 +289,7 @@
}
catch (NumberFormatException e)
{
- throw new MetacartaException("Bad number: "+e.getMessage(),e);
+ throw new LCFException("Bad number: "+e.getMessage(),e);
}
}
@@ -305,7 +305,7 @@
}
catch (NumberFormatException e)
{
- throw new MetacartaException("Bad number: "+e.getMessage(),e);
+ throw new LCFException("Bad number: "+e.getMessage(),e);
}
}
@@ -372,7 +372,7 @@
* in active use.
*/
public void poll()
- throws MetacartaException
+ throws LCFException
{
fetcher.poll();
robots.poll();
@@ -381,7 +381,7 @@
/** Check status of connection.
*/
public String check()
- throws MetacartaException
+ throws LCFException
{
getSession();
return super.check();
@@ -390,7 +390,7 @@
/** Close the connection. Call this before discarding the repository connector.
*/
public void disconnect()
- throws MetacartaException
+ throws LCFException
{
isInitialized = false;
@@ -464,7 +464,7 @@
*/
public void addSeedDocuments(ISeedingActivity activities, DocumentSpecification spec,
long startTime, long endTime)
- throws MetacartaException, ServiceInterruption
+ throws LCFException, ServiceInterruption
{
getSession();
@@ -488,7 +488,7 @@
*@return the canonical URL (the document identifier), or null if the url was illegal.
*/
protected static String makeDocumentIdentifier(CanonicalizationPolicies policies, String parentIdentifier, String rawURL)
- throws MetacartaException
+ throws LCFException
{
try
{
@@ -587,7 +587,7 @@
/** Code to canonicalize a URL. If URL cannot be canonicalized (and is illegal) return null.
*/
protected static String doCanonicalization(CanonicalizationPolicy p, java.net.URI url)
- throws MetacartaException, java.net.URISyntaxException
+ throws LCFException, java.net.URISyntaxException
{
// Note well: The java.net.URI class mistreats the query part of the URI, near as I can tell, in the following ways:
// (1) It decodes the whole thing without regards to the argument interpretation, so the escaped ampersands etc in the arguments are converted
@@ -800,7 +800,7 @@
*/
public String[] getDocumentVersions(String[] documentIdentifiers, String[] oldVersions, IVersionActivity activities,
DocumentSpecification spec, int jobType, boolean usesDefaultAuthority)
- throws MetacartaException, ServiceInterruption
+ throws LCFException, ServiceInterruption
{
getSession();
@@ -947,19 +947,19 @@
}
catch (UnsupportedEncodingException e)
{
- throw new MetacartaException("Unsupported encoding: "+e.getMessage(),e);
+ throw new LCFException("Unsupported encoding: "+e.getMessage(),e);
}
catch (java.net.SocketTimeoutException e)
{
- throw new MetacartaException("IO exception reading data from string: "+e.getMessage(),e);
+ throw new LCFException("IO exception reading data from string: "+e.getMessage(),e);
}
catch (InterruptedIOException e)
{
- throw new MetacartaException("Interrupted: "+e.getMessage(),e,MetacartaException.INTERRUPTED);
+ throw new LCFException("Interrupted: "+e.getMessage(),e,LCFException.INTERRUPTED);
}
catch (IOException e)
{
- throw new MetacartaException("IO exception reading data from string: "+e.getMessage(),e);
+ throw new LCFException("IO exception reading data from string: "+e.getMessage(),e);
}
}
else
@@ -1206,7 +1206,7 @@
}
catch (InterruptedIOException e)
{
- throw new MetacartaException("Interrupted: "+e.getMessage(),e,MetacartaException.INTERRUPTED);
+ throw new LCFException("Interrupted: "+e.getMessage(),e,LCFException.INTERRUPTED);
}
catch (IOException e)
{
@@ -1275,7 +1275,7 @@
*/
public void processDocuments(String[] documentIdentifiers, String[] versions, IProcessActivity activities,
DocumentSpecification spec, boolean[] scanOnly, int jobType)
- throws MetacartaException, ServiceInterruption
+ throws LCFException, ServiceInterruption
{
getSession();
@@ -1517,15 +1517,15 @@
}
catch (java.net.SocketTimeoutException e)
{
- throw new MetacartaException("IO error closing stream: "+e.getMessage(),e);
+ throw new LCFException("IO error closing stream: "+e.getMessage(),e);
}
catch (InterruptedIOException e)
{
- throw new MetacartaException("Interrupted: "+e.getMessage(),e,MetacartaException.INTERRUPTED);
+ throw new LCFException("Interrupted: "+e.getMessage(),e,LCFException.INTERRUPTED);
}
catch (IOException e)
{
- throw new MetacartaException("IO error closing stream: "+e.getMessage(),e);
+ throw new LCFException("IO error closing stream: "+e.getMessage(),e);
}
}
}
@@ -1549,7 +1549,7 @@
*@param versions is the corresponding set of version identifiers (individual identifiers may be null).
*/
public void releaseDocumentVersions(String[] documentIdentifiers, String[] versions)
- throws MetacartaException
+ throws LCFException
{
int i = 0;
while (i < documentIdentifiers.length)
@@ -1566,7 +1566,7 @@
/** Handle an RSS feed document, using SAX to limit the memory impact */
protected void handleRSSFeedSAX(String documentIdentifier, IProcessActivity activities, Filter filter)
- throws MetacartaException, ServiceInterruption
+ throws LCFException, ServiceInterruption
{
// The SAX model uses parsing events to control parsing, which allows me to manage memory usage much better.
// This is essential for when a feed contains dechromed content as well as links.
@@ -1593,7 +1593,7 @@
{
x.parse(is);
}
- catch (MetacartaException e)
+ catch (LCFException e)
{
// Ignore XML parsing errors.
if (e.getMessage().indexOf("pars") >= 0)
@@ -1623,19 +1623,19 @@
}
catch (java.net.SocketTimeoutException e)
{
- throw new MetacartaException("Socket timeout error: "+e.getMessage(),e);
+ throw new LCFException("Socket timeout error: "+e.getMessage(),e);
}
catch (org.apache.commons.httpclient.ConnectTimeoutException e)
{
- throw new MetacartaException("Socket connect timeout error: "+e.getMessage(),e);
+ throw new LCFException("Socket connect timeout error: "+e.getMessage(),e);
}
catch (InterruptedIOException e)
{
- throw new MetacartaException("Interrupted: "+e.getMessage(),e,MetacartaException.INTERRUPTED);
+ throw new LCFException("Interrupted: "+e.getMessage(),e,LCFException.INTERRUPTED);
}
catch (IOException e)
{
- throw new MetacartaException("IO error: "+e.getMessage(),e);
+ throw new LCFException("IO error: "+e.getMessage(),e);
}
}
@@ -1674,7 +1674,7 @@
/** Check if the rescan flag was set or not, and if not, make sure it gets set properly */
public void setDefaultRescanTimeIfNeeded()
- throws MetacartaException
+ throws LCFException
{
if (rescanTimeSet == false)
{
@@ -1696,7 +1696,7 @@
/** Handle the tag beginning to set the correct second-level parsing context */
protected XMLContext beginTag(String namespaceURI, String localName, String qName, Attributes atts)
- throws MetacartaException, ServiceInterruption
+ throws LCFException, ServiceInterruption
{
if (qName.equals("rss"))
{
@@ -1725,7 +1725,7 @@
/** Handle the tag ending */
protected void endTag()
- throws MetacartaException, ServiceInterruption
+ throws LCFException, ServiceInterruption
{
XMLContext context = theStream.getContext();
String tagName = context.getQname();
@@ -1767,7 +1767,7 @@
}
protected XMLContext beginTag(String namespaceURI, String localName, String qName, Attributes atts)
- throws MetacartaException, ServiceInterruption
+ throws LCFException, ServiceInterruption
{
// Handle each channel
if (qName.equals("channel"))
@@ -1781,7 +1781,7 @@
}
protected void endTag()
- throws MetacartaException, ServiceInterruption
+ throws LCFException, ServiceInterruption
{
// If it's our channel tag, process global channel information
XMLContext context = theStream.getContext();
@@ -1796,7 +1796,7 @@
/** Process this data */
protected boolean process()
- throws MetacartaException
+ throws LCFException
{
return rescanTimeSet;
}
@@ -1824,7 +1824,7 @@
}
protected XMLContext beginTag(String namespaceURI, String localName, String qName, Attributes atts)
- throws MetacartaException, ServiceInterruption
+ throws LCFException, ServiceInterruption
{
// The tags we care about are "ttl" and "item", nothing else.
if (qName.equals("ttl"))
@@ -1842,7 +1842,7 @@
}
protected void endTag()
- throws MetacartaException, ServiceInterruption
+ throws LCFException, ServiceInterruption
{
XMLContext theContext = theStream.getContext();
String theTag = theContext.getQname();
@@ -1872,7 +1872,7 @@
/** Process this data, return true if rescan time was set */
protected boolean process()
- throws MetacartaException
+ throws LCFException
{
// Deal with the ttlvalue, if it was found
// Use the ttl value as a signal for when we ought to look at this feed again. If not present, use the default.
@@ -1930,7 +1930,7 @@
}
protected XMLContext beginTag(String namespaceURI, String localName, String qName, Attributes atts)
- throws MetacartaException, ServiceInterruption
+ throws LCFException, ServiceInterruption
{
// The tags we care about are "ttl" and "item", nothing else.
if (qName.equals("link"))
@@ -1974,15 +1974,15 @@
}
catch (java.net.SocketTimeoutException e)
{
- throw new MetacartaException("IO exception creating temp file: "+e.getMessage(),e);
+ throw new LCFException("IO exception creating temp file: "+e.getMessage(),e);
}
catch (InterruptedIOException e)
{
- throw new MetacartaException("Interrupted: "+e.getMessage(),e,MetacartaException.INTERRUPTED);
+ throw new LCFException("Interrupted: "+e.getMessage(),e,LCFException.INTERRUPTED);
}
catch (IOException e)
{
- throw new MetacartaException("IO exception creating temp file: "+e.getMessage(),e);
+ throw new LCFException("IO exception creating temp file: "+e.getMessage(),e);
}
}
break;
@@ -1996,15 +1996,15 @@
}
catch (java.net.SocketTimeoutException e)
{
- throw new MetacartaException("IO exception creating temp file: "+e.getMessage(),e);
+ throw new LCFException("IO exception creating temp file: "+e.getMessage(),e);
}
catch (InterruptedIOException e)
{
- throw new MetacartaException("Interrupted: "+e.getMessage(),e,MetacartaException.INTERRUPTED);
+ throw new LCFException("Interrupted: "+e.getMessage(),e,LCFException.INTERRUPTED);
}
catch (IOException e)
{
- throw new MetacartaException("IO exception creating temp file: "+e.getMessage(),e);
+ throw new LCFException("IO exception creating temp file: "+e.getMessage(),e);
}
}
break;
@@ -2018,7 +2018,7 @@
/** Convert the individual sub-fields of the item context into their final forms */
protected void endTag()
- throws MetacartaException, ServiceInterruption
+ throws LCFException, ServiceInterruption
{
XMLContext theContext = theStream.getContext();
String theTag = theContext.getQname();
@@ -2075,7 +2075,7 @@
}
protected void tagCleanup()
- throws MetacartaException
+ throws LCFException
{
// Delete the contents file if it is there.
if (contentsFile != null)
@@ -2087,7 +2087,7 @@
/** Process the data accumulated for this item */
public void process(String documentIdentifier, IProcessActivity activities, Filter filter)
- throws MetacartaException
+ throws LCFException
{
if (linkField == null || linkField.length() == 0)
linkField = guidField;
@@ -2215,7 +2215,7 @@
}
protected XMLContext beginTag(String namespaceURI, String localName, String qName, Attributes atts)
- throws MetacartaException, ServiceInterruption
+ throws LCFException, ServiceInterruption
{
// The tags we care about are "ttl" and "item", nothing else.
if (qName.equals("ttl"))
@@ -2233,7 +2233,7 @@
}
protected void endTag()
- throws MetacartaException, ServiceInterruption
+ throws LCFException, ServiceInterruption
{
XMLContext theContext = theStream.getContext();
String theTag = theContext.getQname();
@@ -2263,7 +2263,7 @@
/** Process this data */
protected boolean process()
- throws MetacartaException
+ throws LCFException
{
// Deal with the ttlvalue, if it was found
// Use the ttl value as a signal for when we ought to look at this feed again. If not present, use the default.
@@ -2319,7 +2319,7 @@
}
protected XMLContext beginTag(String namespaceURI, String localName, String qName, Attributes atts)
- throws MetacartaException, ServiceInterruption
+ throws LCFException, ServiceInterruption
{
// The tags we care about are "ttl" and "item", nothing else.
if (qName.equals("link"))
@@ -2353,15 +2353,15 @@
}
catch (java.net.SocketTimeoutException e)
{
- throw new MetacartaException("IO exception creating temp file: "+e.getMessage(),e);
+ throw new LCFException("IO exception creating temp file: "+e.getMessage(),e);
}
catch (InterruptedIOException e)
{
- throw new MetacartaException("Interrupted: "+e.getMessage(),e,MetacartaException.INTERRUPTED);
+ throw new LCFException("Interrupted: "+e.getMessage(),e,LCFException.INTERRUPTED);
}
catch (IOException e)
{
- throw new MetacartaException("IO exception creating temp file: "+e.getMessage(),e);
+ throw new LCFException("IO exception creating temp file: "+e.getMessage(),e);
}
}
break;
@@ -2375,15 +2375,15 @@
}
catch (java.net.SocketTimeoutException e)
{
- throw new MetacartaException("IO exception creating temp file: "+e.getMessage(),e);
+ throw new LCFException("IO exception creating temp file: "+e.getMessage(),e);
}
catch (InterruptedIOException e)
{
- throw new MetacartaException("Interrupted: "+e.getMessage(),e,MetacartaException.INTERRUPTED);
+ throw new LCFException("Interrupted: "+e.getMessage(),e,LCFException.INTERRUPTED);
}
catch (IOException e)
{
- throw new MetacartaException("IO exception creating temp file: "+e.getMessage(),e);
+ throw new LCFException("IO exception creating temp file: "+e.getMessage(),e);
}
}
break;
@@ -2397,7 +2397,7 @@
/** Convert the individual sub-fields of the item context into their final forms */
protected void endTag()
- throws MetacartaException, ServiceInterruption
+ throws LCFException, ServiceInterruption
{
XMLContext theContext = theStream.getContext();
String theTag = theContext.getQname();
@@ -2446,7 +2446,7 @@
}
protected void tagCleanup()
- throws MetacartaException
+ throws LCFException
{
// Delete the contents file if it is there.
if (contentsFile != null)
@@ -2458,7 +2458,7 @@
/** Process the data accumulated for this item */
public void process(String documentIdentifier, IProcessActivity activities, Filter filter)
- throws MetacartaException
+ throws LCFException
{
if (linkField != null && linkField.length() > 0)
{
@@ -2562,7 +2562,7 @@
}
protected XMLContext beginTag(String namespaceURI, String localName, String qName, Attributes atts)
- throws MetacartaException, ServiceInterruption
+ throws LCFException, ServiceInterruption
{
// The tags we care about are "ttl" and "item", nothing else.
if (qName.equals("ttl"))
@@ -2580,7 +2580,7 @@
}
protected void endTag()
- throws MetacartaException, ServiceInterruption
+ throws LCFException, ServiceInterruption
{
XMLContext theContext = theStream.getContext();
String theTag = theContext.getQname();
@@ -2610,7 +2610,7 @@
/** Process this data */
protected boolean process()
- throws MetacartaException
+ throws LCFException
{
// Deal with the ttlvalue, if it was found
// Use the ttl value as a signal for when we ought to look at this feed again. If not present, use the default.
@@ -2667,7 +2667,7 @@
}
protected XMLContext beginTag(String namespaceURI, String localName, String qName, Attributes atts)
- throws MetacartaException, ServiceInterruption
+ throws LCFException, ServiceInterruption
{
// The tags we care about are "ttl" and "item", nothing else.
if (qName.equals("link"))
@@ -2709,15 +2709,15 @@
}
catch (java.net.SocketTimeoutException e)
{
- throw new MetacartaException("IO exception creating temp file: "+e.getMessage(),e);
+ throw new LCFException("IO exception creating temp file: "+e.getMessage(),e);
}
catch (InterruptedIOException e)
{
- throw new MetacartaException("Interrupted: "+e.getMessage(),e,MetacartaException.INTERRUPTED);
+ throw new LCFException("Interrupted: "+e.getMessage(),e,LCFException.INTERRUPTED);
}
catch (IOException e)
{
- throw new MetacartaException("IO exception creating temp file: "+e.getMessage(),e);
+ throw new LCFException("IO exception creating temp file: "+e.getMessage(),e);
}
}
break;
@@ -2731,15 +2731,15 @@
}
catch (java.net.SocketTimeoutException e)
{
- throw new MetacartaException("IO exception creating temp file: "+e.getMessage(),e);
+ throw new LCFException("IO exception creating temp file: "+e.getMessage(),e);
}
catch (InterruptedIOException e)
{
- throw new MetacartaException("Interrupted: "+e.getMessage(),e,MetacartaException.INTERRUPTED);
+ throw new LCFException("Interrupted: "+e.getMessage(),e,LCFException.INTERRUPTED);
}
catch (IOException e)
{
- throw new MetacartaException("IO exception creating temp file: "+e.getMessage(),e);
+ throw new LCFException("IO exception creating temp file: "+e.getMessage(),e);
}
}
break;
@@ -2753,7 +2753,7 @@
/** Convert the individual sub-fields of the item context into their final forms */
protected void endTag()
- throws MetacartaException, ServiceInterruption
+ throws LCFException, ServiceInterruption
{
XMLContext theContext = theStream.getContext();
String theTag = theContext.getQname();
@@ -2798,7 +2798,7 @@
}
protected void tagCleanup()
- throws MetacartaException
+ throws LCFException
{
// Delete the contents file if it is there.
if (contentsFile != null)
@@ -2810,7 +2810,7 @@
/** Process the data accumulated for this item */
public void process(String documentIdentifier, IProcessActivity activities, Filter filter)
- throws MetacartaException
+ throws LCFException
{
if (linkField != null && linkField.length() > 0)
{
@@ -3281,7 +3281,7 @@
/** Code to check if data is interesting, based on response code and content type.
*/
protected boolean isContentInteresting(String contentType)
- throws MetacartaException
+ throws LCFException
{
// Look at the content type and decide if it's a kind we want. This is defined
// as something we think we can either ingest, or extract links from.
@@ -3544,7 +3544,7 @@
/** Get current token.
*/
public EvaluatorToken peek()
- throws MetacartaException
+ throws LCFException
{
if (token == null)
{
@@ -3561,7 +3561,7 @@
}
protected EvaluatorToken nextToken()
- throws MetacartaException
+ throws LCFException
{
char x;
// Fetch the next token
@@ -3653,7 +3653,7 @@
else if (modifier.startsWith("m"))
style = EvaluatorToken.GROUPSTYLE_MIXED;
else
- throw new MetacartaException("Unknown style: "+modifier);
+ throw new LCFException("Unknown style: "+modifier);
}
return new EvaluatorToken(groupNumber,style);
}
@@ -3759,7 +3759,7 @@
}
public String map(String url)
- throws MetacartaException
+ throws LCFException
{
// Create a matcher, and attempt to do a match
Matcher matcher = matchPattern.matcher(url);
@@ -3807,7 +3807,7 @@
}
break;
default:
- throw new MetacartaException("Illegal group style");
+ throw new LCFException("Illegal group style");
}
break;
case EvaluatorToken.TYPE_TEXT:
@@ -3815,7 +3815,7 @@
sb.append(t.getTextValue());
break;
default:
- throw new MetacartaException("Illegal token type");
+ throw new LCFException("Illegal token type");
}
}
return sb.toString();
@@ -3853,7 +3853,7 @@
}
public String map(String url)
- throws MetacartaException
+ throws LCFException
{
if (mappings.size() == 0)
return url;
@@ -3890,7 +3890,7 @@
/** Constructor. */
public Filter(DocumentSpecification spec, boolean warnOnBadSeed)
- throws MetacartaException
+ throws LCFException
{
// To save allocation, preallocate the seeds map assuming that it will require 1.5x the number of nodes in the spec
int initialSize = spec.getChildCount();
@@ -3917,7 +3917,7 @@
}
catch (java.util.regex.PatternSyntaxException e)
{
- throw new MetacartaException("Regular expression '"+match+"' is illegal: "+e.getMessage(),e);
+ throw new LCFException("Regular expression '"+match+"' is illegal: "+e.getMessage(),e);
}
if (map == null)
map = "";
@@ -3995,7 +3995,7 @@
}
catch (java.util.regex.PatternSyntaxException e)
{
- throw new MetacartaException("Canonicalization regular expression '"+urlRegexp+"' is illegal: "+e.getMessage(),e);
+ throw new LCFException("Canonicalization regular expression '"+urlRegexp+"' is illegal: "+e.getMessage(),e);
}
}
}
@@ -4045,7 +4045,7 @@
}
catch (NumberFormatException e)
{
- throw new MetacartaException("Bad number: "+e.getMessage(),e);
+ throw new LCFException("Bad number: "+e.getMessage(),e);
}
}
}
@@ -4060,7 +4060,7 @@
}
catch (NumberFormatException e)
{
- throw new MetacartaException("Bad number: "+e.getMessage(),e);
+ throw new LCFException("Bad number: "+e.getMessage(),e);
}
}
}
@@ -4075,7 +4075,7 @@
}
catch (NumberFormatException e)
{
- throw new MetacartaException("Bad number: "+e.getMessage(),e);
+ throw new LCFException("Bad number: "+e.getMessage(),e);
}
}
}
@@ -4090,7 +4090,7 @@
}
catch (NumberFormatException e)
{
- throw new MetacartaException("Bad number: "+e.getMessage(),e);
+ throw new LCFException("Bad number: "+e.getMessage(),e);
}
}
}
@@ -4209,7 +4209,7 @@
* @return null if the url doesn't match or should not be ingested, or the new string if it does.
*/
public String mapDocumentURL(String url)
- throws MetacartaException
+ throws LCFException
{
if (seeds.get(url) != null)
return null;
Modified: incubator/lcf/trunk/modules/connectors/rss/connector/org/apache/lcf/crawler/connectors/rss/Robots.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/connectors/rss/connector/org/apache/lcf/crawler/connectors/rss/Robots.java?rev=911029&r1=911028&r2=911029&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/connectors/rss/connector/org/apache/lcf/crawler/connectors/rss/Robots.java (original)
+++ incubator/lcf/trunk/modules/connectors/rss/connector/org/apache/lcf/crawler/connectors/rss/Robots.java Wed Feb 17 15:57:27 2010
@@ -100,7 +100,7 @@
/** Decide whether a specific robot can crawl a specific URL.
* A ServiceInterruption exception is thrown if the fetch itself fails in a transient way.
- * A permanent failure (such as an invalid URL) with throw a MetacartaException.
+ * A permanent failure (such as an invalid URL) with throw a LCFException.
*@param userAgent is the user-agent string used by the robot.
*@param from is the email address.
*@param protocol is the name of the protocol (e.g. "http")
@@ -115,7 +115,7 @@
long minimumMillisecondsPerFetchPerServer,
String proxyHost, int proxyPort, String proxyAuthDomain, String proxyAuthUsername, String proxyAuthPassword,
IVersionActivity activities, int connectionLimit)
- throws MetacartaException, ServiceInterruption
+ throws LCFException, ServiceInterruption
{
String identifyingString = protocol + "://" + hostName;
if (port != -1)
@@ -263,7 +263,7 @@
long minimumMillisecondsPerFetchPerServer,
String proxyHost, int proxyPort, String proxyAuthDomain, String proxyAuthUsername, String proxyAuthPassword,
IVersionActivity activities, int connectionLimit)
- throws ServiceInterruption, MetacartaException
+ throws ServiceInterruption, LCFException
{
synchronized (this)
{
@@ -278,7 +278,7 @@
}
catch (InterruptedException e)
{
- throw new MetacartaException("Interrupted: "+e.getMessage(),e,MetacartaException.INTERRUPTED);
+ throw new LCFException("Interrupted: "+e.getMessage(),e,LCFException.INTERRUPTED);
}
// Back around...
}
@@ -294,7 +294,7 @@
}
catch (InterruptedException e)
{
- throw new MetacartaException("Interrupted: "+e.getMessage(),e,MetacartaException.INTERRUPTED);
+ throw new LCFException("Interrupted: "+e.getMessage(),e,LCFException.INTERRUPTED);
}
// Back around...
}
@@ -440,7 +440,7 @@
long minimumMillisecondsPerFetchPerServer,
String proxyHost, int proxyPort, String proxyAuthDomain, String proxyAuthUsername, String proxyAuthPassword,
String hostName, IVersionActivity activities, int connectionLimit)
- throws ServiceInterruption, MetacartaException
+ throws ServiceInterruption, LCFException
{
invalidTime = currentTime + 24L * 60L * 60L * 1000L;
@@ -506,7 +506,7 @@
}
catch (InterruptedIOException e)
{
- throw new MetacartaException("Interrupted: "+e.getMessage(),e,MetacartaException.INTERRUPTED);
+ throw new LCFException("Interrupted: "+e.getMessage(),e,LCFException.INTERRUPTED);
}
catch (IOException e)
{
@@ -523,7 +523,7 @@
* Is NOT expected to close the stream.
*/
protected void parseRobotsTxt(BufferedReader r, String hostName, IVersionActivity activities)
- throws IOException, MetacartaException
+ throws IOException, LCFException
{
boolean parseCompleted = false;
boolean robotsWasHtml = false;
Modified: incubator/lcf/trunk/modules/connectors/rss/connector/org/apache/lcf/crawler/connectors/rss/SetSeedList.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/connectors/rss/connector/org/apache/lcf/crawler/connectors/rss/SetSeedList.java?rev=911029&r1=911028&r2=911029&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/connectors/rss/connector/org/apache/lcf/crawler/connectors/rss/SetSeedList.java (original)
+++ incubator/lcf/trunk/modules/connectors/rss/connector/org/apache/lcf/crawler/connectors/rss/SetSeedList.java Wed Feb 17 15:57:27 2010
@@ -47,7 +47,7 @@
try
{
- Metacarta.initializeEnvironment();
+ LCF.initializeEnvironment();
IThreadContext tc = ThreadContextFactory.make();
IJobManager jobManager = JobManagerFactory.make(tc);
IJobDescription desc = jobManager.load(new Long(jobString));
Modified: incubator/lcf/trunk/modules/connectors/rss/connector/org/apache/lcf/crawler/connectors/rss/ThrottledFetcher.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/connectors/rss/connector/org/apache/lcf/crawler/connectors/rss/ThrottledFetcher.java?rev=911029&r1=911028&r2=911029&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/connectors/rss/connector/org/apache/lcf/crawler/connectors/rss/ThrottledFetcher.java (original)
+++ incubator/lcf/trunk/modules/connectors/rss/connector/org/apache/lcf/crawler/connectors/rss/ThrottledFetcher.java Wed Feb 17 15:57:27 2010
@@ -22,7 +22,7 @@
import org.apache.lcf.agents.interfaces.*;
import org.apache.lcf.crawler.interfaces.*;
import org.apache.lcf.crawler.system.Logging;
-import org.apache.lcf.crawler.system.Metacarta;
+import org.apache.lcf.crawler.system.LCF;
import java.util.*;
import java.io.*;
@@ -84,7 +84,7 @@
/** Note that we're about to need a handle (and make sure we have enough) */
protected static void registerGlobalHandle(int maxHandles)
- throws MetacartaException
+ throws LCFException
{
try
{
@@ -99,7 +99,7 @@
}
catch (InterruptedException e)
{
- throw new MetacartaException("Interrupted: "+e.getMessage(),e,MetacartaException.INTERRUPTED);
+ throw new LCFException("Interrupted: "+e.getMessage(),e,LCFException.INTERRUPTED);
}
}
@@ -137,7 +137,7 @@
*/
public synchronized IThrottledConnection createConnection(String serverName, double minimumMillisecondsPerBytePerServer,
int maxOpenConnectionsPerServer, long minimumMillisecondsPerFetchPerServer, int connectionLimit, int connectionTimeoutMilliseconds)
- throws MetacartaException, ServiceInterruption
+ throws LCFException, ServiceInterruption
{
Server server;
server = (Server)serverMap.get(serverName);
@@ -153,7 +153,7 @@
/** Poll. This method is designed to allow idle connections to be closed and freed.
*/
public synchronized void poll()
- throws MetacartaException
+ throws LCFException
{
// Nothing needed now; connections are released when we're done with them.
}
@@ -310,7 +310,7 @@
}
public DataSession getSession(String url)
- throws MetacartaException
+ throws LCFException
{
initializeParameters();
return new DataSession(this,url);
@@ -318,7 +318,7 @@
/** Atomically write resultlog record, returning data file name to use */
public synchronized String writeResponseRecord(String url, int responseCode, ArrayList headerNames, ArrayList headerValues)
- throws MetacartaException
+ throws LCFException
{
// Open log file
try
@@ -355,7 +355,7 @@
}
catch (IOException e)
{
- throw new MetacartaException("Error recording file info: "+e.getMessage(),e);
+ throw new LCFException("Error recording file info: "+e.getMessage(),e);
}
}
@@ -391,7 +391,7 @@
}
public void endHeader()
- throws MetacartaException
+ throws LCFException
{
documentName = dr.writeResponseRecord(url,responseCode,headerNames,headerValues);
}
@@ -452,7 +452,7 @@
*/
public ThrottledConnection(Server server, double minimumMillisecondsPerBytePerServer, int maxOpenConnectionsPerServer,
long minimumMillisecondsPerFetchPerServer, int connectionTimeoutMilliseconds, int connectionLimit)
- throws MetacartaException
+ throws LCFException
{
this.minimumMillisecondsPerBytePerServer = minimumMillisecondsPerBytePerServer;
this.maxOpenConnectionsPerServer = maxOpenConnectionsPerServer;
@@ -473,7 +473,7 @@
* is used solely for logging purposes.
*/
public void beginFetch(String fetchType)
- throws MetacartaException
+ throws LCFException
{
this.fetchType = fetchType;
fetchCounter = 0L;
@@ -483,7 +483,7 @@
}
catch (InterruptedException e)
{
- throw new MetacartaException("Interrupted",MetacartaException.INTERRUPTED);
+ throw new LCFException("Interrupted",LCFException.INTERRUPTED);
}
}
@@ -551,7 +551,7 @@
public int executeFetch(String protocol, int port, String urlPath, String userAgent, String from,
String proxyHost, int proxyPort, String proxyAuthDomain, String proxyAuthUsername, String proxyAuthPassword,
String lastETag, String lastModified)
- throws MetacartaException, ServiceInterruption
+ throws LCFException, ServiceInterruption
{
StringBuffer sb = new StringBuffer(protocol);
@@ -679,7 +679,7 @@
}
catch (InterruptedIOException e)
{
- throw new MetacartaException("Interrupted",MetacartaException.INTERRUPTED);
+ throw new LCFException("Interrupted",LCFException.INTERRUPTED);
}
catch (org.apache.commons.httpclient.CircularRedirectException e)
{
@@ -721,11 +721,11 @@
{
// Drop the current connection on the floor, so it cannot be reused.
fetchMethod = null;
- throw new MetacartaException("Interrupted: "+e.getMessage(),e,MetacartaException.INTERRUPTED);
+ throw new LCFException("Interrupted: "+e.getMessage(),e,LCFException.INTERRUPTED);
}
catch (URIException e)
{
- throwable = new MetacartaException("Illegal URI: '"+myUrl+"'",e);
+ throwable = new LCFException("Illegal URI: '"+myUrl+"'",e);
statusCode = FETCH_BAD_URI;
if (recordEverything)
dataSession.setResponseCode(statusCode);
@@ -733,7 +733,7 @@
}
catch (IllegalArgumentException e)
{
- throwable = new MetacartaException("Illegal URI: '"+myUrl+"'",e);
+ throwable = new LCFException("Illegal URI: '"+myUrl+"'",e);
statusCode = FETCH_BAD_URI;
if (recordEverything)
dataSession.setResponseCode(statusCode);
@@ -741,7 +741,7 @@
}
catch (IllegalStateException e)
{
- throwable = new MetacartaException("Illegal state while fetching URI: '"+myUrl+"'",e);
+ throwable = new LCFException("Illegal state while fetching URI: '"+myUrl+"'",e);
statusCode = FETCH_SEQUENCE_ERROR;
if (recordEverything)
dataSession.setResponseCode(statusCode);
@@ -751,7 +751,7 @@
{
throw e;
}
- catch (MetacartaException e)
+ catch (LCFException e)
{
throw e;
}
@@ -770,7 +770,7 @@
*@return the response code. This is either an HTTP response code, or one of the codes above.
*/
public int getResponseCode()
- throws MetacartaException, ServiceInterruption
+ throws LCFException, ServiceInterruption
{
return statusCode;
}
@@ -779,26 +779,26 @@
* to close this stream when done.
*/
public InputStream getResponseBodyStream()
- throws MetacartaException, ServiceInterruption
+ throws LCFException, ServiceInterruption
{
if (fetchMethod == null)
- throw new MetacartaException("Attempt to get a response when there is no method");
+ throw new LCFException("Attempt to get a response when there is no method");
try
{
if (recordEverything)
dataSession.endHeader();
InputStream bodyStream = fetchMethod.getResponseBodyAsStream();
if (bodyStream == null)
- throw new MetacartaException("Failed to set up body response stream");
+ throw new LCFException("Failed to set up body response stream");
return new ThrottledInputstream(this,server,bodyStream,minimumMillisecondsPerBytePerServer,dataSession);
}
catch (IOException e)
{
- throw new MetacartaException("IO exception setting up response stream",e);
+ throw new LCFException("IO exception setting up response stream",e);
}
catch (IllegalStateException e)
{
- throw new MetacartaException("State error getting response body",e);
+ throw new LCFException("State error getting response body",e);
}
}
@@ -807,7 +807,7 @@
*@return the header value, or null if it doesn't exist.
*/
public String getResponseHeader(String headerName)
- throws MetacartaException, ServiceInterruption
+ throws LCFException, ServiceInterruption
{
Header h = fetchMethod.getResponseHeader(headerName);
if (h == null)
@@ -821,7 +821,7 @@
* describing what was done.
*/
public void doneFetch(IVersionActivity activities)
- throws MetacartaException
+ throws LCFException
{
if (fetchType != null)
{
@@ -862,7 +862,7 @@
/** Close the connection. Call this to end this server connection.
*/
public void close()
- throws MetacartaException
+ throws LCFException
{
// Clean up the connection pool. This should do the necessary bookkeeping to release the one connection that's sitting there.
connectionManager.shutdown();
@@ -1121,7 +1121,7 @@
/** Register an outstanding connection (and wait until it can be obtained before proceeding) */
public synchronized void registerConnection(int maxOutstandingConnections)
- throws MetacartaException
+ throws LCFException
{
try
{
@@ -1133,7 +1133,7 @@
}
catch (InterruptedException e)
{
- throw new MetacartaException("Interrupted: "+e.getMessage(),e,MetacartaException.INTERRUPTED);
+ throw new LCFException("Interrupted: "+e.getMessage(),e,LCFException.INTERRUPTED);
}
}
@@ -1174,7 +1174,7 @@
if (Logging.connectors.isDebugEnabled())
Logging.connectors.debug("RSS: Performing a fetch wait for server '"+serverName+"' for "+
new Long(waitAmount).toString()+" ms.");
- Metacarta.sleep(waitAmount);
+ LCF.sleep(waitAmount);
}
// System.out.println("For server "+this.toString()+", at "+new Long(System.currentTimeMillis()).toString()+", the next fetch time is now "+new Long(nextFetchTime).toString());
@@ -1268,7 +1268,7 @@
if (Logging.connectors.isDebugEnabled())
Logging.connectors.debug("RSS: Performing a read wait on server '"+serverName+"' of "+
new Long(waitTime).toString()+" ms.");
- Metacarta.sleep(waitTime);
+ LCF.sleep(waitTime);
}
//if (Logging.connectors.isTraceEnabled())
Modified: incubator/lcf/trunk/modules/connectors/rss/crawler-ui/connectors/rss/postspec.jsp
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/connectors/rss/crawler-ui/connectors/rss/postspec.jsp?rev=911029&r1=911028&r2=911029&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/connectors/rss/crawler-ui/connectors/rss/postspec.jsp (original)
+++ incubator/lcf/trunk/modules/connectors/rss/crawler-ui/connectors/rss/postspec.jsp Wed Feb 17 15:57:27 2010
@@ -123,7 +123,7 @@
}
catch (java.io.IOException e)
{
- throw new MetacartaException("IO error",e);
+ throw new LCFException("IO error",e);
}
}
Modified: incubator/lcf/trunk/modules/connectors/sharepoint/connector/org/apache/lcf/crawler/connectors/sharepoint/MatchMap.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/connectors/sharepoint/connector/org/apache/lcf/crawler/connectors/sharepoint/MatchMap.java?rev=911029&r1=911028&r2=911029&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/connectors/sharepoint/connector/org/apache/lcf/crawler/connectors/sharepoint/MatchMap.java (original)
+++ incubator/lcf/trunk/modules/connectors/sharepoint/connector/org/apache/lcf/crawler/connectors/sharepoint/MatchMap.java Wed Feb 17 15:57:27 2010
@@ -261,7 +261,7 @@
/** Perform a translation.
*/
public String translate(String input)
- throws MetacartaException
+ throws LCFException
{
// Build pattern vector if not already there
if (matchPatterns == null)
@@ -278,7 +278,7 @@
catch (java.util.regex.PatternSyntaxException e)
{
matchPatterns = null;
- throw new MetacartaException("For match expression '"+regexp+"', found pattern syntax error: "+e.getMessage(),e);
+ throw new LCFException("For match expression '"+regexp+"', found pattern syntax error: "+e.getMessage(),e);
}
i++;
}