#include <mw/msvschedulesend.h>
class CMsvScheduleSend : public CBase |
Protected Member Functions | |
---|---|
CMsvScheduleSend(CMsvServerEntry &) | |
virtual IMPORT_C void | ConstructL() |
pure virtual CMsvScheduledEntry * | GetMessageL(const TMsvId) |
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.
CMsvSysAgentActions * | iAgentActions | [protected] |
The System Agent conditions that must be satisfied before a sending attempt.
CMsvSendErrorActions * | iErrorActions | [protected] |
The Server MTM specific actions to take when particular errors occur during message sending.
CMsvOffPeakTimes * | iOffPeakTimes | [protected] |
The Server MTM specific off peak time periods.
TBool | iRegistered | [protected] |
Indicates if this has been registered with the Task Scheduler.
Initially set to EFalse.
CArrayFixFlat< TScheduleEntryInfo2 > * | iSchEntryInfo | [protected] |
Array of schedule entry data.
CMsvScheduleSettings * | iSettings | [protected] |
The Server MTM specific scheduled message sending settings.
IMPORT_C | CMsvScheduleSend | ( | CMsvServerEntry & | aServerEntry | ) | [protected] |
Constructor.
Parameter | Description |
---|---|
aServerEntry | The CMsvServerEntry of the server MTM of which this CMsvScheduleSend object is a member. |
CMsvSysAgentActions & | AgentActions | ( | ) | const [inline] |
Gets System Agent conditions that must be satisfied before a sending attempt.
Returns: System Agent conditions
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.
Parameter | Description |
---|---|
aSelection | Array of message IDs that need to be checked against the task scheduler. |
IMPORT_C void | ConnectAndRegisterL | ( | RScheduler & | aScheduler, |
const CMsvScheduleSettings & | aSettings | |||
) | [static] |
Connects to and registers with the task scheduler.
Parameter | Description |
---|---|
aScheduler | Handle to the scheduler to connect to. |
aSettings | Schedule settings. |
IMPORT_C void | ConstructL | ( | ) | [protected, virtual] |
Second phase constructor.
This constructor creates instances of the following classes: CMsvScheduleSettings, CMsvOffPeakTimes, CMsvSendErrorActions, CMsvSysAgentActions and CMsvScheduledEntries.
IMPORT_C void | CreateScheduleL | ( | RScheduler & | aScheduler, |
const CMsvScheduleSettings & | aSettings, | |||
const TTime & | aStartTime, | |||
const TTimeIntervalMinutes & | aValidityPeriod, | |||
TSchedulerItemRef & | aRef | |||
) | [static] |
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.
See also: RScheduler::CreatePersistentSchedule
Parameter | Description |
---|---|
aScheduler | Handle to scheduler to update. |
aSettings | Scheduler settings. |
aStartTime | Schedule start time. |
aValidityPeriod | Schedule validity period. |
aRef | On return, the new schedule. |
IMPORT_C void | CreateScheduleL | ( | RScheduler & | aScheduler, |
const CArrayFixFlat< TTaskSchedulerCondition > & | aConditions, | |||
const TTime & | aTimeout, | |||
TSchedulerItemRef & | aRef | |||
) | [static] |
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.
See also: RScheduler::CreatePersistentSchedule TSysAgentCondition
Parameter | Description |
---|---|
aScheduler | Handle to scheduler to update. |
aConditions | The set of System Agent conditions that are required to be met to trigger the schedule. |
aTimeout | The timeout value for the schedule. |
aRef | On return, the new schedule. |
IMPORT_C void | DeleteScheduleL | ( | const CMsvEntrySelection & | aSelection | ) |
Delete the schedules for the specified messages from the task scheduler.
The messages themselves are not deleted.
Parameter | Description |
---|---|
aSelection | Array of message IDs that need to be deleted from the task scheduler. |
IMPORT_C void | FindScheduleL | ( | RScheduler & | aScheduler, |
const TTime & | aStartTime, | |||
TSchedulerItemRef & | aRef | |||
) | [static] |
Searches the scheduler for an existing schedule item with a schedule time that matches with time supplied.
See also: RScheduler::GetScheduleL()
Parameter | Description |
---|---|
aScheduler | Handle to the scheduler. |
aStartTime | Schedule start time. |
aRef | On return, the schedule item. |
IMPORT_C void | FindScheduleL | ( | RScheduler & | aScheduler, |
const CArrayFixFlat< TTaskSchedulerCondition > & | aConditions, | |||
const TTime & | aTimeout, | |||
TSchedulerItemRef & | aRef | |||
) | [static] |
Searches the scheduler for an existing conditions schedule item with a set of pending conditions and timeout value that matches with those supplied.
See also: RScheduler::GetScheduleL
Parameter | Description |
---|---|
aScheduler | Handle to the scheduler. |
aConditions | The set of System Agent conditions that are required to be met to trigger the schedule. |
aTimeout | The timeout value for the schedule. |
aRef | On return, the schedule item. |
CMsvScheduledEntry * | GetMessageL | ( | const TMsvId | aId | ) | const [protected, pure virtual] |
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.
Parameter | Description |
---|---|
aId | The message ID. |
Returns: The message's schedule data.
IMPORT_C void | LoadScheduleSettingsL | ( | CRepository & | aRepository | ) |
Loads schedule settings from CenRep
Parameter | Description |
---|---|
aRepository | CenRep repository to load settings from |
CMsvOffPeakTimes & | OffPeakTimes | ( | ) | const [inline] |
Gets off-peak times settings.
Returns: Off-peak times settings
IMPORT_C void | ReScheduleL | ( | const CMsvEntrySelection & | aSelection, |
const TMsvSchedulePackage & | aPackage, | |||
const TMsvSendErrorAction * | aErrorAction = NULL | |||
) |
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.
Parameter | Description |
---|---|
aSelection | Array of message IDs that need to be re-scheduled. This array cannot be empty. All the messages identified must belong to the same MTM. It is not a precondition that each message has already been scheduled on the task scheduler. |
aPackage | Scheduling options. |
aErrorAction | The specific action to take with the messages. If this argument is omitted, then ReScheduleL() uses the iError member of each TMsvEntry to find the related TMsvSendErrorAction in iErrorActions. |
IMPORT_C void | RoundUpToMinute | ( | TTime & | aTime | ) | [static] |
Utility function that rounds a specified time up to the nearest minute.
Parameter | Description |
---|---|
aTime | On return, the passed value rounded up to the nearest minute. |
IMPORT_C void | ScheduleEntryL | ( | RScheduler & | aScheduler, |
const TSchedulerItemRef & | aRef, | |||
const TMsvSchedulePackage & | aPackage, | |||
TTaskInfo & | aInfo | |||
) | [static] |
Adds an entry to an existing schedule.
See also: RScheduler::ScheduleTask()
Parameter | Description |
---|---|
aScheduler | Scheduler to access. |
aRef | Id of the schedule. |
aPackage | Scheduler settings. |
aInfo | Information about the entry to be added to the schedule. |
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.
Parameter | Description |
---|---|
aSelection | Array of message IDs that need to be scheduled. This array cannot be empty. All the messages identified in the selection must belong to the same MTM; be scheduled for the same time; have the same setting for their OffPeak() flag; have the scheduled time stored in the iDate member of their corresponding TMsvEntry. |
aPackage | Scheduling options |
CMsvScheduleSettings & | ScheduleSettings | ( | ) | const [inline] |
Gets scheduler settings.
Returns: Scheduler settings
CMsvSendErrorActions & | SendErrorActions | ( | ) | const [inline] |
Gets action-on-sending-error settings.
Returns: Action-on-sending-error settings
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.
Parameter | Description |
---|---|
aEntry | The message which was either successfully sent or which failed (all the attempts) to send. It is not a precondition that the message has already been scheduled on the task scheduler. |
aChangeEntry | If aChangeEntry is ETrue then SendingCompleteL() will call CMsvServerEntry::ChangeEntry() to update the message on the message server. |
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.
Parameter | Description |
---|---|
aSelection | Messages that were either successfully sent or which failed all the attempts to send. |
IMPORT_C void | UpdateEntryAfterSchedule | ( | const TSchedulerItemRef & | aRef, |
const TTaskInfo & | aInfo, | |||
const TTime & | aTime, | |||
TInt | aFinalState, | |||
TMsvEntry & | aEntry, | |||
TMsvEntryScheduleData & | aData | |||
) | [static] |
Utility function that updates message index entry fields to reflect the message's scheduling.
Parameter | Description |
---|---|
aRef | Scheduler item. |
aInfo | Scheduler task information. |
aTime | Schedule start time. |
aFinalState | Sending state flag. |
aEntry | On return, updated index entry. |
aData | On return, populated messaging scheduling data. |