Package org.jclouds.io.payloads
Class BasePayload<V>
- java.lang.Object
-
- org.jclouds.io.payloads.BasePayload<V>
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Payload
- Direct Known Subclasses:
ApacheHCUtils.HttpEntityPayload
,ByteArrayPayload
,ByteSourcePayload
,ChunkedUploadPayload
,FilePayload
,InputStreamPayload
,MultipartForm
,PhantomPayload
,StringPayload
,UrlEncodedFormPayload
public abstract class BasePayload<V> extends Object implements Payload
-
-
Field Summary
Fields Modifier and Type Field Description protected V
content
protected MutableContentMetadata
contentMetadata
protected boolean
written
-
Constructor Summary
Constructors Modifier Constructor Description protected
BasePayload(V content)
protected
BasePayload(V content, MutableContentMetadata contentMetadata)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Delegates to release()boolean
equals(Object obj)
MutableContentMetadata
getContentMetadata()
InputStream
getInput()
Creates a new InputStream object of the payload.V
getRawContent()
Payload in its original form.int
hashCode()
boolean
isRepeatable()
By default we are repeatable.boolean
isSensitive()
Returns whether the payload contains sensitive information.void
release()
By default there are no resources to release.void
setContentMetadata(MutableContentMetadata in)
void
setSensitive(boolean isSensitive)
Sets whether the payload contains sensitive information.String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.jclouds.io.Payload
openStream
-
-
-
-
Field Detail
-
content
protected final V content
-
written
protected transient volatile boolean written
-
contentMetadata
protected MutableContentMetadata contentMetadata
-
-
Constructor Detail
-
BasePayload
protected BasePayload(V content)
-
BasePayload
protected BasePayload(V content, MutableContentMetadata contentMetadata)
-
-
Method Detail
-
getInput
public InputStream getInput()
Description copied from interface:Payload
Creates a new InputStream object of the payload.
-
getRawContent
public V getRawContent()
Payload in its original form.- Specified by:
getRawContent
in interfacePayload
-
isRepeatable
public boolean isRepeatable()
By default we are repeatable.- Specified by:
isRepeatable
in interfacePayload
-
release
public void release()
By default there are no resources to release.
-
close
public void close()
Delegates to release()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
getContentMetadata
public MutableContentMetadata getContentMetadata()
- Specified by:
getContentMetadata
in interfacePayload
-
setContentMetadata
public void setContentMetadata(MutableContentMetadata in)
- Specified by:
setContentMetadata
in interfacePayload
-
setSensitive
public void setSensitive(boolean isSensitive)
Description copied from interface:Payload
Sets whether the payload contains sensitive information. This is used when trying to decide whether to print out the payload information or not in logs- Specified by:
setSensitive
in interfacePayload
-
isSensitive
public boolean isSensitive()
Description copied from interface:Payload
Returns whether the payload contains sensitive information. This is used when trying to decide whether to print out the payload information or not in logs- Specified by:
isSensitive
in interfacePayload
-
-