use of edu.uiuc.ncsa.security.storage.sql.SQLStore in project OA4MP by ncsa.
the class EnvServlet method processStoreCheck.
public void processStoreCheck(Store store) throws SQLException {
if (store instanceof SQLStore) {
SQLStore sqlStore = (SQLStore) store;
sqlStore.checkTable();
sqlStore.checkColumns();
}
}
use of edu.uiuc.ncsa.security.storage.sql.SQLStore in project OA4MP by ncsa.
the class ClientServletInitializer method init.
@Override
public void init() throws ServletException {
if (hasRun)
return;
// run it once and only once.
hasRun = true;
MyLoggingFacade logger = getEnvironment().getMyLogger();
ClientEnvironment ce = (ClientEnvironment) getEnvironment();
// This next bit is a
if (ce.hasAssetStore()) {
if (ce.getAssetStore() instanceof SQLStore) {
SQLStore sqlStore = (SQLStore) ce.getAssetStore();
try {
sqlStore.checkTable();
sqlStore.checkColumns();
} catch (SQLException sqlX) {
logger.warn("Could not update store table:" + sqlX.getMessage());
}
}
Cleanup<Identifier, Asset> assetCleanup = ClientServlet.assetCleanup;
if (ce.isEnableAssetCleanup() && assetCleanup == null) {
assetCleanup = new Cleanup<Identifier, Asset>(logger);
assetCleanup.setStopThread(false);
assetCleanup.setMap(ce.getAssetStore());
assetCleanup.addRetentionPolicy(new ValidTimestampPolicy(ce.getMaxAssetLifetime()));
logger.info("Starting asset cleanup thread");
assetCleanup.start();
ClientServlet.assetCleanup = assetCleanup;
}
} else {
logger.info("No assets store, so no cleanup possible.");
}
}
Aggregations