Search in sources :

Example 36 with SmscPropertiesManagement

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;
// }
}
Also used : SmscPropertiesManagement(org.mobicents.smsc.domain.SmscPropertiesManagement) SmsSet(org.mobicents.smsc.library.SmsSet)

Aggregations

SmscPropertiesManagement (org.mobicents.smsc.domain.SmscPropertiesManagement)36 Test (org.testng.annotations.Test)27 SmsSet (org.mobicents.smsc.library.SmsSet)25 ArrayList (java.util.ArrayList)23 Sms (org.mobicents.smsc.library.Sms)23 MAPDialogSmsProxy (org.mobicents.smsc.slee.resources.persistence.MAPDialogSmsProxy)22 MAPServiceSmsProxy (org.mobicents.smsc.slee.resources.persistence.MAPServiceSmsProxy)22 SmsSetEvent (org.mobicents.smsc.slee.services.smpp.server.events.SmsSetEvent)22 UUID (java.util.UUID)20 SmsProxy (org.mobicents.smsc.slee.resources.persistence.SmsProxy)20 ISDNAddressStringImpl (org.restcomm.protocols.ss7.map.primitives.ISDNAddressStringImpl)19 ISDNAddressString (org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString)17 MAPApplicationContextVersion (org.restcomm.protocols.ss7.map.api.MAPApplicationContextVersion)16 IMSI (org.restcomm.protocols.ss7.map.api.primitives.IMSI)16 LocationInfoWithLMSI (org.restcomm.protocols.ss7.map.api.service.sms.LocationInfoWithLMSI)16 SendRoutingInfoForSMResponse (org.restcomm.protocols.ss7.map.api.service.sms.SendRoutingInfoForSMResponse)16 IMSIImpl (org.restcomm.protocols.ss7.map.primitives.IMSIImpl)16 LocationInfoWithLMSIImpl (org.restcomm.protocols.ss7.map.service.sms.LocationInfoWithLMSIImpl)16 SendRoutingInfoForSMResponseImpl (org.restcomm.protocols.ss7.map.service.sms.SendRoutingInfoForSMResponseImpl)16 MAPTestEvent (org.mobicents.smsc.slee.resources.persistence.MAPDialogSmsProxy.MAPTestEvent)15