Class GlobalCrawlerTrapList


  • public class GlobalCrawlerTrapList
    extends java.lang.Object
    Class representing one or more global crawler traps, modeled as a set of regular expressions.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected GlobalCrawlerTrapList​(int id, java.util.List<java.lang.String> traps, java.lang.String name, java.lang.String description, boolean isActive)
      Protected constructor used by the DAO to create instances of this class.
        GlobalCrawlerTrapList​(java.io.InputStream is, java.lang.String name, java.lang.String description, boolean isActive)
      Construct a new GlobalCrawlerTrapList from an input stream consisting of newline-separated regular expressions.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      java.lang.String getDescription()
      Get the description of this list.
      int getId()
      Get the id of this list.
      java.lang.String getName()
      Get the name of the list.
      java.util.Set<java.lang.String> getTraps()
      Get the trap expressions for this list.
      int hashCode()  
      boolean isActive()
      Returns true if this list is active.
      void setActive​(boolean active)
      Set the activity state of the list.
      void setDescription​(java.lang.String description)
      Set the description of this list.
      protected void setId​(int id)
      Set the id of this list.
      void setName​(java.lang.String name)
      Set the name of the list.
      void setTraps​(java.util.Set<java.lang.String> traps)
      Set the trap expressions for this list.
      void setTrapsFromInputStream​(java.io.InputStream is, java.lang.String listName)
      A utility method to read the list of traps from an InputStream, line-by-line.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GlobalCrawlerTrapList

        protected GlobalCrawlerTrapList​(int id,
                                        java.util.List<java.lang.String> traps,
                                        java.lang.String name,
                                        java.lang.String description,
                                        boolean isActive)
                                 throws ArgumentNotValid
        Protected constructor used by the DAO to create instances of this class.
        Parameters:
        id - the id of this list.
        name - a name by which this list is known.
        traps - the set of trap expressions.
        description - A textual description of this list (may be null).
        isActive - flag indicating whether this list is isActive.
        Throws:
        ArgumentNotValid - if the name is empty or null
      • GlobalCrawlerTrapList

        public GlobalCrawlerTrapList​(java.io.InputStream is,
                                     java.lang.String name,
                                     java.lang.String description,
                                     boolean isActive)
                              throws IOFailure,
                                     ArgumentNotValid
        Construct a new GlobalCrawlerTrapList from an input stream consisting of newline-separated regular expressions.
        Parameters:
        is - an input stream from which the list of trap expressions can be read.
        name - a name by which this list is known.
        description - A textual description of this list.
        isActive - flag indicating whether this list is isActive.
        Throws:
        IOFailure - if the input stream cannot be found or read.
        ArgumentNotValid - if the input stream is null, the name is null or empty, or the list contains invalid expressions
    • Method Detail

      • setTrapsFromInputStream

        public void setTrapsFromInputStream​(java.io.InputStream is,
                                            java.lang.String listName)
                                     throws ArgumentNotValid
        A utility method to read the list of traps from an InputStream, line-by-line.
        Parameters:
        is - The input stream from which to read.
        listName - the name of the list being constructed
        Throws:
        IOFailure - if the input stream cannot be read.
        ArgumentNotValid - if the input stream is null or if any of the specified traps are not valid regular expressions and valid XML
      • getId

        public int getId()
        Get the id of this list.
        Returns:
        the id.
      • setId

        protected void setId​(int id)
        Set the id of this list.
        Parameters:
        id - the id.
      • getName

        public java.lang.String getName()
        Get the name of the list.
        Returns:
        the name.
      • setName

        public void setName​(java.lang.String name)
        Set the name of the list.
        Parameters:
        name - the name.
      • getTraps

        public java.util.Set<java.lang.String> getTraps()
        Get the trap expressions for this list.
        Returns:
        the trap expressions.
      • setTraps

        public void setTraps​(java.util.Set<java.lang.String> traps)
        Set the trap expressions for this list.
        Parameters:
        traps - the trap expressions.
      • getDescription

        public java.lang.String getDescription()
        Get the description of this list.
        Returns:
        the description.
      • setDescription

        public void setDescription​(java.lang.String description)
        Set the description of this list.
        Parameters:
        description - the description.
      • isActive

        public boolean isActive()
        Returns true if this list is active.
        Returns:
        the activity state of the list.
      • setActive

        public void setActive​(boolean active)
        Set the activity state of the list.
        Parameters:
        active - the activity state.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object