org.apache.nutch.collection

## Class Subcollection

- java.lang.Object
- - org.apache.hadoop.conf.Configured
  - - org.apache.nutch.collection.Subcollection

- All Implemented Interfaces:
    Configurable, URLFilter, Pluggable

      public class Subcollection
      extends Configured
      implements URLFilter

  SubCollection represents a subset of index, you can define url patterns that will indicate that particular page (url) is part of SubCollection.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `TAG_BLACKLIST`
    `static java.lang.String` | `TAG_COLLECTION`
    `static java.lang.String` | `TAG_COLLECTIONS`
    `static java.lang.String` | `TAG_ID`
    `static java.lang.String` | `TAG_KEY`
    `static java.lang.String` | `TAG_NAME`
    `static java.lang.String` | `TAG_WHITELIST`

    - ### Fields inherited from interface org.apache.nutch.net.URLFilter

      `X_POINT_ID`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Subcollection(Configuration conf)`
    `Subcollection(java.lang.String id, java.lang.String name, Configuration conf)` public Constructor
    `Subcollection(java.lang.String id, java.lang.String name, java.lang.String key, Configuration conf)` public Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `filter(java.lang.String urlString)` Simple "indexOf" currentFilter for matching patterns.
    `java.lang.String` | `getBlackListString()` Returns blacklist String
    `java.lang.String` | `getId()`
    `java.lang.String` | `getKey()`
    `java.lang.String` | `getName()`
    `java.util.List<java.lang.String>` | `getWhiteList()` Returns whitelist
    `java.lang.String` | `getWhiteListString()` Returns whitelist String
    `void` | `initialize(org.w3c.dom.Element collection)` Initialize Subcollection from dom element
    `protected void` | `parseList(java.util.List<java.lang.String> list, java.lang.String text)` Create a list of patterns from chunk of text, patterns are separated with newline
    `void` | `setBlackList(java.lang.String list)` Set contents of blacklist from String
    `void` | `setWhiteList(java.util.ArrayList<java.lang.String> whiteList)`
    `void` | `setWhiteList(java.lang.String list)` Set contents of whitelist from String

    - ### Methods inherited from class org.apache.hadoop.conf.Configured

      `getConf, setConf`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.hadoop.conf.Configurable

      `getConf, setConf`

- - ### Field Detail

    - #### TAG_COLLECTIONS

          public static final java.lang.String TAG_COLLECTIONS

      See Also:
        Constant Field Values

    - #### TAG_COLLECTION

          public static final java.lang.String TAG_COLLECTION

      See Also:
        Constant Field Values

    - #### TAG_WHITELIST

          public static final java.lang.String TAG_WHITELIST

      See Also:
        Constant Field Values

    - #### TAG_BLACKLIST

          public static final java.lang.String TAG_BLACKLIST

      See Also:
        Constant Field Values

    - #### TAG_NAME

          public static final java.lang.String TAG_NAME

      See Also:
        Constant Field Values

    - #### TAG_KEY

          public static final java.lang.String TAG_KEY

      See Also:
        Constant Field Values

    - #### TAG_ID

          public static final java.lang.String TAG_ID

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### Subcollection

          public Subcollection(java.lang.String id,
                               java.lang.String name,
                               Configuration conf)

      public Constructor
      Parameters:
        `id` - id of SubCollection
        `name` - name of SubCollection

    - #### Subcollection

          public Subcollection(java.lang.String id,
                               java.lang.String name,
                               java.lang.String key,
                               Configuration conf)

      public Constructor
      Parameters:
        `id` - id of SubCollection
        `name` - name of SubCollection

    - #### Subcollection

          public Subcollection(Configuration conf)

  - ### Method Detail

    - #### getName

          public java.lang.String getName()

      Returns:
        Returns the name

    - #### getKey

          public java.lang.String getKey()

      Returns:
        Returns the key

    - #### getId

          public java.lang.String getId()

      Returns:
        Returns the id

    - #### getWhiteList

          public java.util.List<java.lang.String> getWhiteList()

      Returns whitelist
      Returns:
        Whitelist entries

    - #### getWhiteListString

          public java.lang.String getWhiteListString()

      Returns whitelist String
      Returns:
        Whitelist String

    - #### getBlackListString

          public java.lang.String getBlackListString()

      Returns blacklist String
      Returns:
        Blacklist String

    - #### setWhiteList

          public void setWhiteList(java.util.ArrayList<java.lang.String> whiteList)

      Parameters:
        `whiteList` - The whiteList to set.

    - #### filter

          public java.lang.String filter(java.lang.String urlString)

      Simple "indexOf" currentFilter for matching patterns.

            rules for evaluation are as follows:
            1. if pattern matches in blacklist then url is rejected
            2. if pattern matches in whitelist then url is allowed
            3. url is rejected

      Specified by:
        `filter` in interface `URLFilter`
      See Also:
        `URLFilter.filter(java.lang.String)`

    - #### initialize

          public void initialize(org.w3c.dom.Element collection)

      Initialize Subcollection from dom element
      Parameters:
        `collection` -

    - #### parseList

          protected void parseList(java.util.List<java.lang.String> list,
                                   java.lang.String text)

      Create a list of patterns from chunk of text, patterns are separated with newline
      Parameters:
        `list` -
        `text` -

    - #### setBlackList

          public void setBlackList(java.lang.String list)

      Set contents of blacklist from String
      Parameters:
        `list` - the blacklist contents

    - #### setWhiteList

          public void setWhiteList(java.lang.String list)

      Set contents of whitelist from String
      Parameters:
        `list` - the whitelist contents

Copyright © 2019 The Apache Software Foundation