org.apache.nutch.collection

## Class CollectionManager

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

- All Implemented Interfaces:
    Configurable

      public class CollectionManager
      extends Configured

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `DEFAULT_FILE_NAME`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `CollectionManager()` Used for testing
    `` | `CollectionManager(Configuration conf)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Subcollection` | `createSubCollection(java.lang.String id, java.lang.String name)` Create a new subcollection.
    `void` | `deleteSubCollection(java.lang.String id)` Delete named subcollection
    `java.util.Collection` | `getAll()` Returns all collections
    `static CollectionManager` | `getCollectionManager(Configuration conf)`
    `Subcollection` | `getSubColection(java.lang.String id)` Returns named subcollection
    `java.util.List<Subcollection>` | `getSubCollections(java.lang.String url)` Return names of collections url is part of
    `protected void` | `init()`
    `protected void` | `parse(java.io.InputStream input)`
    `void` | `save()` Save collections into file

    - ### 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`

- - ### Field Detail

    - #### DEFAULT_FILE_NAME

          public static final java.lang.String DEFAULT_FILE_NAME

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### CollectionManager

          public CollectionManager(Configuration conf)

    - #### CollectionManager

          protected CollectionManager()

      Used for testing

  - ### Method Detail

    - #### init

          protected void init()

    - #### parse

          protected void parse(java.io.InputStream input)

    - #### getCollectionManager

          public static CollectionManager getCollectionManager(Configuration conf)

    - #### getSubColection

          public Subcollection getSubColection(java.lang.String id)

      Returns named subcollection
      Parameters:
        `id` -
      Returns:
        Named SubCollection (or null if not existing)

    - #### deleteSubCollection

          public void deleteSubCollection(java.lang.String id)
                                   throws java.io.IOException

      Delete named subcollection
      Parameters:
        `id` - Id of SubCollection to delete
      Throws:
        `java.io.IOException`

    - #### createSubCollection

          public Subcollection createSubCollection(java.lang.String id,
                                                   java.lang.String name)

      Create a new subcollection.
      Parameters:
        `name` - Name of SubCollection to create
      Returns:
        Created SubCollection or null if allready existed

    - #### getSubCollections

          public java.util.List<Subcollection> getSubCollections(java.lang.String url)

      Return names of collections url is part of
      Parameters:
        `url` - The url to test against Collections
      Returns:
        Subcollections

    - #### getAll

          public java.util.Collection getAll()

      Returns all collections
      Returns:
        All collections CollectionManager knows about

    - #### save

          public void save()
                    throws java.io.IOException

      Save collections into file
      Throws:
        `java.io.IOException`

Copyright © 2019 The Apache Software Foundation