Source: diagnostics/diagnostics.js

/**
 * Copyright© 2016, Oracle and/or its affiliates. All rights reserved.
 */


/**
 * Class that provides diagnostics capabilities. Callers should use
 * MobileBackend's [Diagnostics()]{@link MobileBackend#Diagnostics} property.
 * @constructor
 * @global
 */
function Diagnostics(platform, utils) {

  var HEADERS = utils.HEADERS;
  var _sessionId = utils.uuid();

  this._getHttpHeaders = function(headers) {
    headers[HEADERS.ORACLE_MOBILE_DIAGNOSTIC_SESSION_ID] = this.getSessionId();
    headers[HEADERS.ORACLE_MOBILE_DEVICE_ID] = platform.getDeviceId();
    headers[HEADERS.ORACLE_MOBILE_CLIENT_REQUEST_TIME] = new Date().toISOString();
  };

  /**
   * Returns the session ID or process ID of the Diagnostics event.
   * @return process id for the Diagnostics session.
   */
  this.getSessionId = function(){
    return _sessionId;
  }
}