Former-commit-id:2f10c7a1e4
[formerly8552902906
] [formerlyb13cbb7e00
] [formerly2f10c7a1e4
[formerly8552902906
] [formerlyb13cbb7e00
] [formerly3904c4ccf5
[formerlyb13cbb7e00
[formerly 4909e0dd166e43c22a34d96aa744f51db8a7d6c0]]]] Former-commit-id:3904c4ccf5
Former-commit-id:1f521a70b3
[formerly97c4db937e
] [formerly 0e40eb424698bf43c230ac21347627590405fcb2 [formerly676ea3192f
]] Former-commit-id: 5dd364497cd5da1357297a4b842e962ad3d5e006 [formerly9054c5ab6c
] Former-commit-id:39ff9954f8
72 lines
2.1 KiB
Java
72 lines
2.1 KiB
Java
/**
|
|
* This software was developed and / or modified by Raytheon Company,
|
|
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
|
*
|
|
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
|
* This software product contains export-restricted data whose
|
|
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
|
* to non-U.S. persons whether in the United States or abroad requires
|
|
* an export license or other authorization.
|
|
*
|
|
* Contractor Name: Raytheon Company
|
|
* Contractor Address: 6825 Pine Street, Suite 340
|
|
* Mail Stop B8
|
|
* Omaha, NE 68106
|
|
* 402.291.0100
|
|
*
|
|
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
|
* further licensing information.
|
|
**/
|
|
package com.raytheon.edex.plugin.text.dao;
|
|
|
|
import java.util.Calendar;
|
|
|
|
import com.raytheon.edex.db.dao.DefaultPluginDao;
|
|
import com.raytheon.edex.textdb.dbapi.impl.TextDB;
|
|
import com.raytheon.uf.common.dataplugin.PluginException;
|
|
import com.raytheon.uf.edex.database.purge.PurgeLogger;
|
|
|
|
/**
|
|
* DAO for text products
|
|
*
|
|
* <pre>
|
|
*
|
|
* SOFTWARE HISTORY
|
|
*
|
|
* Date Ticket# Engineer Description
|
|
* ------------ ---------- ----------- --------------------------
|
|
* Jul 10, 2009 2191 rjpeter Update retention time handling.
|
|
* Aug 18, 2009 2191 rjpeter Changed to version purging.
|
|
* </pre>
|
|
*
|
|
* @author
|
|
* @version 1
|
|
*/
|
|
public class TextDao extends DefaultPluginDao {
|
|
|
|
public TextDao(String pluginName) throws PluginException {
|
|
super(pluginName);
|
|
}
|
|
|
|
@Override
|
|
public void purgeAllData() {
|
|
logger.warn("purgeAllPluginData not implemented for text. No data will be purged.");
|
|
}
|
|
|
|
protected void loadScripts() throws PluginException {
|
|
// no op
|
|
}
|
|
|
|
public void purgeExpiredData() throws PluginException {
|
|
int deletedRecords = 0;
|
|
|
|
// only do full purge every few hours since incremental purge runs every
|
|
// minute
|
|
if (Calendar.getInstance().get(Calendar.HOUR_OF_DAY) % 3 == 0) {
|
|
TextDB.purgeStdTextProducts();
|
|
}
|
|
|
|
PurgeLogger.logInfo("Purged " + deletedRecords + " items total.",
|
|
"text");
|
|
}
|
|
}
|