use of org.mobicents.smsc.domain.SmscPropertiesManagement in project smscgateway by RestComm.
the class SchedulerResourceAdaptor method fetchSchedulable.
protected OneWaySmsSetCollection fetchSchedulable(int maxRecordCount) throws PersistenceException {
SmscPropertiesManagement smscPropertiesManagement = SmscPropertiesManagement.getInstance();
// if (smscPropertiesManagement.getDatabaseType() == DatabaseType.Cassandra_1) {
// List<SmsSet> res0 = dbOperations_C1.fetchSchedulableSmsSets(maxRecordCount, this.tracer);
// OneWaySmsSetCollection res = new OneWaySmsSetCollection();
// res.setListSmsSet(res0);
// return res;
// } else {
long processedDueSlot = dbOperations_C2.c2_getCurrentDueSlot();
long possibleDueSlot = dbOperations_C2.c2_getIntimeDueSlot();
if (processedDueSlot >= possibleDueSlot) {
return new OneWaySmsSetCollection();
}
processedDueSlot++;
if (!dbOperations_C2.c2_checkDueSlotNotWriting(processedDueSlot)) {
return new OneWaySmsSetCollection();
}
ArrayList<SmsSet> lstS = dbOperations_C2.c2_getRecordList(processedDueSlot);
ArrayList<SmsSet> lst = dbOperations_C2.c2_sortRecordList(lstS);
OneWaySmsSetCollection res = new OneWaySmsSetCollection();
res.setListSmsSet(lst);
dbOperations_C2.c2_setCurrentDueSlot(processedDueSlot);
return res;
// }
}
Aggregations