return false;
}
private void checkDataBaseSettings() throws Exception{
if (this.getConnection()==null) return; //No Database Settings when running without Database
SOSString sosString = new SOSString();
try { // to retrieve reference categories and values
ArrayList results = this.getConnection().getArray(
"SELECT \"CATEGORY\", \"VALUE\", \"SUBTYPE\" FROM SCHEDULER_SANITY_REFERENCES WHERE \"SPOOLER_ID\" IS NULL AND \"CATEGORY\"='disk_space'");
ArrayList results2 = this.getConnection().getArray(
"SELECT \"CATEGORY\", \"VALUE\", \"SUBTYPE\" FROM SCHEDULER_SANITY_REFERENCES WHERE \"SPOOLER_ID\"='" + spooler.id() + "' AND \"CATEGORY\"='disk_space' ");
results.addAll(results2);
Iterator iter = results.iterator();
while (iter.hasNext()){
HashMap row = (HashMap) iter.next();
String location = sosString.parseToString(row,"subtype");
String sMinSpace = sosString.parseToString(row,"value");
Long minSpace = new Long(minDiskSpace);
try{minSpace = new Long(sMinSpace);} catch (Exception e){}
if (location.length()>0){
diskChecks.put(location, minSpace);
}
}
spooler_log.debug3("Found "+ diskChecks.size()+" drives/directories to check in database.");
results = this.getConnection().getArray(
"SELECT \"CATEGORY\", \"VALUE\", \"SUBTYPE\" FROM SCHEDULER_SANITY_REFERENCES WHERE \"SPOOLER_ID\" IS NULL AND \"CATEGORY\"='disk_space_user'");
results2 = this.getConnection().getArray(
"SELECT \"CATEGORY\", \"VALUE\", \"SUBTYPE\" FROM SCHEDULER_SANITY_REFERENCES WHERE \"SPOOLER_ID\"='" + spooler.id() + "' AND \"CATEGORY\"='disk_space_user' ");
results.addAll(results2);
iter = results.iterator();
while (iter.hasNext()) {
HashMap row = (HashMap) iter.next();
String location = sosString.parseToString(row, "subtype");
String sMinSpace = sosString.parseToString(row, "value");
Long minSpace = new Long(minDiskSpace);
try {
minSpace = new Long(sMinSpace);
} catch (Exception e) {
}
if (location.length() > 0) {
diskChecksUser.put(location, minSpace);
}
}
spooler_log.debug3("Found " + diskChecksUser.size()
+ " drives/directories for Scheduler user to check in database.");
results = this.getConnection().getArray(
"SELECT \"CATEGORY\", \"VALUE\", \"SUBTYPE\" FROM SCHEDULER_SANITY_REFERENCES WHERE \"SPOOLER_ID\" IS NULL " +
"AND \"CATEGORY\"='free_memory' ");
results2 = this.getConnection().getArray(
"SELECT \"CATEGORY\", \"VALUE\", \"SUBTYPE\" FROM SCHEDULER_SANITY_REFERENCES WHERE \"SPOOLER_ID\"='" + spooler.id() + "' AND \"CATEGORY\"='free_memory' ");
results.addAll(results2);
iter = results.iterator();
while (iter.hasNext()){
HashMap row = (HashMap) iter.next();
String type = sosString.parseToString(row,"subtype");
String sMinMem = sosString.parseToString(row,"value");
Long minMem = new Long(minMemorySize);
try{minMem = new Long(sMinMem);} catch (Exception e){}
if (type.length()>0){
memChecks.put(type, minMem);
}