Table Of Contents
DataPurgingApp Service
Information About DataPurgingApp Service
createDataPurgingSchedule
deleteDataPurgingSchedule
getDataPurgingSchedule
modifyDataPurgingSchedules
purgeDataOnDemand
DataPurgingApp Service
This chapter describes the DCNM web services' API methods for the DataPurgingApp service.
Information About DataPurgingApp Service
When the system database gets too large, it can slow resources, corrupt databases, and fill available disk space. The DataPurging application allows you to purge the system of all call records that are no longer necessary and to delete or consolidate the entries in the database.
createDataPurgingSchedule
Creates the datapurging schedule with the given schedule and threshold information. If the purgingEnable attribute is set to TRUE then a timer task(scheduler) is created, the corresponding purging handler is assigned to that timer task and the schedule is scheduled to run. Otherwise, the schedule is just persisted in the database. A Map of schedulerType and the PurgingHandler (@link com.cisco.dcbu.dcm.scheduler.statistics.archive.PurgingHandler} is maintained. Whenever a new purging schedule is created , an entry will be put into that map.
ParameterException is thrown if the following situation occurs
•
If the schedule which is passed as a parameter to this API is null.
•
If the schudulerType SchedulerType is null.
•
If both, the scheduleDays is null or empty and the daily attribute is false or empty, in the schedule.
MetadataException is thrown if the following situation occurs.
•
If the value for the scheduleAt attribute(the time at which the purging has to happen ) in the scheduled days is null
InstantiationException is thrown if there exist a datapurging schedule in the database,corresponding to the schdulerType.
Parameters
opContext—Operational context
schedule—- DataPurgingSchedule It contains the information such when the schedule has to be run, what kind of purging action PurgingAction has to be taken on Purging, which data (scheduler tye—SchedulerType) has to be purged and which data has to be purged.
There are two attributes that state which data has to be purged and which has to be left unprocessed
•
skipRowCount—To skip the last 'skipRowCount' number of rows in the database unprocessed, during purging.
•
skipPastDaysCount—To skip the data unprocessed which are 'skipPastDaysCount' days old.
Return Value
DataPurgingSchedule Returns the schedule which is successfully created by this API.
deleteDataPurgingSchedule
Deletes the datapurging schedule corresponding to the given schedulerType. Before deleting the schedule from the database, this API first cancels the corresponding scheduler (timer task) and its task (purging handler). If there is no schedule exists in the database for the given schedulerType, calling this API does not have any impact. ParameterException is thrown if the schedulerType which is passed as a parameter is null.
Parameters
opContext—Operational context
type—Scheduler type
Return Value
void
getDataPurgingSchedule
Returns the Data purging schedule corresponds to the scheduler type.
ParameterException is thrown if the argument passed is null.
Parameters
opContext—Operational context
schedulerType—- The type of the data for which purging has to be done 1. EVEN 2. COLLECTOR
Return Value
The Data purging schedule corresponding to the scheduler type DataPurgingSchedule objects.
modifyDataPurgingSchedules
Modifies the purging schedule with the given schedule which is passed as an argument. A new timer task is created, assigned with the corresponding purging handler task and the old timer is cancelled and removed.
ParameterException is thrown if the following situation occurs
•
If the schedule which is passed as a parameter to this API is null.
•
If the schudulerType SchedulerType is null, in the schedule DataPurgingSchedule or if there is no schedule present in the DB corresponding to the schedulerType set in the schdule
•
If both , the scheduleDays is null or empty and the daily attribute is false or empty, in the schedule.
MetadataException is thrown if the following situation occurs.
If the value for the scheduleAt attribute(the time at which the purging has to happen ) in the scheduled days is null
InstantiationException is thrown if there is no corresponding datapurging schedule in the database exists.
Parameters
opContext—Operational context
schedule—- Modified purging schedule.
Return Value
- Modified and persisted purging schedule
purgeDataOnDemand
Purges the data immediately. There are two ways to purge the data. The first one is auto purging, which runs based on the schedule. The second one is manual purging, where the user can purge the data whenever he wants. But this purging happens only once upon user request, and does not run on schedule basis. The threshold to keep the raw data will be taken from the schedule object which is passed as an argument. If the user has modified the threshold and called this API, those thresholds will not be persisted. They are just taken as a floating data and used for the purging which will happen on this API call.
ParameterException is thrown if the following situation occurs
•
If the schedule which is passed as a parameter to this API is null.
•
If the schudulerType SchedulerType is null.
•
If the value for both skipRowCount and skipPastDaysCount attribute is null.
•
If the value for skipRowCount or skipPastDays count is negative (less than zero).
Parameters
opContext—Operational context
schedule—- The DatapurgingSchedule instance
Return Value
void