Location:
MsvScheduleSend.h
Link against: schsend.lib
class CMsvScheduleSend : public CBase;
Provides a Server MTM's interface to the Task Scheduler for messaging scheduling.
Server MTM's must provide a derived class that implements GetMessageL()
to provide a factory for MTM-specific scheduling CMsvScheduledEntry-based objects.
CBase
- Base class for all classes to be instantiated on the heap
CMsvScheduleSend
- Provides a Server MTM's interface to the Task Scheduler for messaging scheduling
Defined in CMsvScheduleSend
:
AgentActions()
, CMsvScheduleSend()
, CheckScheduleL()
, ConnectAndRegisterL()
, ConstructL()
, CreateScheduleL()
, CreateScheduleL()
, DeleteScheduleL()
, FindScheduleL()
, FindScheduleL()
, GetMessageL()
, LoadScheduleSettingsL()
, OffPeakTimes()
, ReScheduleL()
, RoundUpToMinute()
, ScheduleEntryL()
, ScheduleL()
, ScheduleSettings()
, SendErrorActions()
, SendingCompleteL()
, SendingCompleteL()
, UpdateEntryAfterSchedule()
, iAgentActions
, iErrorActions
, iOffPeakTimes
, iPackage
, iRegistered
, iSchEntries
, iSchEntryInfo
, iSchTaskInfo
, iScheduler
, iServerEntry
, iSettings
, ~CMsvScheduleSend()
Inherited from CBase
:
Delete()
,
Extension_()
,
operator new()
protected: IMPORT_C CMsvScheduleSend(CMsvServerEntry &aServerEntry);
Constructor.
|
protected: virtual IMPORT_C void ConstructL();
Second phase constructor.
This constructor creates instances of the following classes: CMsvScheduleSettings
, CMsvOffPeakTimes
, CMsvSendErrorActions
, CMsvSysAgentActions
and CMsvScheduledEntries.
IMPORT_C void ScheduleL(const CMsvEntrySelection &aSelection, const TMsvSchedulePackage &aPackage);
Schedules messages on the task scheduler.
Messages that are successfully scheduled have their sending state set to KMsvSendStateScheduled.
|
|
|
IMPORT_C void ReScheduleL(const CMsvEntrySelection &aSelection, const TMsvSchedulePackage &aPackage, const TMsvSendErrorAction
*aErrorAction=0);
Determines when the messages should be re-scheduled on the task scheduler, then schedules the messages at the new time(s).
Messages that are successfully re-scheduled are updated. The pending conditions flag indicates whether the message has been schedule for a set of conditions being met (or a timeout occuring) or scheduled for a specified time/date.
NOTE - conditions scheduling is only supoprted from 8.1 onwards.
In the case of time-scheduling, the date field is the scheduled time/date. In the case of conditions-scheduling, the date field reflects the timeout value.
There are several cases when messages are not re-scheduled. If all recipients have been sent to - in this case the message's sending state set to KMsvSendStateSent. If, more commonly, the message's maximum number of re-tries has been exceeded or the error action was ESendActionFail then the message is not changed.
|
|
IMPORT_C void CheckScheduleL(const CMsvEntrySelection &aSelection);
Verifies that the schedule information stored in specified messages is the same as that on the task scheduler.
|
|
IMPORT_C void DeleteScheduleL(const CMsvEntrySelection &aSelection);
Delete the schedules for the specified messages from the task scheduler.
The messages themselves are not deleted.
|
|
IMPORT_C void SendingCompleteL(TMsvEntry &aEntry, const TBool aChangeEntry=EFalse);
Tells the scheduler that sending is complete.
This function must be called when a message that had previously been scheduled is either sent or has failed. This function:
1. Deletes the TMsvEntryScheduleData
associated with the message
2. Sets the Scheduled flag to EFalse
3. If required, calls ChangeEntry() on the message server entry
Note: SendingCompleteL()
does not change the sending state of each message, nor delete each message from the task scheduler.
|
|
IMPORT_C void SendingCompleteL(const CMsvEntrySelection &aSelection);
Tells the scheduler that sending is complete.
This method sets the messages's scheduled flag to false, resets the schedule data associated with each message and the number
of retries for each recipient and stores the data and recipients in a stream associated with the TMsvEntry
.
|
inline CMsvOffPeakTimes &OffPeakTimes() const;
Gets off-peak times settings.
|
inline CMsvScheduleSettings &ScheduleSettings() const;
Gets scheduler settings.
|
inline CMsvSendErrorActions &SendErrorActions() const;
Gets action-on-sending-error settings.
|
inline CMsvSysAgentActions &AgentActions() const;
Gets System Agent conditions that must be satisfied before a sending attempt.
|
static IMPORT_C void CreateScheduleL(RScheduler &aScheduler, const CMsvScheduleSettings &aSettings, const TTime &aStartTime,
const TTimeIntervalMinutes &aValidityPeriod, TSchedulerItemRef &aRef);
Creates a new schedule on the task scheduler with which each message can be associated.
The schedule is triggered by a start time being reached.
|
static IMPORT_C void CreateScheduleL(RScheduler &aScheduler, const CArrayFixFlat< TTaskSchedulerCondition > &aConditions,
const TTime &aTimeout, TSchedulerItemRef &aRef);
Creates a new schedule on the task scheduler with which each message can be associated.
The schedule is triggered by either a set of conditions being met or a timeout being reached.
|
static IMPORT_C void FindScheduleL(RScheduler &aScheduler, const TTime &aStartTime, TSchedulerItemRef &aRef);
Searches the scheduler for an existing schedule item with a schedule time that matches with time supplied.
|
|
static IMPORT_C void FindScheduleL(RScheduler &aScheduler, const CArrayFixFlat< TTaskSchedulerCondition > &aConditions, const
TTime &aTimeout, TSchedulerItemRef &aRef);
Searches the scheduler for an existing conditions schedule item with a set of pending conditions and timeout value that matches with those supplied.
|
|
static IMPORT_C void RoundUpToMinute(TTime &aTime);
Utility function that rounds a specified time up to the nearest minute.
|
static IMPORT_C void ScheduleEntryL(RScheduler &aScheduler, const TSchedulerItemRef &aRef, const TMsvSchedulePackage &aPackage,
TTaskInfo &aInfo);
Adds an entry to an existing schedule.
|
|
static IMPORT_C void UpdateEntryAfterSchedule(const TSchedulerItemRef &aRef, const TTaskInfo &aInfo, const TTime &aTime, TInt
aFinalState, TMsvEntry &aEntry, TMsvEntryScheduleData &aData);
Utility function that updates message index entry fields to reflect the message's scheduling.
|
static IMPORT_C void ConnectAndRegisterL(RScheduler &aScheduler, const CMsvScheduleSettings &aSettings);
Connects to and registers with the task scheduler.
|
|
IMPORT_C void LoadScheduleSettingsL(CRepository &aRepository);
Loads schedule settings from CenRep
|
protected: virtual CMsvScheduledEntry *GetMessageL(const TMsvId aId) const=0;
Gets the schedule data and recipients of a message.
Recipient information is MTM-specific, so the server MTM must provide a derived class that implements CMsvScheduledEntry
, and return objects of that type from this function.
|
|
protected: CMsvScheduleSettings * iSettings;
The Server MTM specific scheduled message sending settings.
protected: CMsvOffPeakTimes * iOffPeakTimes;
The Server MTM specific off peak time periods.
protected: CMsvSendErrorActions * iErrorActions;
The Server MTM specific actions to take when particular errors occur during message sending.
protected: CMsvSysAgentActions * iAgentActions;
The System Agent conditions that must be satisfied before a sending attempt.
protected: TBool iRegistered;
Indicates if this has been registered with the Task Scheduler.
Initially set to EFalse.
protected: CArrayFixFlat< TScheduleEntryInfo2 > * iSchEntryInfo;
Array of schedule entry data.
protected: CArrayFixFlat< TTaskInfo > * iSchTaskInfo;
Array of schedule task data.