Java Doc for SettingsHandler.java in  » Web-Crawler » heritrix » org » archive » crawler » settings » 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 » Web Crawler » heritrix » org.archive.crawler.settings 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.archive.crawler.settings.SettingsHandler

All known Subclasses:   org.archive.crawler.settings.XMLSettingsHandler,
SettingsHandler
abstract public class SettingsHandler (Code)
An instance of this class holds a hierarchy of settings. More than one instance in memory is allowed so that a new CrawlJob could be configured while another job is running. This class should be subclassed to adapt to a persistent storage.
author:
   John Erik Halse


Field Summary
final static  StringBOOLEAN
    
final static  StringDOUBLE
    
final static  StringDOUBLE_LIST
    
final static  StringFLOAT
    
final static  StringFLOAT_LIST
    
final static  StringINTEGER
    
final static  StringINTEGER_LIST
    
final static  StringLONG
    
final static  StringLONG_LIST
    
final static  StringMAP
    
final static  StringOBJECT
    
final static  StringSTRING
    
final static  StringSTRING_LIST
    
final static  StringTEXT
    
final static  StringTIMESTAMP
    

Constructor Summary
public  SettingsHandler()
     Create a new SettingsHandler object.

Method Summary
protected static  ObjectStringToType(String stringValue, String typeName)
     Convert a String object to an object of typeName.
Parameters:
  stringValue - string to convert.
Parameters:
  typeName - type to convert to.
public  voidcleanup()
    
public  voidclearPerHostSettingsCache()
     Clear any per-host settings cached in memory; allows editting of per-host settings files on disk, perhaps in bulk/automated fashion, to take effect in running crawl.
public  voiddeleteSettingsObject(CrawlerSettings settings)
     Delete a settings object from persistent storage.
 booleanfireValueErrorHandlers(Constraint.FailedCheck error)
     Fire events on all registered ValueErrorHandler .
Parameters:
  error - the failed constraints return value.
protected static  StringgetClassName(String typeName)
    
public  ComplexTypegetComplexTypeByAbsoluteName(CrawlerSettings settings, String absoluteName)
     Get a complex type by its absolute name. The absolute name is the complex types name and the path leading to it.
Parameters:
  settings - the settings object to query.
Parameters:
  absoluteName - the absolute name of the complex type to get.
abstract public  CollectiongetDomainOverrides(String rootDomain)
     Will return a Collection of strings with domains that contain 'per' domain overrides (or their subdomains contain them).
abstract public  ListgetListOfAllFiles()
     Creates and returns a List of all files comprising the current settings framework.
public  ModuleTypegetModule(String name)
     Get a module by name. All modules in the order should have unique names.
public  CrawlerSettingsgetOrCreateSettingsObject(String scope)
     Get or create CrawlerSettings object for a host or domain. This method is similar to SettingsHandler.getSettingsObject(String) except that if there is no settings for this particular host or domain a new settings object will be returned.
Parameters:
  scope - the host or domain to get or create the settings for.
public  CrawlerSettingsgetOrCreateSettingsObject(String scope, String refinement)
    
public  CrawlOrdergetOrder()
     Get the CrawlOrder.
protected  StringgetParentScope(String scope)
     Strip off the leftmost part of a domain name.
Parameters:
  scope - the domain name.
abstract public  FilegetPathRelativeToWorkingDirectory(String path)
     Transforms a relative path so that it is relative to a location that is regarded as a working dir for these settings.
public  CrawlerSettingsgetSettings(String host)
     Get CrawlerSettings object in effect for a host or domain. If there is no specific settings for the host/domain, it will recursively go up the hierarchy to find the settings object that should be used for this host/domain.
Parameters:
  host - the host or domain to get the settings for.
public  CrawlerSettingsgetSettings(String host, UURI uuri)
     Get CrawlerSettings object in effect for a host or domain. If there is no specific settings for the host/domain, it will recursively go up the hierarchy to find the settings object that should be used for this host/domain.

This method passes around a URI that refinement are checked against.
Parameters:
  host - the host or domain to get the settings for.
Parameters:
  uuri - UURI for context.

protected  CrawlerSettingsgetSettingsForHost(String host)
    
public  CrawlerSettingsgetSettingsObject(String scope)
     Get CrawlerSettings object for a host or domain. The difference between this method and the getSettings(String host) is that this method will return null if there is no settings for particular host or domain.
Parameters:
  scope - the host or domain to get the settings for.
public  CrawlerSettingsgetSettingsObject(String scope, String refinement)
     Get CrawlerSettings object for a host/domain and a particular refinement.
Parameters:
  scope - the host or domain to get the settings for.
Parameters:
  refinement - the refinement reference to get.
protected static  StringgetTypeName(String className)
    
public  voidinitialize()
     Initialize the SettingsHandler.
public static  ModuleTypeinstantiateModuleTypeFromClassName(String name, String className)
     Instatiate a new ModuleType given its name and className.
Parameters:
  name - the name for the new ComplexType.
Parameters:
  className - the class name of the new ComplexType.
abstract protected  CrawlerSettingsreadSettingsObject(CrawlerSettings settings)
     Read the CrawlerSettings object from persistent storage.
Parameters:
  settings - the settings object to be updated with data from thepersistent storage.
public  voidregisterValueErrorHandler(ValueErrorHandler errorHandler)
     Register an instance of ValueErrorHandler .
public  voidsetErrorReportingLevel(Level level)
     Set the level for which notification of failed constraints will be fired.
public  voidunregisterValueErrorHandler(ValueErrorHandler errorHandler)
     Unregister an instance of ValueErrorHandler .
abstract public  voidwriteSettingsObject(CrawlerSettings settings)
     Write the CrawlerSettings object to persistent storage.

Field Detail
BOOLEAN
final static String BOOLEAN(Code)



DOUBLE
final static String DOUBLE(Code)



DOUBLE_LIST
final static String DOUBLE_LIST(Code)



FLOAT
final static String FLOAT(Code)



FLOAT_LIST
final static String FLOAT_LIST(Code)



INTEGER
final static String INTEGER(Code)
Datatypes supported by the settings framwork



INTEGER_LIST
final static String INTEGER_LIST(Code)



LONG
final static String LONG(Code)



LONG_LIST
final static String LONG_LIST(Code)



MAP
final static String MAP(Code)



OBJECT
final static String OBJECT(Code)



STRING
final static String STRING(Code)



STRING_LIST
final static String STRING_LIST(Code)



TEXT
final static String TEXT(Code)



TIMESTAMP
final static String TIMESTAMP(Code)




Constructor Detail
SettingsHandler
public SettingsHandler() throws InvalidAttributeValueException(Code)
Create a new SettingsHandler object.
throws:
  InvalidAttributeValueException -




Method Detail
StringToType
protected static Object StringToType(String stringValue, String typeName)(Code)
Convert a String object to an object of typeName.
Parameters:
  stringValue - string to convert.
Parameters:
  typeName - type to convert to. typeName should be one of thesupported types represented by constants in this class. the new value object.
throws:
  ClassCastException - is thrown if string could not be converted.



cleanup
public void cleanup()(Code)



clearPerHostSettingsCache
public void clearPerHostSettingsCache()(Code)
Clear any per-host settings cached in memory; allows editting of per-host settings files on disk, perhaps in bulk/automated fashion, to take effect in running crawl.



deleteSettingsObject
public void deleteSettingsObject(CrawlerSettings settings)(Code)
Delete a settings object from persistent storage.
Parameters:
  settings - the settings object to delete.



fireValueErrorHandlers
boolean fireValueErrorHandlers(Constraint.FailedCheck error)(Code)
Fire events on all registered ValueErrorHandler .
Parameters:
  error - the failed constraints return value. true if there was any registered ValueErrorHandlers to notify.



getClassName
protected static String getClassName(String typeName)(Code)



getComplexTypeByAbsoluteName
public ComplexType getComplexTypeByAbsoluteName(CrawlerSettings settings, String absoluteName) throws AttributeNotFoundException(Code)
Get a complex type by its absolute name. The absolute name is the complex types name and the path leading to it.
Parameters:
  settings - the settings object to query.
Parameters:
  absoluteName - the absolute name of the complex type to get. the complex type referenced by the absolute name or null ifthe complex type could not be found in this settings object.
throws:
  AttributeNotFoundException - is thrown if no ComplexType by thisname exist.



getDomainOverrides
abstract public Collection getDomainOverrides(String rootDomain)(Code)
Will return a Collection of strings with domains that contain 'per' domain overrides (or their subdomains contain them). The domains considered are limited to those that are subdomains of the supplied domain. If null or empty string is supplied the TLDs will be considered.
Parameters:
  rootDomain - The domain to get domain overrides for. Examples:'org', 'archive.org', 'crawler.archive.org' etc. An array of domains that contain overrides. If rootDomain does notexist an empty array will be returned.



getListOfAllFiles
abstract public List getListOfAllFiles()(Code)
Creates and returns a List of all files comprising the current settings framework.

The List contains the absolute String path of each file.

The list should contain any configurable files, including such files as seed file and any other files use by the various settings modules.

Implementations of the SettingsHandler that do not use files for permanent storage should return an empty list. List of framework files.




getModule
public ModuleType getModule(String name)(Code)
Get a module by name. All modules in the order should have unique names. This method makes it possible to get the modules of the order by its name.
Parameters:
  name - the modules name. the module the name references.



getOrCreateSettingsObject
public CrawlerSettings getOrCreateSettingsObject(String scope)(Code)
Get or create CrawlerSettings object for a host or domain. This method is similar to SettingsHandler.getSettingsObject(String) except that if there is no settings for this particular host or domain a new settings object will be returned.
Parameters:
  scope - the host or domain to get or create the settings for. settings object for the host/domain.
See Also:   SettingsHandler.getSettings(String)
See Also:   SettingsHandler.getSettingsObject(String)



getOrCreateSettingsObject
public CrawlerSettings getOrCreateSettingsObject(String scope, String refinement)(Code)



getOrder
public CrawlOrder getOrder()(Code)
Get the CrawlOrder. the CrawlOrder



getParentScope
protected String getParentScope(String scope)(Code)
Strip off the leftmost part of a domain name.
Parameters:
  scope - the domain name. scope with everything before the first dot ripped off.



getPathRelativeToWorkingDirectory
abstract public File getPathRelativeToWorkingDirectory(String path)(Code)
Transforms a relative path so that it is relative to a location that is regarded as a working dir for these settings. If an absolute path is given, it will be returned unchanged.
Parameters:
  path - A relative path to a file (or directory) The same path modified so that it is relative to the file levellocation that is considered the working directory for these settings.



getSettings
public CrawlerSettings getSettings(String host)(Code)
Get CrawlerSettings object in effect for a host or domain. If there is no specific settings for the host/domain, it will recursively go up the hierarchy to find the settings object that should be used for this host/domain.
Parameters:
  host - the host or domain to get the settings for. settings object in effect for the host/domain.
See Also:   SettingsHandler.getSettingsObject(String)
See Also:   SettingsHandler.getOrCreateSettingsObject(String)



getSettings
public CrawlerSettings getSettings(String host, UURI uuri)(Code)
Get CrawlerSettings object in effect for a host or domain. If there is no specific settings for the host/domain, it will recursively go up the hierarchy to find the settings object that should be used for this host/domain.

This method passes around a URI that refinement are checked against.
Parameters:
  host - the host or domain to get the settings for.
Parameters:
  uuri - UURI for context. settings object in effect for the host/domain.
See Also:   SettingsHandler.getSettingsObject(String)
See Also:   SettingsHandler.getOrCreateSettingsObject(String)




getSettingsForHost
protected CrawlerSettings getSettingsForHost(String host)(Code)



getSettingsObject
public CrawlerSettings getSettingsObject(String scope)(Code)
Get CrawlerSettings object for a host or domain. The difference between this method and the getSettings(String host) is that this method will return null if there is no settings for particular host or domain.
Parameters:
  scope - the host or domain to get the settings for. settings object for the host/domain or null if nosettings exist for the host/domain.
See Also:   SettingsHandler.getSettings(String)
See Also:   SettingsHandler.getOrCreateSettingsObject(String)



getSettingsObject
public CrawlerSettings getSettingsObject(String scope, String refinement)(Code)
Get CrawlerSettings object for a host/domain and a particular refinement.
Parameters:
  scope - the host or domain to get the settings for.
Parameters:
  refinement - the refinement reference to get. CrawlerSettings object for a host/domain and a particularrefinement or null if no settings exist for the host/domain.



getTypeName
protected static String getTypeName(String className)(Code)



initialize
public void initialize()(Code)
Initialize the SettingsHandler. This method reads the default settings from the persistent storage.



instantiateModuleTypeFromClassName
public static ModuleType instantiateModuleTypeFromClassName(String name, String className) throws InvocationTargetException(Code)
Instatiate a new ModuleType given its name and className.
Parameters:
  name - the name for the new ComplexType.
Parameters:
  className - the class name of the new ComplexType. an instance of the class identified by className.
throws:
  InvocationTargetException -



readSettingsObject
abstract protected CrawlerSettings readSettingsObject(CrawlerSettings settings)(Code)
Read the CrawlerSettings object from persistent storage.
Parameters:
  settings - the settings object to be updated with data from thepersistent storage. the updated settings object or null if there was no data for thisin the persistent storage.



registerValueErrorHandler
public void registerValueErrorHandler(ValueErrorHandler errorHandler)(Code)
Register an instance of ValueErrorHandler .

If a ValueErrorHandler is registered, only constraints with level Level.SEVERE will throw an InvalidAttributeValueException . The ValueErrorHandler will recieve a notification for all failed checks with level equal or greater than the error reporting level.
Parameters:
  errorHandler - the CalueErrorHandler to register.
See Also:   ValueErrorHandler
See Also:   SettingsHandler.setErrorReportingLevel(Level)
See Also:   SettingsHandler.unregisterValueErrorHandler(ValueErrorHandler)




setErrorReportingLevel
public void setErrorReportingLevel(Level level)(Code)
Set the level for which notification of failed constraints will be fired.
Parameters:
  level - the error reporting level.



unregisterValueErrorHandler
public void unregisterValueErrorHandler(ValueErrorHandler errorHandler)(Code)
Unregister an instance of ValueErrorHandler .
Parameters:
  errorHandler - the CalueErrorHandler to unregister.
See Also:   ValueErrorHandler
See Also:   SettingsHandler.setErrorReportingLevel(Level)
See Also:   SettingsHandler.registerValueErrorHandler(ValueErrorHandler)



writeSettingsObject
abstract public void writeSettingsObject(CrawlerSettings settings)(Code)
Write the CrawlerSettings object to persistent storage.
Parameters:
  settings - the settings object to write.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

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