#include <mw/msvschedulesend.h>
Link against: schsend.lib
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.
Parameters | |
---|---|
aServerEntry | The CMsvServerEntry of the server MTM of which this CMsvScheduleSend object is a member. |
CMsvSysAgentActions & | AgentActions | ( | ) | const [inline] |
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.
Parameters | |
---|---|
aSelection | Array of message IDs that need to be checked against the task scheduler. |
Panic Codes | |
---|---|
ScheduleSend-DLL | 0 The array of message IDs is empty. Debug build only. |
IMPORT_C void | ConnectAndRegisterL | ( | RScheduler & | aScheduler, |
const CMsvScheduleSettings & | aSettings | |||
) | [static] |
Connects to and registers with the task scheduler.
Parameters | |
---|---|
aScheduler | Handle to the scheduler to connect to. |
aSettings | Schedule settings. |
Leave Codes | |
---|---|
Any | error code |
Any | error code |
KErrPathNotFound | The .EXE file to be called by the Task Scheduler when messages are due to be sent cannot be found. The filename is part of the schedule settings. |
Any | error code |
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
Parameters | |
---|---|
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
Parameters | |
---|---|
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.
Parameters | |
---|---|
aSelection | Array of message IDs that need to be deleted from the task scheduler. |
Leave Codes | |
---|---|
Any | error code Unable to connect and register with the scheduler. |
Any | error code but KErrLocked and KErrNotFound The method overloading CMsvScheduledEntry::GetMessageL() left with an error, i.e. the scheduling info of one of the messages from the selection could not be retrieved from the message server. |
Any | error code Unable to reset the previous scheduling info for a message. |
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()
Parameters | |
---|---|
aScheduler | Handle to the scheduler. |
aStartTime | Schedule start time. |
aRef | On return, the schedule item. |
Leave Codes | |
---|---|
KErrNotFound | No schedule found matching the schedule time. |
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
Parameters | |
---|---|
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. |
Leave Codes | |
---|---|
KErrNotFound | No schedule found matching the schedule conditions and timeout. |
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.
Parameters | |
---|---|
aId | The message ID. |
IMPORT_C void | LoadScheduleSettingsL | ( | CRepository & | aRepository | ) |
Loads schedule settings from CenRep
Parameters | |
---|---|
aRepository | CenRep repository to load settings from |
CMsvOffPeakTimes & | OffPeakTimes | ( | ) | const [inline] |
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.
Parameters | |
---|---|
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. |
Panic Codes | |
---|---|
ScheduleSend-DLL | 0 The array of message IDs is empty. Debug build only. |
IMPORT_C void | RoundUpToMinute | ( | TTime & | aTime | ) | [static] |
Utility function that rounds a specified time up to the nearest minute.
Parameters | |
---|---|
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] |
Parameters | |
---|---|
aScheduler | Scheduler to access. |
aRef | Id of the schedule. |
aPackage | Scheduler settings. |
aInfo | Information about the entry to be added to the schedule. |
Leave Codes | |
---|---|
KErrNotFound | No existing schedule with the specified Id. |
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.
Parameters | |
---|---|
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 |
Leave Codes | |
---|---|
Any | error code but KErrLocked and KErrNotFound The method overloading CMsvScheduledEntry::GetMessageL() left with an error, i.e. the scheduling info of one of the messages from the selection could not be retrieved from the message server. |
Any | error code Unable to reset the previous scheduling info for a message. |
Panic Codes | |
---|---|
ScheduleSend-DLL | 0 The array of message IDs is empty. Debug build only. |
ScheduleSend-DLL | 1 At least one of the selected messages is scheduled for a different time as the others. Debug build only. |
ScheduleSend-DLL | 2 At least one of the selected messages does not belong to the same MTM. Debug build only. |
ScheduleSend-DLL | 3 At least one of the selected messages does not have the same off-peak settings as the others. Debug build only. |
CMsvScheduleSettings & | ScheduleSettings | ( | ) | const [inline] |
CMsvSendErrorActions & | SendErrorActions | ( | ) | const [inline] |
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.
Parameters | |
---|---|
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. |
Panic Codes | |
---|---|
ScheduleSend-DLL | 24 The server entry is not set to the correct entry. Debug build only. |
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.
Parameters | |
---|---|
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.
Parameters | |
---|---|
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. |