01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.cocoon.components.crawler;
18:
19: import org.apache.avalon.framework.component.Component;
20:
21: import java.net.URL;
22: import java.util.Iterator;
23:
24: /**
25: * The avalon behavioural component interface of crawling.
26: *
27: * @author <a href="mailto:berni_huber@a1.net">Bernhard Huber</a>
28: * @version CVS $Id: CocoonCrawler.java 433543 2006-08-22 06:22:54Z crossley $
29: */
30: public interface CocoonCrawler extends Component {
31:
32: /**
33: * Role name of this avalon component.
34: * Its value is <code>org.apache.cocoon.components.crawler.CocoonCrawler</code>.
35: */
36: String ROLE = CocoonCrawler.class.getName();
37:
38: /**
39: * This is the same as calling crawl(url,-1);
40: *
41: * @param url The URL to start crawling from.
42: */
43: void crawl(URL url);
44:
45: /**
46: * start crawling the URL.
47: * <p>
48: * Calling this method initiates the crawling and tells the
49: * crawler not to crawl beyond a maximum depth.
50: * </p>
51: *
52: * @param url The URL to start crawling from
53: * @param maxDepth The maximum depth to crawl to. -1 for no maxiumum.
54: */
55: void crawl(URL url, int maxDepth);
56:
57: /**
58: * Iterate over crawling URLs.
59: * <p>
60: * This iterator will returns URL as result of crawling
61: * the base URL passed via crawling().
62: * </p>
63: *
64: * @return Iterator iterates over crawling URLs.
65: */
66: Iterator iterator();
67: }
|