Java Doc for SimpleCocoonCrawlerImpl.java in  » Content-Management-System » apache-lenya-2.0 » org » apache » cocoon » components » crawler » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Content Management System » apache lenya 2.0 » org.apache.cocoon.components.crawler 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.cocoon.components.crawler.SimpleCocoonCrawlerImpl

SimpleCocoonCrawlerImpl
public class SimpleCocoonCrawlerImpl extends AbstractLogEnabled implements CocoonCrawler,Configurable,Disposable,Recyclable(Code)
A simple cocoon crawler.
author:
   Bernhard Huber
version:
   CVS $Id: SimpleCocoonCrawlerImpl.java 433543 2006-08-22 06:22:54Z crossley $

Inner Class :public static class CocoonCrawlerIterator implements Iterator

Field Summary
final public static  StringACCEPT_CONFIG
     Config element name specifying http header value for accept.
final public static  StringACCEPT_DEFAULT
     Default value of accept configuration option.
final public static  StringEXCLUDE_CONFIG
     Config element name specifying excluding regular expression pattern.
final public static  StringINCLUDE_CONFIG
     Config element name specifying including regular expression pattern.
final public static  StringLINK_CONTENT_TYPE_CONFIG
     Config element name specifying expected link content-typ.
final public  StringLINK_CONTENT_TYPE_DEFAULT
     Default value of link-content-type configuration value.
final public static  StringLINK_VIEW_QUERY_CONFIG
     Config element name specifying query-string appendend for requesting links of an URL.
final public static  StringLINK_VIEW_QUERY_DEFAULT
     Default value of link-view-query configuration option.
final public static  StringUSER_AGENT_CONFIG
     Config element name specifying http header value for user-Agent.
final public static  StringUSER_AGENT_DEFAULT
     Default value of user-agent configuration option.
protected  intdepth
    
protected  HashSeturlsNextDepth
    
protected  HashSeturlsToProcess
    

Constructor Summary
public  SimpleCocoonCrawlerImpl()
    

Method Summary
public  voidconfigure(Configuration configuration)
     Configure the crawler component.

Configure can specify which URI to include, and which URI to exclude from crawling.

public  voidcrawl(URL url)
    
public  voidcrawl(URL url, int maxDepth)
     Start crawling a URL.

Use this method to start crawling. Get the this url, and all its children by using iterator(). The Iterator object will return URL objects.

You may use the crawl(), and iterator() methods the following way:


 SimpleCocoonCrawlerImpl scci = ....;
 scci.crawl( "http://foo/bar" );
 Iterator i = scci.iterator();
 while (i.hasNext()) {
 URL url = (URL)i.next();
 ...
 }
 

The i.next() method returns a URL, and calculates the links of the URL before return it.


Parameters:
  url - Crawl this URL, getting all links from this URL.
Parameters:
  maxDepth - maximum depth to crawl to.
public  voiddispose()
     dispose at end of life cycle, releasing all resources.
public  Iteratoriterator()
     Return iterator, iterating over all links of the currently crawled URL.
public  voidrecycle()
    

Field Detail
ACCEPT_CONFIG
final public static String ACCEPT_CONFIG(Code)
Config element name specifying http header value for accept.

Its value is accept.




ACCEPT_DEFAULT
final public static String ACCEPT_DEFAULT(Code)
Default value of accept configuration option.

Its value is * / *




EXCLUDE_CONFIG
final public static String EXCLUDE_CONFIG(Code)
Config element name specifying excluding regular expression pattern.

Its value is exclude.




INCLUDE_CONFIG
final public static String INCLUDE_CONFIG(Code)
Config element name specifying including regular expression pattern.

Its value is include.




LINK_CONTENT_TYPE_CONFIG
final public static String LINK_CONTENT_TYPE_CONFIG(Code)
Config element name specifying expected link content-typ.

Its value is link-content-type.




LINK_CONTENT_TYPE_DEFAULT
final public String LINK_CONTENT_TYPE_DEFAULT(Code)
Default value of link-content-type configuration value.

Its value is application/x-cocoon-links.




LINK_VIEW_QUERY_CONFIG
final public static String LINK_VIEW_QUERY_CONFIG(Code)
Config element name specifying query-string appendend for requesting links of an URL.

Its value is link-view-query.




LINK_VIEW_QUERY_DEFAULT
final public static String LINK_VIEW_QUERY_DEFAULT(Code)
Default value of link-view-query configuration option.

Its value is ?cocoon-view=links.




USER_AGENT_CONFIG
final public static String USER_AGENT_CONFIG(Code)
Config element name specifying http header value for user-Agent.

Its value is user-agent.




USER_AGENT_DEFAULT
final public static String USER_AGENT_DEFAULT(Code)
Default value of user-agent configuration option.
See Also:   Constants.COMPLETE_NAME



depth
protected int depth(Code)



urlsNextDepth
protected HashSet urlsNextDepth(Code)



urlsToProcess
protected HashSet urlsToProcess(Code)




Constructor Detail
SimpleCocoonCrawlerImpl
public SimpleCocoonCrawlerImpl()(Code)
Constructor for the SimpleCocoonCrawlerImpl object




Method Detail
configure
public void configure(Configuration configuration) throws ConfigurationException(Code)
Configure the crawler component.

Configure can specify which URI to include, and which URI to exclude from crawling. You specify the patterns as regular expressions.

Morover you can configure the required content-type of crawling request, and the query-string appended to each crawling request.


 <include>.*\.html?</exclude> or <exclude>.*\.html?, .*\.xsp</exclude>
 <exclude>.*\.gif</exclude> or <exclude>.*\.gif, .*\.jpe?g</exclude>
 <link-content-type> application/x-cocoon-links </link-content-type>
 <link-view-query> ?cocoon-view=links </link-view-query>
 

Parameters:
  configuration - XML configuration of this avalon component.
exception:
  ConfigurationException - is throwing if configuration is invalid.



crawl
public void crawl(URL url)(Code)
The same as calling crawl(url,-1);
Parameters:
  url - Crawl this URL, getting all links from this URL.



crawl
public void crawl(URL url, int maxDepth)(Code)
Start crawling a URL.

Use this method to start crawling. Get the this url, and all its children by using iterator(). The Iterator object will return URL objects.

You may use the crawl(), and iterator() methods the following way:


 SimpleCocoonCrawlerImpl scci = ....;
 scci.crawl( "http://foo/bar" );
 Iterator i = scci.iterator();
 while (i.hasNext()) {
 URL url = (URL)i.next();
 ...
 }
 

The i.next() method returns a URL, and calculates the links of the URL before return it.


Parameters:
  url - Crawl this URL, getting all links from this URL.
Parameters:
  maxDepth - maximum depth to crawl to. -1 for no maximum.



dispose
public void dispose()(Code)
dispose at end of life cycle, releasing all resources.



iterator
public Iterator iterator()(Code)
Return iterator, iterating over all links of the currently crawled URL.

The Iterator object will return URL objects at its next() method.

Iterator iterator of all links from the crawl URL.



recycle
public void recycle()(Code)
recylcle this object, relasing resources



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.