org.idoox.transport
Class OutputMessageWrapper

java.lang.Object
  extended byjava.io.OutputStream
      extended byorg.idoox.transport.OutputMessage
          extended byorg.idoox.transport.RawOutputMessage
              extended byorg.idoox.transport.OutputMessageWrapper
All Implemented Interfaces:
Message

public class OutputMessageWrapper
extends RawOutputMessage

Output message wrapper. This class is useful for interceptor implementation which needs wrap another output message.

Component:
Core

Field Summary
 
Fields inherited from class org.idoox.transport.RawOutputMessage
isInited
 
Fields inherited from interface org.idoox.transport.Message
CT_APPLICATION_DIME, CT_MULTIPART_ALTERNATIVE, CT_MULTIPART_MIXED, CT_MULTIPART_RELATED, CT_MUTLIPART_FORMDATA, SC_ACCEPTED, SC_BAD_MESSAGE, SC_CREATED, SC_FORBIDDEN, SC_INTERNAL_ERROR, SC_METHOD_NOT_ALLOWED, SC_NO_CONTENT, SC_NOT_FOUND, SC_OK, SC_PROTOCOL_NOT_SUPPORTED, SC_REQUEST_TIMEOUT, SC_SERVICE_UNAVAILABLE, SC_SOAP_ACTION_REQUIRED, SC_UNAUTHORIZED, SC_UNSUPPORTED_MEDIA_TYPE
 
Constructor Summary
OutputMessageWrapper(OutputMessage message)
          Creates new output message wrapper.
 
Method Summary
 OutputMessage getWrappedMessage()
          Gets a wrapped output message.
 void nextPart()
          Calls next part on the wrapped message.
 void setContentType(java.lang.String type)
          Sets a content type on the wrapped message.
 void setCorrupted()
          This is not a stable part of SSJ's public API, for internal use only!
 void setDateHeader(java.lang.String name, long value)
          Sets a date header on the wrapped message.
 void setIntHeader(java.lang.String name, int value)
          Sets an int header on the wrapped message.
 void setMultipartType(java.lang.String type)
          Sets a multipart type on the wrapped message.
 void setStatusCode(int sc)
          Sets a status code on the wrapped message.
 void setStringHeader(java.lang.String name, java.lang.String value)
          Sets a string header on the wrapped message.
 void setWrappedMessage(OutputMessage message)
          Sets new wrapped output message.
 
Methods inherited from class org.idoox.transport.RawOutputMessage
close, flush, getWrappedStream, initStream, setWrappedStream, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OutputMessageWrapper

public OutputMessageWrapper(OutputMessage message)
Creates new output message wrapper.

Parameters:
message - wrapped message
Method Detail

setWrappedMessage

public void setWrappedMessage(OutputMessage message)
Sets new wrapped output message.

Parameters:
message - wrapped message

getWrappedMessage

public OutputMessage getWrappedMessage()
Gets a wrapped output message.

Returns:
wrapped message

setStatusCode

public void setStatusCode(int sc)
Sets a status code on the wrapped message.

Specified by:
setStatusCode in class OutputMessage
Parameters:
sc - the status code

setContentType

public void setContentType(java.lang.String type)
Sets a content type on the wrapped message.

Overrides:
setContentType in class OutputMessage
Parameters:
type - the MIME type

setStringHeader

public void setStringHeader(java.lang.String name,
                            java.lang.String value)
Sets a string header on the wrapped message.

Specified by:
setStringHeader in class OutputMessage
Parameters:
name - the header name
value - the value of the message header

setIntHeader

public void setIntHeader(java.lang.String name,
                         int value)
Sets an int header on the wrapped message.

Overrides:
setIntHeader in class OutputMessage
Parameters:
name - the header name
value - the value of the message header

setDateHeader

public void setDateHeader(java.lang.String name,
                          long value)
Sets a date header on the wrapped message.

Overrides:
setDateHeader in class OutputMessage
Parameters:
name - the name of the header
value - the number of milliseconds since January 1, 1970 GMT

setMultipartType

public void setMultipartType(java.lang.String type)
                      throws java.io.IOException
Sets a multipart type on the wrapped message.

Overrides:
setMultipartType in class OutputMessage
Parameters:
type - mutlipart type or null if this message isn't multiparted
Throws:
java.io.IOException - if an I/O error occurs

nextPart

public void nextPart()
              throws java.io.IOException
Calls next part on the wrapped message.

Overrides:
nextPart in class OutputMessage
Throws:
java.io.IOException - if an I/O error occurs

setCorrupted

public void setCorrupted()
Description copied from class: OutputMessage
This is not a stable part of SSJ's public API, for internal use only!

Marks that the upper layer aborted writing of the message and so the written data are corrupted and/or incomplete.

Overrides:
setCorrupted in class OutputMessage