org.jclouds.atmos.functions
Class ParseObjectFromHeadersAndHttpContent

java.lang.Object
  extended by org.jclouds.atmos.functions.ParseObjectFromHeadersAndHttpContent
All Implemented Interfaces:
com.google.common.base.Function<HttpResponse,AtmosObject>, InvocationContext<ParseObjectFromHeadersAndHttpContent>

public class ParseObjectFromHeadersAndHttpContent
extends Object
implements com.google.common.base.Function<HttpResponse,AtmosObject>, InvocationContext<ParseObjectFromHeadersAndHttpContent>

Parses response headers and creates a new AtmosObject from them and the HTTP content.

Author:
Adrian Cole
See Also:
ParseMetadataFromHeaders

Constructor Summary
ParseObjectFromHeadersAndHttpContent(ParseSystemMetadataFromHeaders systemMetadataParser, ParseUserMetadataFromHeaders userMetadataParser, AtmosObject.Factory objectProvider)
           
 
Method Summary
 AtmosObject apply(HttpResponse from)
          First, calls ParseSystemAndUserMetadataFromHeaders.
 ParseObjectFromHeadersAndHttpContent setContext(HttpRequest request)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.google.common.base.Function
equals
 

Constructor Detail

ParseObjectFromHeadersAndHttpContent

@Inject
public ParseObjectFromHeadersAndHttpContent(ParseSystemMetadataFromHeaders systemMetadataParser,
                                                   ParseUserMetadataFromHeaders userMetadataParser,
                                                   AtmosObject.Factory objectProvider)
Method Detail

apply

public AtmosObject apply(HttpResponse from)
First, calls ParseSystemAndUserMetadataFromHeaders. Then, sets the object size based on the Content-Length header and adds the content to the AtmosObject result.

Specified by:
apply in interface com.google.common.base.Function<HttpResponse,AtmosObject>
Throws:
HttpException

setContext

public ParseObjectFromHeadersAndHttpContent setContext(HttpRequest request)
Specified by:
setContext in interface InvocationContext<ParseObjectFromHeadersAndHttpContent>


Copyright © 2009-2011 jclouds. All Rights Reserved.