Analytics::Session Class Reference

#include <analyticsnokia.h>

Link against: analyticscollector.lib

class Analytics::Session : public QObject, public QObject

The class Session represents a session in the course of which application usage data are logged and submitted to the back-end server.

Inherits from

  • Analytics::Session
    Public Slots
    voidclose(CloseReason)
    voidlogEvent(LogEventType, const QString &, const QVariantMap &)
    voidopen()
    Inherited Attributes
    QObject::d_ptr
    QObject::objectName
    QObject::staticQtMetaObject
    Inherited Functions
    QObject::QObject(QObjectPrivate &,QObject *)
    QObject::blockSignals(bool)
    QObject::childEvent(QChildEvent *)
    QObject::children()const
    QObject::connect(const QObject *,const QMetaMethod &,const QObject *,const QMetaMethod &,Qt::ConnectionType)
    QObject::connect(const QObject *,const char *,const QObject *,const char *,Qt::ConnectionType)
    QObject::connect(const QObject *,const char *,const char *,Qt::ConnectionType)const
    QObject::connectNotify(const char *)
    QObject::customEvent(QEvent *)
    QObject::deleteLater
    QObject::destroyed
    QObject::disconnect(const QObject *,const QMetaMethod &,const QObject *,const QMetaMethod &)
    QObject::disconnect(const QObject *,const char *)
    QObject::disconnect(const QObject *,const char *,const QObject *,const char *)
    QObject::disconnect(const char *,const QObject *,const char *)
    QObject::disconnectNotify(const char *)
    QObject::dumpObjectInfo()
    QObject::dumpObjectTree()
    QObject::dynamicPropertyNames()const
    QObject::event(QEvent *)
    QObject::eventFilter(QObject *,QEvent *)
    QObject::findChild(const QString &)const
    QObject::findChildren(const QRegExp &)const
    QObject::findChildren(const QString &)const
    QObject::inherits(const char *)const
    QObject::installEventFilter(QObject *)
    QObject::isWidgetType()const
    QObject::killTimer(int)
    QObject::moveToThread(QThread *)
    QObject::objectName()const
    QObject::parent()const
    QObject::property(const char *)const
    QObject::receivers(const char *)const
    QObject::registerUserData()
    QObject::removeEventFilter(QObject *)
    QObject::sender()const
    QObject::senderSignalIndex()const
    QObject::setObjectName(const QString &)
    QObject::setParent(QObject *)
    QObject::setProperty(const char *,const QVariant &)
    QObject::setUserData(uint,QObjectUserData *)
    QObject::signalsBlocked()const
    QObject::startTimer(int)
    QObject::thread()const
    QObject::timerEvent(QTimerEvent *)
    QObject::userData(uint)const
    QObject::~QObject()

    Detailed Description

    The class processes events by logging usage data associated with them.

    In order to log usage data, at a minimum one session is required. Typically, a client application will use only one session, but it is also possible to have several co-existing sessions, each with different parameters.

    Dispatch of logged data (events) to the back-end server is triggered when the session is closed and certain conditions are met (a network connection must be available and the device battery level must be sufficient).

    Each client application that is to submit usage data to the back-end server must create its own instance(s) of Session.

    Before instantiating the Session class, the client application must create an instance of the class Application .

    See also: Analytics (for usage examples)

    Member Function Documentation

    close ( CloseReason )

    voidclose(CloseReasonreason)[slot]

    This method closes and ends the current session. The provided custom parameters are recorded with an implicit session end event. The duration of the session is automatically added to the end parameters. If the session was not closed before the application exited, it will be reported as an unclosed session next time the application is launched. The session must be opened before the function is called. The optional properties customSessionParams and dataVolume should be defined before the method is called. Session can be closed in client application's destructor or after the signal QCoreApplication::aboutToQuit() has been emitted.

    Parameters
    reasona member of the enumeration Session::CloseReason indicating the reason for closing the session

    logEvent ( LogEventType, const QString &, const QVariantMap & )

    voidlogEvent(LogEventTypetype,
    const QString &name,
    const QVariantMap &customParams =  QVariantMap()
    )[slot]

    This method logs an event for the current session. The session must be opened before the function is called.

    Parameters
    typea member of the enumeration Session::LogEventType indicating the type of event to be logged
    namea reference to QString containing the name of the event to be logged
    customParamsa reference to an instance of QVariantMap containing custom parameters for the event

    open ( )

    voidopen()[slot]

    This method opens a session with sessionId . All the application and session parameters need to be defined before the method is called, excluding dataVolume and customSessionParams . The mandatory properties sessionId and agentName need to be set before the session is opened.