|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IncomingAttachment
Field Summary |
---|
Fields inherited from interface org.ws4d.java.attachment.Attachment |
---|
FILE_ATTACHMENT, MEMORY_ATTACHMENT, OUTPUTSTREAM_ATTACHMENT, STREAM_ATTACHMENT |
Method Summary | |
---|---|
byte[] |
getBytes()
Returns the raw data from this attachment as array of bytes. |
java.io.InputStream |
getInputStream()
Returns the input stream which contains the data. |
boolean |
isAvailable()
Returns true if this attachment is ready to be processed. |
long |
size()
Returns the size of the attachment in bytes. |
Methods inherited from interface org.ws4d.java.attachment.Attachment |
---|
dispose, getContentId, getContentType, getTransferEncoding, getType, serialize |
Method Detail |
---|
java.io.InputStream getInputStream() throws AttachmentException, java.io.IOException
Depending on the actual attachment implementation, this method may either
always return the same java.io.InputStream
instance, or it
could create a new one on each call. In the first case, it is important
to note that reading the attachment data might be possible only once, as
the returned stream is not guaranteed to support resetting (see
Attachment.getType()
.
AttachmentException
- if attachment processing is not supported
within the current runtime or obtaining the attachment failed
for any reason
java.io.IOException
- if reading raw attachment data failedAttachment.getType()
,
size()
,
getBytes()
boolean isAvailable()
true
if this attachment is ready to be processed.
Because the DPWS framework handles attachments asynchronously, it is
possible (and will most likely occur frequently) for an attachement's raw
data to still be being transmitted over the network while a caller's
business logic (e.g. the Operation.invoke(ParameterValue)
method)
gets called providing access to the attachment by means of its
parameters
. Using methods other
than Attachment.getContentId()
or isAvailable()
on this attachment
would block the caller until the entire attachment is read out. Thus,
this method allows to check whether further examination of this
attachment would block it or not.
true
, if this attachment is already available,
false
if it is still not received (entirely)long size() throws AttachmentException
Some types of attachment (e.g. InputStreamAttachment
) may not be
aware of their actual size; in such cases, this method will either return
zero or a potentially inaccurate estimate (as provided by
java.io.InputStream.available()
).
AttachmentException
- if attachment processing is not supported
within the current runtime or obtaining the attachment failed
for any reasonAttachment.getType()
,
getInputStream()
byte[] getBytes() throws AttachmentException, java.io.IOException
WARNING: The result can potentially use a large amount
of memory. Furthermore, some environments or some types of attachments
(see e.g. InputStreamAttachment
or FileAttachment
) may
not support representing the attachment's raw data as a byte array. In
these cases, a call to this method will cause an
AttachmentException
to get thrown (see Attachment.getType()
.
AttachmentException
- if attachment processing is not supported
within the current runtime or obtaining the attachment failed
for any reason or in particular, when this attachment type
doesn't support byte array access to its raw data
java.io.IOException
- if reading raw attachment data failedAttachment.getType()
,
getInputStream()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |