org.jets3t.service.impl.rest
Class CloudFrontXmlResponsesSaxParser

java.lang.Object
  extended by org.jets3t.service.impl.rest.CloudFrontXmlResponsesSaxParser

public class CloudFrontXmlResponsesSaxParser
extends java.lang.Object

XML Sax parser to read XML documents returned by the CloudFront service via the REST interface, and convert these documents into JetS3t objects.

Author:
James Murty

Nested Class Summary
 class CloudFrontXmlResponsesSaxParser.DistributionConfigHandler
           
 class CloudFrontXmlResponsesSaxParser.DistributionHandler
           
 class CloudFrontXmlResponsesSaxParser.DistributionSummaryHandler
           
 class CloudFrontXmlResponsesSaxParser.ErrorHandler
           
 class CloudFrontXmlResponsesSaxParser.ListDistributionListHandler
           
 class CloudFrontXmlResponsesSaxParser.OriginAccessIdentityConfigHandler
           
 class CloudFrontXmlResponsesSaxParser.OriginAccessIdentityHandler
           
 class CloudFrontXmlResponsesSaxParser.OriginAccessIdentityListHandler
           
 class CloudFrontXmlResponsesSaxParser.SimpleHandler
           
 
Constructor Summary
CloudFrontXmlResponsesSaxParser(Jets3tProperties properties)
          Constructs the XML SAX parser.
 
Method Summary
 CloudFrontXmlResponsesSaxParser.DistributionConfigHandler parseDistributionConfigResponse(java.io.InputStream inputStream)
           
 CloudFrontXmlResponsesSaxParser.ListDistributionListHandler parseDistributionListResponse(java.io.InputStream inputStream)
          Parses a ListBucket response XML document from an input stream.
 CloudFrontXmlResponsesSaxParser.DistributionHandler parseDistributionResponse(java.io.InputStream inputStream)
           
 CloudFrontXmlResponsesSaxParser.ErrorHandler parseErrorResponse(java.io.InputStream inputStream)
           
 CloudFrontXmlResponsesSaxParser.OriginAccessIdentityHandler parseOriginAccessIdentity(java.io.InputStream inputStream)
           
 CloudFrontXmlResponsesSaxParser.OriginAccessIdentityConfigHandler parseOriginAccessIdentityConfig(java.io.InputStream inputStream)
           
 CloudFrontXmlResponsesSaxParser.OriginAccessIdentityListHandler parseOriginAccessIdentityListResponse(java.io.InputStream inputStream)
           
protected  void parseXmlInputStream(org.xml.sax.helpers.DefaultHandler handler, java.io.InputStream inputStream)
          Parses an XML document from an input stream using a document handler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CloudFrontXmlResponsesSaxParser

public CloudFrontXmlResponsesSaxParser(Jets3tProperties properties)
                                throws S3ServiceException
Constructs the XML SAX parser.

Parameters:
properties - the JetS3t properties that will be applied when parsing XML documents.
Throws:
S3ServiceException
Method Detail

parseXmlInputStream

protected void parseXmlInputStream(org.xml.sax.helpers.DefaultHandler handler,
                                   java.io.InputStream inputStream)
                            throws CloudFrontServiceException
Parses an XML document from an input stream using a document handler.

Parameters:
handler - the handler for the XML document
inputStream - an input stream containing the XML document to parse
Throws:
S3ServiceException - any parsing, IO or other exceptions are wrapped in an S3ServiceException.
CloudFrontServiceException

parseDistributionListResponse

public CloudFrontXmlResponsesSaxParser.ListDistributionListHandler parseDistributionListResponse(java.io.InputStream inputStream)
                                                                                          throws CloudFrontServiceException
Parses a ListBucket response XML document from an input stream.

Parameters:
inputStream - XML data input stream.
Returns:
the XML handler object populated with data parsed from the XML stream.
Throws:
S3ServiceException
CloudFrontServiceException

parseDistributionResponse

public CloudFrontXmlResponsesSaxParser.DistributionHandler parseDistributionResponse(java.io.InputStream inputStream)
                                                                              throws CloudFrontServiceException
Throws:
CloudFrontServiceException

parseDistributionConfigResponse

public CloudFrontXmlResponsesSaxParser.DistributionConfigHandler parseDistributionConfigResponse(java.io.InputStream inputStream)
                                                                                          throws CloudFrontServiceException
Throws:
CloudFrontServiceException

parseOriginAccessIdentity

public CloudFrontXmlResponsesSaxParser.OriginAccessIdentityHandler parseOriginAccessIdentity(java.io.InputStream inputStream)
                                                                                      throws CloudFrontServiceException
Throws:
CloudFrontServiceException

parseOriginAccessIdentityConfig

public CloudFrontXmlResponsesSaxParser.OriginAccessIdentityConfigHandler parseOriginAccessIdentityConfig(java.io.InputStream inputStream)
                                                                                                  throws CloudFrontServiceException
Throws:
CloudFrontServiceException

parseOriginAccessIdentityListResponse

public CloudFrontXmlResponsesSaxParser.OriginAccessIdentityListHandler parseOriginAccessIdentityListResponse(java.io.InputStream inputStream)
                                                                                                      throws CloudFrontServiceException
Throws:
CloudFrontServiceException

parseErrorResponse

public CloudFrontXmlResponsesSaxParser.ErrorHandler parseErrorResponse(java.io.InputStream inputStream)
                                                                throws CloudFrontServiceException
Throws:
CloudFrontServiceException