class Tracker implements IOFogModule {

    public void handleEvent(TrackingEventType type, String value) {
    	LoggingService.logDebug(MODULE_NAME, "start handle event");
        JsonObjectBuilder jsonObjectBuilder = Json.createObjectBuilder();
        JsonObject valueObj = null;
        if(type != null && value != null) {
            switch (type) {
                case TIME:
                    valueObj = jsonObjectBuilder.add("deltaTime", value + " min").build();
                    break;
                case ERROR:
                    valueObj = jsonObjectBuilder.add("message", value).build();
                    break;
                case PROVISION:
                    valueObj = jsonObjectBuilder.add("provisionStatus", value).build();
                    break;
                case DEPROVISION:
                    valueObj = jsonObjectBuilder.add("deprovisionStatus", value).build();
                    break;
                default:
                    //other events types not handled because should be used with handleEvent(TrackingEventType type, JsonStructure value) method
                    throw new IllegalArgumentException("unhandled event type");
            }
            handleEvent(type, valueObj);
        } else {
            LoggingService.logError(MODULE_NAME, "Error handling Event : Tracking event type and value cannot be null",
                    new AgentSystemException("Error handling Event : Tracking event type and value cannot be null"));
        }
        LoggingService.logDebug(MODULE_NAME, "Finished handle event");
    }

}