org.jclouds.s3.xml
Class LocationConstraintHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.jclouds.http.functions.ParseSax.HandlerWithResult<String>
          extended by org.jclouds.s3.xml.LocationConstraintHandler
All Implemented Interfaces:
org.jclouds.rest.InvocationContext<org.jclouds.http.functions.ParseSax.HandlerWithResult<String>>, ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class LocationConstraintHandler
extends org.jclouds.http.functions.ParseSax.HandlerWithResult<String>

Parses the response from Amazon S3 GET Bucket Location

Region is the document we expect to parse.

See Also:

Constructor Summary
LocationConstraintHandler(com.google.common.cache.LoadingCache<String,com.google.common.base.Optional<String>> bucketToRegion)
           
 
Method Summary
 void characters(char[] ch, int start, int length)
           
 void endElement(String uri, String name, String qName)
           
static String fromValue(String v)
          parses the value expected in xml documents from the S3 service.=

US_STANDARD is returned as "" xml documents.

 String getResult()
           
 LocationConstraintHandler setContext(org.jclouds.http.HttpRequest request)
           
 
Methods inherited from class org.jclouds.http.functions.ParseSax.HandlerWithResult
getRequest
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocationConstraintHandler

@Inject
public LocationConstraintHandler(com.google.common.cache.LoadingCache<String,com.google.common.base.Optional<String>> bucketToRegion)
Method Detail

getResult

public String getResult()
Specified by:
getResult in class org.jclouds.http.functions.ParseSax.HandlerWithResult<String>

endElement

public void endElement(String uri,
                       String name,
                       String qName)
Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class DefaultHandler

setContext

public LocationConstraintHandler setContext(org.jclouds.http.HttpRequest request)
Specified by:
setContext in interface org.jclouds.rest.InvocationContext<org.jclouds.http.functions.ParseSax.HandlerWithResult<String>>
Overrides:
setContext in class org.jclouds.http.functions.ParseSax.HandlerWithResult<String>

fromValue

public static String fromValue(String v)
parses the value expected in xml documents from the S3 service.=

US_STANDARD is returned as "" xml documents.


characters

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


Copyright © 2009-2014 The Apache Software Foundation. All Rights Reserved.