opendap.crawler
Class ThreddsCatalogUtil.ThreddsCrawlerEnumeration

java.lang.Object
  extended by opendap.crawler.ThreddsCatalogUtil.ThreddsCrawlerEnumeration
All Implemented Interfaces:
java.util.Enumeration<java.lang.String>
Enclosing class:
ThreddsCatalogUtil

public class ThreddsCatalogUtil.ThreddsCrawlerEnumeration
extends java.lang.Object
implements java.util.Enumeration<java.lang.String>

Implements a modified depth-first traversal of a thredds catalog. The catalog is treated as a tree-like structure, but since it is really a directed graph, catalog URLs are cached and the same URL is neither returned nor 'crawled' twice. The traversal is like a depth-first traversal, but instead of recurring all the way to the leaf nodes of the pseudo-tree, it descends as it returns nodes. The seed URL is used to initialize the stack of child nodes and then nextElement() both returns the top node and visits that node, pushing all of its URLs onto the stack. This limits the HTTP accesses to at most one-per nextElement call.

Author:
jimg

Method Summary
 boolean hasMoreElements()
           
 java.lang.String nextElement()
           
 void saveState()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

hasMoreElements

public boolean hasMoreElements()
Specified by:
hasMoreElements in interface java.util.Enumeration<java.lang.String>

nextElement

public java.lang.String nextElement()
Specified by:
nextElement in interface java.util.Enumeration<java.lang.String>

saveState

public void saveState()
               throws java.lang.Exception
Throws:
java.lang.Exception