restart.server
Class ServiceOutput

java.lang.Object
  extended by restart.server.ServiceOutput
Direct Known Subclasses:
XMLServiceOutput

public class ServiceOutput
extends java.lang.Object

Class to describe the output of a service.

Author:
tducray

Field Summary
static java.lang.String HTTP_VER
           
 
Constructor Summary
ServiceOutput(ErrorCode errcode)
          Default constructor
ServiceOutput(RestException re)
           
 
Method Summary
 java.lang.String getContentEncoding()
          Get the content encoding
 java.lang.String getContentType()
          Get the content type (MIME)
 byte[] getData()
          Get the data
 ErrorCode getErrCode()
          Get the error code
 long getLength()
          Get the length of the data
 java.lang.String getTransferEncoding()
          Get the transfer encoding
 void setContentEncoding(java.lang.String contentEncoding)
          Set the content encoding
 void setData(long length, java.lang.String contentType, byte[] data)
          Set the data to be returned
 void setTransferEncoding(java.lang.String transferEncoding)
          Set the transfer encoding
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HTTP_VER

public static final java.lang.String HTTP_VER
See Also:
Constant Field Values
Constructor Detail

ServiceOutput

public ServiceOutput(ErrorCode errcode)
Default constructor

Parameters:
errcode - the returned error code (one of HTTP's error codes)

ServiceOutput

public ServiceOutput(RestException re)
Method Detail

setData

public void setData(long length,
                    java.lang.String contentType,
                    byte[] data)
Set the data to be returned

Parameters:
length - lehgth of the data
contentType - content type of the data (see MIME types)
data - the data

getErrCode

public ErrorCode getErrCode()
Get the error code

Returns:

getData

public byte[] getData()
Get the data

Returns:

getLength

public long getLength()
Get the length of the data

Returns:

getContentType

public java.lang.String getContentType()
Get the content type (MIME)

Returns:

getContentEncoding

public java.lang.String getContentEncoding()
Get the content encoding

Returns:

setContentEncoding

public void setContentEncoding(java.lang.String contentEncoding)
Set the content encoding

Parameters:
contentEncoding -

getTransferEncoding

public java.lang.String getTransferEncoding()
Get the transfer encoding

Returns:

setTransferEncoding

public void setTransferEncoding(java.lang.String transferEncoding)
Set the transfer encoding

Parameters:
contentEncoding -