org.jclouds.aws.ec2.xml
Class BaseAWSReservationHandler<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.aws.ec2.xml.BaseAWSReservationHandler<T>
All Implemented Interfaces:
InvocationContext<ParseSax.HandlerWithResult<T>>, ContentHandler, DTDHandler, EntityResolver, ErrorHandler
Direct Known Subclasses:
AWSDescribeInstancesResponseHandler, AWSRunInstancesResponseHandler

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

Author:
Adrian Cole

Field Summary
protected  AWSRunningInstance.Builder builder
           
protected  com.google.inject.Provider<AWSRunningInstance.Builder> builderProvider
           
protected  StringBuilder currentText
           
protected  DateService dateService
           
protected  com.google.common.base.Supplier<String> defaultRegion
           
protected  int depth
           
protected  int itemDepth
           
protected  Logger logger
           
 
Constructor Summary
BaseAWSReservationHandler(DateService dateService, com.google.common.base.Supplier<String> defaultRegion, com.google.inject.Provider<AWSRunningInstance.Builder> builderProvider)
           
 
Method Summary
 void characters(char[] ch, int start, int length)
           
 void endElement(String uri, String name, String qName)
           
protected abstract  boolean endOfInstanceItem()
           
protected  void inItem()
           
protected  Reservation<? extends RunningInstance> newReservation()
           
protected  Date parseDate()
           
protected  void refineBuilderBeforeAddingInstance()
           
 void startElement(String uri, String localName, 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<AWSRunningInstance.Builder> builderProvider

currentText

protected StringBuilder currentText

builder

protected AWSRunningInstance.Builder builder

itemDepth

protected int itemDepth

depth

protected int depth
Constructor Detail

BaseAWSReservationHandler

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

startElement

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

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()

endOfInstanceItem

protected abstract 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.