SMILA (incubation) API documentation

org.eclipse.smila.connectivity.framework.crawler.web.configuration
Class Configuration

java.lang.Object
  extended by org.eclipse.smila.connectivity.framework.crawler.web.configuration.Configuration

public class Configuration
extends java.lang.Object

Class that handles all crawler configuration.


Field Summary
static int MILLIS_PER_SECOND
          The Constant MILLIS_PER_SECOND.
 
Constructor Summary
Configuration()
          Creates a new Configuration with the default properties loaded from the properties file.
Configuration(java.util.Properties defaultProperties)
          Instantiates a new configuration.
 
Method Summary
 java.lang.String get(java.lang.String key)
          Returns a String property with the given key.
 java.lang.String get(java.lang.String key, java.lang.String defaultValue)
          Returns a String property with the given key or given defaultValue if property with such key wasn't found.
 Authentication getAuthentication()
          Returns Authentication options for this crawl job.
 boolean getBoolean(java.lang.String key)
          Returns a boolean property with the given key.
 boolean getBoolean(java.lang.String key, boolean defaultValue)
          Returns a boolean property with the given key or given defaultValue if property with such key wasn't found.
 WorkTypeFiltersCollection getContentTypeFilters()
          Returns content-type filters for this crawl job.
 CrawlScopeFilter getCrawlScopeFilter()
          Returns CrawlScopeFilter for this crawl job.
 FollowLinksType getFollowLinks()
          Returns a value of follow links policy.
 int getInt(java.lang.String key)
          Returns a integer property with the given key.
 WorkTypeFiltersCollection getMetaTagFilters()
          Returns metatag filters for this crawl job.
 java.lang.Object getObject(java.lang.String name)
          Returns the value of the name property, or null if no such property exists.
 java.util.Set<Outlink> getSeeds()
          Returns the set of seeds for this crawl job.
 WorkTypeFiltersCollection getUrlFilters()
          Returns a set of URL filters for this crawl job.
 void loadConfiguration(WebSite webSite)
          Create a crawler configuration.
 void setContentTypeFilters(WorkTypeFiltersCollection filters)
          Assigns content-type filters for this crawl job.
 void setCrawlScopeFilter(CrawlScopeFilter scopeFilter)
          Assigns CrawlScopeFilter for this crawl job.
 void setFollowLinks(FollowLinksType links)
          Assigns a value for follow links policy.
 void setMetaTagFilters(WorkTypeFiltersCollection tagFilters)
          Assigns meta tag filters for this crawl job.
 void setObject(java.lang.String name, java.lang.Object value)
          Sets the value of the name property.
 void setUrlFilters(WorkTypeFiltersCollection filters)
          Assigns URL filters for this crawl job.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MILLIS_PER_SECOND

public static final int MILLIS_PER_SECOND
The Constant MILLIS_PER_SECOND.

See Also:
Constant Field Values
Constructor Detail

Configuration

public Configuration()
              throws java.io.IOException
Creates a new Configuration with the default properties loaded from the properties file.

Throws:
java.io.IOException - if there was a problem while loading default configuration file.

Configuration

public Configuration(java.util.Properties defaultProperties)
Instantiates a new configuration.

Parameters:
defaultProperties - the default properties
Method Detail

loadConfiguration

public void loadConfiguration(WebSite webSite)
                       throws java.lang.IllegalAccessException,
                              java.lang.reflect.InvocationTargetException
Create a crawler configuration.

Parameters:
webSite - is the DWebSite whose parameters must override default configuration parameters.
Throws:
java.lang.IllegalAccessException - .
java.lang.reflect.InvocationTargetException - .

get

public java.lang.String get(java.lang.String key)
Returns a String property with the given key.

Parameters:
key - a property key
Returns:
property value

get

public java.lang.String get(java.lang.String key,
                            java.lang.String defaultValue)
Returns a String property with the given key or given defaultValue if property with such key wasn't found.

Parameters:
key - a property key
defaultValue - default value to return if property wasn't set
Returns:
property value

getInt

public int getInt(java.lang.String key)
Returns a integer property with the given key.

Parameters:
key - a property key
Returns:
property value

getBoolean

public boolean getBoolean(java.lang.String key)
Returns a boolean property with the given key.

Parameters:
key - a property key
Returns:
property value

getBoolean

public boolean getBoolean(java.lang.String key,
                          boolean defaultValue)
Returns a boolean property with the given key or given defaultValue if property with such key wasn't found.

Parameters:
key - a property key
defaultValue - default value to return if property wasn't set
Returns:
property value

getObject

public java.lang.Object getObject(java.lang.String name)
Returns the value of the name property, or null if no such property exists.

Parameters:
name - object name
Returns:
object

setObject

public void setObject(java.lang.String name,
                      java.lang.Object value)
Sets the value of the name property.

Parameters:
name - object name
value - given object

getUrlFilters

public WorkTypeFiltersCollection getUrlFilters()
Returns a set of URL filters for this crawl job.

Returns:
WorkTypeFiltersCollection

setUrlFilters

public void setUrlFilters(WorkTypeFiltersCollection filters)
Assigns URL filters for this crawl job.

Parameters:
filters - WorkTypeFiltersCollection

getFollowLinks

public FollowLinksType getFollowLinks()
Returns a value of follow links policy.

Returns:
FollowLinksType

setFollowLinks

public void setFollowLinks(FollowLinksType links)
Assigns a value for follow links policy.

Parameters:
links - FollowLinksType

getSeeds

public java.util.Set<Outlink> getSeeds()
Returns the set of seeds for this crawl job.

Returns:
a set of Outlinks

getCrawlScopeFilter

public CrawlScopeFilter getCrawlScopeFilter()
Returns CrawlScopeFilter for this crawl job.

Returns:
CrawlScopeFilter

setCrawlScopeFilter

public void setCrawlScopeFilter(CrawlScopeFilter scopeFilter)
Assigns CrawlScopeFilter for this crawl job.

Parameters:
scopeFilter - CrawlScopeFilter

getMetaTagFilters

public WorkTypeFiltersCollection getMetaTagFilters()
Returns metatag filters for this crawl job.

Returns:
WorkTypeFiltersCollection meta tag filters

setMetaTagFilters

public void setMetaTagFilters(WorkTypeFiltersCollection tagFilters)
Assigns meta tag filters for this crawl job.

Parameters:
tagFilters - WorkTypeFiltersCollection meta tag filters

getContentTypeFilters

public WorkTypeFiltersCollection getContentTypeFilters()
Returns content-type filters for this crawl job.

Returns:
WorkTypeFiltersCollection meta tag filters

setContentTypeFilters

public void setContentTypeFilters(WorkTypeFiltersCollection filters)
Assigns content-type filters for this crawl job.

Parameters:
filters - WorkTypeFiltersCollection meta tag filters

getAuthentication

public Authentication getAuthentication()
Returns Authentication options for this crawl job.

Returns:
authentication value.

SMILA (incubation) API documentation