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

The AKExchange class defines the mechanism by which modules communicate with other modules further down the route. More...

Public Member Functions

void addMessageToCache (String key, AKMessage message)
 Adds an AKMessage object to the response cache.
 
void clearMessageCache ()
 Removes all AKMessage objects from the response cache.
 
AKRequest getAkulaRequest ()
 Returns the AKRequest object associated with this AKExchange object.
 
Exception getException ()
 Returns any exception thrown by the route, or null if no exception was thrown.
 
AKMessage getIn ()
 Returns the incoming AKMessage object for AKExchange object.
 
Map< String, AKMessagegetMessageCache ()
 Returns reference to the response cache.
 
Set< Entry< String, AKMessage > > getMessageCacheEntrySet ()
 Returns a Set object of Entry<String, AKMessage> objects.
 
Set< String > getMessageCacheKeySet ()
 Returns a Set object containing the keys for the objects in the response cache.
 
AKMessage getMessageFromCache (String key)
 Gets an AKMessage object from the response cache.
 
AKMessage getOut ()
 Returns the response AKMessage object for AKExchange object.
 
Map< String, Object > getProperties ()
 Returns all of the properties associated with the exchange.
 
Object getProperty (String name)
 Gets the value of a property.
 
AKMessage newMessage ()
 Creates a new AKMessage instance with a success (200) status code.
 
AKMessage newMessage (int status)
 Creates a new newMessage instance with a specified HTTP status code.
 
AKMessage newMessage (Throwable throwable)
 Creates a new newMessage instance with an internal error (500) HTTP status code, and the associated Throwable object.
 
AKMessage removeMessageFromCache (String key)
 Removes an AKMessage object from the response cache.
 
void setOut (AKMessage message)
 Sets the response object associated with this exchange.
 
void setProperty (String name, Object value)
 Sets the value of a property.
 

Detailed Description

The AKExchange class defines the mechanism by which modules communicate with other modules further down the route.

This class wraps an AKRequest object that contains request values, an AKMessage object that contains the status code and the response to be sent back to the caller, as well as any exceptions that were generated along the route.

Member Function Documentation

void com.verivo.akula.api.data.module.AKExchange.addMessageToCache ( String  key,
AKMessage  message 
)

Adds an AKMessage object to the response cache.

Parameters
keyThe key to to use for the response in the cache.
messageThe response object to put in the cache.
Version
1.0
void com.verivo.akula.api.data.module.AKExchange.clearMessageCache ( )

Removes all AKMessage objects from the response cache.

Version
1.0
AKRequest com.verivo.akula.api.data.module.AKExchange.getAkulaRequest ( )

Returns the AKRequest object associated with this AKExchange object.

Returns
The AKRequest object, or null if the module is not the first one in the route.
Version
1.0
Exception com.verivo.akula.api.data.module.AKExchange.getException ( )

Returns any exception thrown by the route, or null if no exception was thrown.

Returns
An Exception object.
Version
1.5
AKMessage com.verivo.akula.api.data.module.AKExchange.getIn ( )

Returns the incoming AKMessage object for AKExchange object.

Returns
The AKMessage object that was passed through from the previous module in the route, or null if this module is the first in the route or the response has not been set.
Version
1.0
Map<String, AKMessage> com.verivo.akula.api.data.module.AKExchange.getMessageCache ( )

Returns reference to the response cache.

Returns
A Map object.
Version
1.0
Set<Entry<String, AKMessage> > com.verivo.akula.api.data.module.AKExchange.getMessageCacheEntrySet ( )

Returns a Set object of Entry<String, AKMessage> objects.

Returns
The Set object of Entry<String, AKMessage>.
Version
1.0
Set<String> com.verivo.akula.api.data.module.AKExchange.getMessageCacheKeySet ( )

Returns a Set object containing the keys for the objects in the response cache.

Returns
The Set object of keys.
Version
1.0
AKMessage com.verivo.akula.api.data.module.AKExchange.getMessageFromCache ( String  key)

Gets an AKMessage object from the response cache.

Parameters
keyThe key to to use for the response in the cache.
Returns
The AKMessage object.
Version
1.0
AKMessage com.verivo.akula.api.data.module.AKExchange.getOut ( )

Returns the response AKMessage object for AKExchange object.

Returns
The AKMessage object that was set as the "out" during processing in this route, or a new AKMessage out has already been not set.
Version
1.0
Map<String, Object> com.verivo.akula.api.data.module.AKExchange.getProperties ( )

Returns all of the properties associated with the exchange.

Returns
all the headers in a Map
Object com.verivo.akula.api.data.module.AKExchange.getProperty ( String  name)

Gets the value of a property.

Parameters
nameThe name of the property.
Returns
The value of the named property or null if not present.
Version
1.0
AKMessage com.verivo.akula.api.data.module.AKExchange.newMessage ( )

Creates a new AKMessage instance with a success (200) status code.

Returns
The AKMessage object.
Version
1.0
AKMessage com.verivo.akula.api.data.module.AKExchange.newMessage ( int  status)

Creates a new newMessage instance with a specified HTTP status code.

Parameters
statusHttp status code to set on the message
Returns
The AKMessage object.
Version
1.0
AKMessage com.verivo.akula.api.data.module.AKExchange.newMessage ( Throwable  throwable)

Creates a new newMessage instance with an internal error (500) HTTP status code, and the associated Throwable object.

Parameters
throwableThe exception being reported
Returns
The AKMessage object.
Version
1.0
AKMessage com.verivo.akula.api.data.module.AKExchange.removeMessageFromCache ( String  key)

Removes an AKMessage object from the response cache.

Parameters
keyThe key to to use for the response in the cache.
Returns
The AKMessage object removed, if any.
Version
1.0
void com.verivo.akula.api.data.module.AKExchange.setOut ( AKMessage  message)

Sets the response object associated with this exchange.

Parameters
messageThe response object to set.
Version
1.0
void com.verivo.akula.api.data.module.AKExchange.setProperty ( String  name,
Object  value 
)

Sets the value of a property.

Parameters
nameThe name of the property.
valueThe value for the property.
Version
1.0