io.keen.client.java
Interface KeenDetailedCallback

All Superinterfaces:
KeenCallback

public interface KeenDetailedCallback
extends KeenCallback

An interface to allow callers to receive a callback on success or failure of an operation by the keen client. This is most helpful for asynchronous calls (to detect completion of the operation), but can also be used to be notified of failures, which are normally caught silently by the client to prevent application crashes. This advanced version of the callback adds callbacks that take the event details as parameters.

Since:
2.0.3

Method Summary
 void onFailure(KeenProject project, java.lang.String eventCollection, java.util.Map<java.lang.String,java.lang.Object> event, java.util.Map<java.lang.String,java.lang.Object> keenProperties, java.lang.Exception e)
          Invoked when the requested operation fails.
 void onSuccess(KeenProject project, java.lang.String eventCollection, java.util.Map<java.lang.String,java.lang.Object> event, java.util.Map<java.lang.String,java.lang.Object> keenProperties)
          Invoked when the requested operation succeeds.
 
Methods inherited from interface io.keen.client.java.KeenCallback
onFailure, onSuccess
 

Method Detail

onSuccess

void onSuccess(KeenProject project,
               java.lang.String eventCollection,
               java.util.Map<java.lang.String,java.lang.Object> event,
               java.util.Map<java.lang.String,java.lang.Object> keenProperties)
Invoked when the requested operation succeeds.

Parameters:
project - The project in which the event was published. If a default project has been set on the client, this parameter may be null, in which case the default project was used.
eventCollection - The name of the collection in which the event was published
event - A Map that consists of key/value pairs. Keen naming conventions apply (see docs). Nested Maps and lists are acceptable (and encouraged!).
keenProperties - A Map that consists of key/value pairs to override default properties. ex: "timestamp" -> Calendar.getInstance()

onFailure

void onFailure(KeenProject project,
               java.lang.String eventCollection,
               java.util.Map<java.lang.String,java.lang.Object> event,
               java.util.Map<java.lang.String,java.lang.Object> keenProperties,
               java.lang.Exception e)
Invoked when the requested operation fails.

Parameters:
project - The project in which the event was published. If a default project has been set on the client, this parameter may be null, in which case the default project was used.
eventCollection - The name of the collection in which the event was published
event - A Map that consists of key/value pairs. Keen naming conventions apply (see docs). Nested Maps and lists are acceptable (and encouraged!).
keenProperties - A Map that consists of key/value pairs to override default properties. ex: "timestamp" -> Calendar.getInstance()
e - An exception indicating the cause of the failure.