Esri Geoportal Server
1.2.9

com.esri.gpt.control.webharvest
Class DefaultIterationContext

java.lang.Object
  extended by com.esri.gpt.control.webharvest.DefaultIterationContext
All Implemented Interfaces:
IterationContext

public class DefaultIterationContext
extends Object
implements IterationContext

Default iteration context.


Nested Class Summary
static class DefaultIterationContext.ExceptionInfo
          Exception information.
 
Field Summary
protected  Bots bots
           
protected static SimpleDateFormat DF
           
protected  LinkedList<DefaultIterationContext.ExceptionInfo> exceptionInfos
           
 
Constructor Summary
DefaultIterationContext(Bots robotsTxt)
          Creates instance with robots information.
 
Method Summary
 void assertAccess(String url)
          Asserts access to the resource referenced by the url
 LinkedList<DefaultIterationContext.ExceptionInfo> getExceptionInfos()
          Gets exception infos.
 Bots getRobotsTxt()
          Gets RobotsTxt if available.
 HttpClientRequest newHttpClientRequest()
          Factory method to create instance of HttpClientRequest
 void onIterationException(Exception ex)
          Provides a way to capture exception which cannot be re-thrown.
 void registerException(Exception ex)
          Registers an exception.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DF

protected static SimpleDateFormat DF

exceptionInfos

protected final LinkedList<DefaultIterationContext.ExceptionInfo> exceptionInfos

bots

protected final Bots bots
Constructor Detail

DefaultIterationContext

public DefaultIterationContext(Bots robotsTxt)
Creates instance with robots information.

Parameters:
robotsTxt - robots information or null if no robots information available
Method Detail

onIterationException

public void onIterationException(Exception ex)
Description copied from interface: IterationContext
Provides a way to capture exception which cannot be re-thrown. Both methods Iterator.hasNext() and Iterator.next() don't allow to throw any checked exception even if an implementation actually should throw it.

Specified by:
onIterationException in interface IterationContext

toString

public String toString()
Overrides:
toString in class Object

getExceptionInfos

public LinkedList<DefaultIterationContext.ExceptionInfo> getExceptionInfos()
Gets exception infos.

Returns:
linked list of all registered exception infos.

registerException

public void registerException(Exception ex)
Registers an exception.

Parameters:
ex - exception

newHttpClientRequest

public HttpClientRequest newHttpClientRequest()
Description copied from interface: IterationContext
Factory method to create instance of HttpClientRequest

Specified by:
newHttpClientRequest in interface IterationContext
Returns:
instance of HttpClientRequest

assertAccess

public void assertAccess(String url)
                  throws AccessException
Description copied from interface: IterationContext
Asserts access to the resource referenced by the url

Specified by:
assertAccess in interface IterationContext
Parameters:
url - url of the resource
Throws:
AccessException - if access denied

getRobotsTxt

public Bots getRobotsTxt()
Description copied from interface: IterationContext
Gets RobotsTxt if available.

Specified by:
getRobotsTxt in interface IterationContext
Returns:
instance of robots txt or null if robots txt unavailable.

Esri Geoportal Server
1.2.9

Copyright 2011 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.