org.jclouds.ec2.xml
Class BaseReservationHandler<T>

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.jclouds.http.functions.ParseSax.HandlerWithResult<T>
          extended by org.jclouds.http.functions.ParseSax.HandlerForGeneratedRequestWithResult<T>
              extended by org.jclouds.ec2.xml.BaseReservationHandler<T>
All Implemented Interfaces:
InvocationContext<ParseSax.HandlerWithResult<T>>, ContentHandler, DTDHandler, EntityResolver, ErrorHandler
Direct Known Subclasses:
DescribeInstancesResponseHandler, RunInstancesResponseHandler

public abstract class BaseReservationHandler<T>
extends ParseSax.HandlerForGeneratedRequestWithResult<T>

Author:
Adrian Cole

Field Summary
protected  RunningInstance.Builder builder
           
protected  com.google.inject.Provider<RunningInstance.Builder> builderProvider
           
protected  StringBuilder currentText
           
protected  DateService dateService
           
protected  com.google.common.base.Supplier<String> defaultRegion
           
protected  int itemDepth
           
protected  Logger logger
           
 
Constructor Summary
BaseReservationHandler(DateService dateService, com.google.common.base.Supplier<String> defaultRegion, com.google.inject.Provider<RunningInstance.Builder> builderProvider)
           
 
Method Summary
protected  RunningInstance.Builder builder()
           
 void characters(char[] ch, int start, int length)
           
 void endElement(String uri, String name, String qName)
           
protected  boolean endOfInstanceItem()
           
protected  void inItem()
           
protected  Reservation<? extends RunningInstance> newReservation()
           
protected  Date parseDate()
           
protected  void refineBuilderBeforeAddingInstance()
           
 void startElement(String uri, String name, String qName, Attributes attrs)
           
 
Methods inherited from class org.jclouds.http.functions.ParseSax.HandlerForGeneratedRequestWithResult
getRequest, setContext
 
Methods inherited from class org.jclouds.http.functions.ParseSax.HandlerWithResult
getResult
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected Logger logger

dateService

protected final DateService dateService

defaultRegion

protected final com.google.common.base.Supplier<String> defaultRegion

builderProvider

protected final com.google.inject.Provider<RunningInstance.Builder> builderProvider

currentText

protected StringBuilder currentText

builder

protected RunningInstance.Builder builder

itemDepth

protected int itemDepth
Constructor Detail

BaseReservationHandler

@Inject
public BaseReservationHandler(DateService dateService,
                                     com.google.common.base.Supplier<String> defaultRegion,
                                     com.google.inject.Provider<RunningInstance.Builder> builderProvider)
Method Detail

startElement

public void startElement(String uri,
                         String name,
                         String qName,
                         Attributes attrs)
Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler

endElement

public void endElement(String uri,
                       String name,
                       String qName)
Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler

parseDate

protected Date parseDate()

inItem

protected void inItem()

refineBuilderBeforeAddingInstance

protected void refineBuilderBeforeAddingInstance()

builder

protected RunningInstance.Builder builder()

endOfInstanceItem

protected boolean endOfInstanceItem()

characters

public void characters(char[] ch,
                       int start,
                       int length)
Specified by:
characters in interface ContentHandler
Overrides:
characters in class org.xml.sax.helpers.DefaultHandler

newReservation

protected Reservation<? extends RunningInstance> newReservation()


Copyright © 2009-2012 jclouds. All Rights Reserved.