Server SDK  
com.verivo.akula.api.data.module.AKMessage Interface Reference

The AKMessage interface contains the result of processing of a module. More...

Inheritance diagram for com.verivo.akula.api.data.module.AKMessage:
Inheritance graph

Public Member Functions

Object getBackingMessage ()
 Returns the backing Camel Message object.
 
Object getBody ()
 Returns the body of this message.
 
< T > T getBody (Class< T > tClass)
 Returns the body of the message as a Java object.
 
String getContentType ()
 Gets the content type of the body of this message.
 
Object getHeader (String name)
 Returns the value a header associated with this message.
 
< T > T getHeader (String name, Class< T > tClass)
 Returns a header associated with this message by name and by specifying the type.
 
Map< String, Object > getHeaders ()
 Returns a Map of all headers for this message.
 
int getStatus ()
 Returns the HTTP status code for this message.
 
boolean hasHeaders ()
 Returns whether any headers have been set.
 
boolean isContentJson ()
 Returns whether the content type of the body claims to be text formatted as JSON.
 
Object removeHeader (String name)
 Removes a header from the header map.
 
void setBody (Object body)
 Sets the body of this message.
 
void setContentType (String contentType)
 Sets the MimeType of the body of this message.
 
void setHeader (String name, Object value)
 Sets the value of a header associated with this message.
 
void setHeaders (Map< String, Object > header_map)
 Sets the map of all headers.
 
void setStatus (int status)
 Sets an HTTP status code for this message.
 

Detailed Description

The AKMessage interface contains the result of processing of a module.

The AKMessage object is the object that you attach to the AKExchange as the output of one module so that it can be input of the next module in the route.

Member Function Documentation

Object com.verivo.akula.api.data.module.AKMessage.getBackingMessage ( )

Returns the backing Camel Message object.

Returns
The backing Camel Message object.
Version
1.0
Object com.verivo.akula.api.data.module.AKMessage.getBody ( )

Returns the body of this message.

Returns
The body object of this message.
Version
1.0
<T> T com.verivo.akula.api.data.module.AKMessage.getBody ( Class< T >  tClass)

Returns the body of the message as a Java object.

Parameters
tClassThe expected Java class of the body object.
Returns
The body object or null if not present, or throws a RuntimeException if the body object could not be cast to the requested class.
Version
1.0
String com.verivo.akula.api.data.module.AKMessage.getContentType ( )

Gets the content type of the body of this message.

Returns
The content type (mime-type) of the body of this message.
Version
1.0

Implemented in com.verivo.akula.api.data.module.AKRequest.

Object com.verivo.akula.api.data.module.AKMessage.getHeader ( String  name)

Returns the value a header associated with this message.

Parameters
nameThe name of the header to retrieve.
Returns
The requested object or null if not present.
Version
1.0
<T> T com.verivo.akula.api.data.module.AKMessage.getHeader ( String  name,
Class< T >  tClass 
)

Returns a header associated with this message by name and by specifying the type.

Parameters
nameof the header object to retrieve.
tClassThe expected class of the object.
Returns
The requested object or null if not present or a RuntimeException if the object cannot be cast to tClass.
Version
1.0
Map<String,Object> com.verivo.akula.api.data.module.AKMessage.getHeaders ( )

Returns a Map of all headers for this message.

Returns
A Map object containing all headers for this message.
Version
1.0
int com.verivo.akula.api.data.module.AKMessage.getStatus ( )

Returns the HTTP status code for this message.

Returns
HTTP Status code for this message.
Version
1.0
boolean com.verivo.akula.api.data.module.AKMessage.hasHeaders ( )

Returns whether any headers have been set.

Returns
true any headers have been set, and false if not.
Version
1.0
boolean com.verivo.akula.api.data.module.AKMessage.isContentJson ( )

Returns whether the content type of the body claims to be text formatted as JSON.

Returns
true if the content type is JSON, and false if not.
Version
1.0

Implemented in com.verivo.akula.api.data.module.AKRequest.

Object com.verivo.akula.api.data.module.AKMessage.removeHeader ( String  name)

Removes a header from the header map.

Parameters
nameThe name of the header to remove.
Returns
The old value of the header.
Version
1.0
void com.verivo.akula.api.data.module.AKMessage.setBody ( Object  body)

Sets the body of this message.

Parameters
bodyThe body content o the message.
Version
1.0
void com.verivo.akula.api.data.module.AKMessage.setContentType ( String  contentType)

Sets the MimeType of the body of this message.

Parameters
contentTypeMime type of the body object of this message.
Version
1.0
void com.verivo.akula.api.data.module.AKMessage.setHeader ( String  name,
Object  value 
)

Sets the value of a header associated with this message.

Parameters
nameThe name of the header to set.
valueThe value to set.
Version
1.0
void com.verivo.akula.api.data.module.AKMessage.setHeaders ( Map< String, Object >  header_map)

Sets the map of all headers.

Parameters
header_mapThe map to install as the current set of headers.
Version
1.0
void com.verivo.akula.api.data.module.AKMessage.setStatus ( int  status)

Sets an HTTP status code for this message.

Parameters
statusThe status code to set.
Version
1.0