org.javaswift.joss.instructions
Class UploadPayload

java.lang.Object
  extended by org.javaswift.joss.instructions.UploadPayload
Direct Known Subclasses:
UploadPayloadByteArray, UploadPayloadFile, UploadPayloadInputStream

public abstract class UploadPayload
extends Object

Encapsulates the payload that must be uploaded to the ObjectStore. The reason this class exists is that it can support in giving information on the payload.

Author:
Robert Bor

Constructor Summary
UploadPayload()
           
 
Method Summary
abstract  org.apache.http.HttpEntity getEntity()
          Returns the payload as an HttpEntity, so it can be uploaded to the ObjectStore
abstract  Etag getEtag()
          Returns the MD5 hash value in an Etag header
abstract  SegmentationPlan getSegmentationPlan(Long segmentationSize)
          Sets up the plan to upload the payload in segments
abstract  boolean mustBeSegmented(Long segmentationSize)
          Checks whether the payload must be segmented into two or more separate objects to circumvent the max object size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UploadPayload

public UploadPayload()
Method Detail

getEntity

public abstract org.apache.http.HttpEntity getEntity()
Returns the payload as an HttpEntity, so it can be uploaded to the ObjectStore

Returns:
HttpEntity of the payload

mustBeSegmented

public abstract boolean mustBeSegmented(Long segmentationSize)
Checks whether the payload must be segmented into two or more separate objects to circumvent the max object size

Parameters:
segmentationSize - size to check the current payload size against
Returns:
true if the payload must be segmented

getEtag

public abstract Etag getEtag()
                      throws IOException
Returns the MD5 hash value in an Etag header

Returns:
Etag header with MD5 hash
Throws:
IOException

getSegmentationPlan

public abstract SegmentationPlan getSegmentationPlan(Long segmentationSize)
                                              throws IOException
Sets up the plan to upload the payload in segments

Parameters:
segmentationSize - the size of an individual segment
Returns:
the segmentation plan
Throws:
IOException


Copyright © 2012-2014 42 BV. All Rights Reserved.