EAF 7.6 Implementation

com.lutris.appserver.server.httpPresentation
Class HttpSerialized

java.lang.Object
  extended by com.lutris.appserver.server.httpPresentation.HttpSerialized

public class HttpSerialized
extends java.lang.Object

This class provides two utility methods for presentation objects that want to read and/or write Java serialized objects.

Reading is accomplished by having the client issue a POST request, with the serialized data as the body of the request.

Writing is accomplished by simply sending out the serialized bytes.

See Also:
Serializable

Field Summary
static java.lang.String serializedMimeType
          The mime type used to send and recieve Java serialized objects.
 
Constructor Summary
HttpSerialized()
           
 
Method Summary
static java.lang.Object readSerializedObject(HttpPresentationComms comms)
          Read in a Java object from a POST request.
static java.lang.Object readSerializedObject(com.lutris.appserver.server.httpPresentation.HttpPresentationRequest request)
          Read in a Java object from a POST request.
static void writeSerializedObject(HttpPresentationComms comms, java.io.Serializable object)
          Return a serialized Java object to the client.
static void writeSerializedObject(com.lutris.appserver.server.httpPresentation.HttpPresentationResponse response, java.io.Serializable object)
          Return a serialized Java object to the client.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serializedMimeType

public static final java.lang.String serializedMimeType
The mime type used to send and recieve Java serialized objects.

See Also:
Constant Field Values
Constructor Detail

HttpSerialized

public HttpSerialized()
Method Detail

readSerializedObject

public static java.lang.Object readSerializedObject(com.lutris.appserver.server.httpPresentation.HttpPresentationRequest request)
                                             throws com.lutris.appserver.server.httpPresentation.HttpPresentationException
Read in a Java object from a POST request. The object is returned.

Parameters:
request - HTTP communication request.
Returns:
The java object sent in the POST request.
Throws:
HttpPresentationException - If the request is not of type POST, or the content type is not correct, or there is an IO or serialization error.

readSerializedObject

public static java.lang.Object readSerializedObject(HttpPresentationComms comms)
                                             throws com.lutris.appserver.server.httpPresentation.HttpPresentationException
Read in a Java object from a POST request. The object is returned.

Parameters:
comms - HTTP communications object. Contains objects and interfaces to read the request and send a response.
Returns:
The java object sent in the POST request.
Throws:
HttpPresentationException - If the request is not of type POST, or the content type is not correct, or there is an IO or serialization error.

writeSerializedObject

public static void writeSerializedObject(com.lutris.appserver.server.httpPresentation.HttpPresentationResponse response,
                                         java.io.Serializable object)
                                  throws com.lutris.appserver.server.httpPresentation.HttpPresentationException
Return a serialized Java object to the client.

Parameters:
comms - HTTP Response object. interface to send a response.
object - The object to return to the client.
Throws:
HttpPresentationException - If there is an error serializing the object, or an error in the underlying calls to response.

writeSerializedObject

public static void writeSerializedObject(HttpPresentationComms comms,
                                         java.io.Serializable object)
                                  throws com.lutris.appserver.server.httpPresentation.HttpPresentationException
Return a serialized Java object to the client.

Parameters:
comms - HTTP communications object. Contains objects and interfaces to read the request and send a response.
object - The object to return to the client.
Throws:
HttpPresentationException - If there is an error serializing the object, or an error in the underlying calls to response.

EAF 7.6 Implementation