Loading...
Searching...
No Matches
TimerEventManager.idl
/* SPDX-License-Identifier: BSD-3-Clause */
/*
* Copyright 2012 Raritan Inc. All rights reserved.
*/
#ifndef __EVENT_TIMEREVENTMANAGER_IDL__
#define __EVENT_TIMEREVENTMANAGER_IDL__
/** Event interface */
module event {
/** TimerEventManager interface */
interface TimerEventManager {
/** Error codes */
constant int NO_ERROR = 0; ///< operation successful, no error
constant int ERR_INVALID_SCHEDULE = 1; ///< failure in schedule
constant int ERR_UNKNOWN_EVENT_ID = 2; ///< unknown eventId
constant int ERR_CREATE_EVENT_ID_FAILED = 3; ///< creating eventId failed
constant int ERR_MAX_TIMERS_CREATED = 4; ///< max number of timers have been created
/**
* Schedule defines and structures
*
* The goal of the following declarations is
* to express crontab entries in a structured way.
*/
/** Months */
constant int JAN = 1; ///< January
constant int FEB = 2; ///< February
constant int MAR = 3; ///< March
constant int APR = 4; ///< April
constant int MAY = 5; ///< May
constant int JUN = 6; ///< June
constant int JUL = 7; ///< July
constant int AUG = 8; ///< August
constant int SEP = 9; ///< September
constant int OCT = 10; ///< October
constant int NOV = 11; ///< November
constant int DEC = 12; ///< December
/** Days of week */
constant int SUN = 0; ///< Sunday
constant int MON = 1; ///< Monday
constant int TUE = 2; ///< Tuesday
constant int WED = 3; ///< Wednesday
constant int THU = 4; ///< Thursday
constant int FRI = 5; ///< Friday
constant int SAT = 6; ///< Saturday
/**
* Range structure
*
* A range defines a time between start and end point in time.
* If start and end point are the same it is a specific point in time
* and no range. Step defines the repeating interval in time.
* Step of 1 is default and matches all values in range.
*/
structure Range {
int start; ///< Start time
int end; ///< End time
int step; ///< Step
};
/**
* Schedule structure
*
* An empty vector means a match for all values.
* The values range of every field depends on the meaning of the field.
* For minutes 0-59 is possible, for hour 0-24 and for day of month 0-31.
* For month and day of weeks the definitions above should be used.
*
* The system's local time will be used (as defined by the configured time zone).
*/
structure Schedule {
boolean enabled; ///< Whether the timer event is enabled
vector<Range> minute; ///< Ranges for minute
vector<Range> hour; ///< Ranges for hour
vector<Range> dayOfMonth; ///< Ranges for day of month
vector<Range> month; ///< Ranges for month
vector<Range> dayOfWeek; ///< Ranges for day of week
};
/**
* TimerEvent structure
*
* A TimerEvent can be used in the event engine to run actions
* at a specified time.
* The 'eventId' is an unique identification of every timer event.
* The 'executionTime' contains the schedule for the execution time.
*/
structure TimerEvent {
vector<string> eventId; ///< Event ID
Schedule executionTime; ///< Schedule for execution time
};
/**
* Add a new timer event.
*
* The timer event id field is allocated automatically
* and returned in the timerEventId parameter.
*
* @param schedule schedule for timer
* @param eventId created event id
* @return NO_ERROR if OK
* @return ERR_INVALID_SCHEDULE if schedule is invalid
* @return ERR_CREATE_EVENT_ID_FAILED if generating the eventId failed
* @return ERR_MAX_TIMERS_CREATED if max timer count already created
*/
int addTimerEvent(in Schedule schedule, out vector<string> eventId);
/**
* Modify a timer event.
*
* @param eventId event id
* @param schedule new schedule for timer
* @return NO_ERROR if OK
* @return ERR_INVALID_SCHEDULE if schedule is invalid
* @return ERR_UNKNOWN_EVENT_ID if eventId is unknown
*/
int modifyTimerEvent(in vector<string> eventId, in Schedule schedule);
/**
* Delete a timer event.
*
* @param eventId event id
* @return NO_ERROR if OK
* @return ERR_UNKNOWN_EVENT_ID if eventId is unknown
*/
int deleteTimerEvent(in vector<string> eventId);
/**
* List all timer events.
*/
vector<TimerEvent> listTimerEvents();
};
}
#endif /* __EVENT_TIMEREVENTMANAGER_IDL__ */
event::TimerEventManager
TimerEventManager interface.
Definition TimerEventManager.idl:13
event::TimerEventManager::listTimerEvents
vector< TimerEvent > listTimerEvents()
List all timer events.
event::TimerEventManager::addTimerEvent
int addTimerEvent(in Schedule schedule, out vector< string > eventId)
Add a new timer event.
event::TimerEventManager::modifyTimerEvent
int modifyTimerEvent(in vector< string > eventId, in Schedule schedule)
Modify a timer event.
event::TimerEventManager::deleteTimerEvent
int deleteTimerEvent(in vector< string > eventId)
Delete a timer event.
event::TimerEventManager::Range
Range structure.
Definition TimerEventManager.idl:57
event::TimerEventManager::Range::start
int start
Start time.
Definition TimerEventManager.idl:58
event::TimerEventManager::Range::step
int step
Step.
Definition TimerEventManager.idl:60
event::TimerEventManager::Range::end
int end
End time.
Definition TimerEventManager.idl:59
event::TimerEventManager::Schedule
Schedule structure.
Definition TimerEventManager.idl:72
event::TimerEventManager::Schedule::minute
vector< Range > minute
Ranges for minute.
Definition TimerEventManager.idl:74
event::TimerEventManager::Schedule::enabled
boolean enabled
Whether the timer event is enabled.
Definition TimerEventManager.idl:73
event::TimerEventManager::Schedule::month
vector< Range > month
Ranges for month.
Definition TimerEventManager.idl:77
event::TimerEventManager::Schedule::hour
vector< Range > hour
Ranges for hour.
Definition TimerEventManager.idl:75
event::TimerEventManager::Schedule::dayOfWeek
vector< Range > dayOfWeek
Ranges for day of week.
Definition TimerEventManager.idl:78
event::TimerEventManager::Schedule::dayOfMonth
vector< Range > dayOfMonth
Ranges for day of month.
Definition TimerEventManager.idl:76
event::TimerEventManager::TimerEvent
TimerEvent structure.
Definition TimerEventManager.idl:89
event::TimerEventManager::TimerEvent::executionTime
Schedule executionTime
Schedule for execution time.
Definition TimerEventManager.idl:91
event::TimerEventManager::TimerEvent::eventId
vector< string > eventId
Event ID.
Definition TimerEventManager.idl:90