Search in sources :

Example 1 with MAPProvider

use of org.restcomm.protocols.ss7.map.api.MAPProvider in project smscgateway by RestComm.

the class RsdsSbb method setSbbContext.

@Override
public void setSbbContext(SbbContext sbbContext) {
    this.sbbContext = (SbbContextExt) sbbContext;
    try {
        Context ctx = (Context) new InitialContext().lookup("java:comp/env");
        this.mapAcif = (MAPContextInterfaceFactory) ctx.lookup("slee/resources/map/2.0/acifactory");
        this.mapProvider = (MAPProvider) ctx.lookup("slee/resources/map/2.0/provider");
        this.mapParameterFactory = this.mapProvider.getMAPParameterFactory();
        this.mapSmsTpduParameterFactory = this.mapProvider.getMAPSmsTpduParameterFactory();
        this.logger = this.sbbContext.getTracer(this.className);
        this.persistence = (PersistenceRAInterface) this.sbbContext.getResourceAdaptorInterface(PERSISTENCE_ID, PERSISTENCE_LINK);
        this.sccpParameterFact = new ParameterFactoryImpl();
    } catch (Exception ne) {
        logger.severe("Could not set SBB context:", ne);
    }
// TODO : Handle proper error
}
Also used : Context(javax.naming.Context) InitialContext(javax.naming.InitialContext) EventContext(javax.slee.EventContext) SbbContext(javax.slee.SbbContext) RolledBackContext(javax.slee.RolledBackContext) MAPApplicationContext(org.restcomm.protocols.ss7.map.api.MAPApplicationContext) ParameterFactoryImpl(org.restcomm.protocols.ss7.sccp.impl.parameter.ParameterFactoryImpl) InitialContext(javax.naming.InitialContext) CreateException(javax.slee.CreateException) MAPException(org.restcomm.protocols.ss7.map.api.MAPException)

Example 2 with MAPProvider

use of org.restcomm.protocols.ss7.map.api.MAPProvider in project smscgateway by RestComm.

the class RxSmppServerSbb method setSbbContext.

// *********
// SBB staff
@Override
public void setSbbContext(SbbContext sbbContext) {
    super.setSbbContext(sbbContext);
    try {
        Context ctx = (Context) new InitialContext().lookup("java:comp/env");
        maxMessagesPerStep = ((Integer) ctx.lookup("maxMessagesPerStep"));
        this.smppServerTransactionACIFactory = (SmppTransactionACIFactory) ctx.lookup("slee/resources/smppp/server/1.0/acifactory");
        this.smppServerSessions = (SmppSessions) ctx.lookup("slee/resources/smpp/server/1.0/provider");
        MAPProvider mapProvider = (MAPProvider) ctx.lookup("slee/resources/map/2.0/provider");
        this.mapSmsTpduParameterFactory = mapProvider.getMAPSmsTpduParameterFactory();
    } catch (Exception ne) {
        logger.severe("Could not set SBB context:", ne);
    }
}
Also used : InitialContext(javax.naming.InitialContext) EventContext(javax.slee.EventContext) SbbContext(javax.slee.SbbContext) Context(javax.naming.Context) MAPProvider(org.restcomm.protocols.ss7.map.api.MAPProvider) InitialContext(javax.naming.InitialContext) SmscProcessingException(org.mobicents.smsc.library.SmscProcessingException) RecoverablePduException(com.cloudhopper.smpp.type.RecoverablePduException) CharacterCodingException(java.nio.charset.CharacterCodingException)

Example 3 with MAPProvider

use of org.restcomm.protocols.ss7.map.api.MAPProvider in project smscgateway by RestComm.

the class MtCommonSbb method setSbbContext.

// *********
// SBB staff
@Override
public void setSbbContext(SbbContext sbbContext) {
    super.setSbbContext(sbbContext);
    try {
        Context ctx = (Context) new InitialContext().lookup("java:comp/env");
        this.mapAcif = (MAPContextInterfaceFactory) ctx.lookup("slee/resources/map/2.0/acifactory");
        this.mapProvider = (MAPProvider) ctx.lookup("slee/resources/map/2.0/provider");
        this.mapParameterFactory = this.mapProvider.getMAPParameterFactory();
        this.mapSmsTpduParameterFactory = this.mapProvider.getMAPSmsTpduParameterFactory();
        this.sccpParameterFact = new ParameterFactoryImpl();
    } catch (Exception ne) {
        logger.severe("Could not set SBB context:", ne);
    }
}
Also used : InitialContext(javax.naming.InitialContext) SbbContext(javax.slee.SbbContext) Context(javax.naming.Context) MAPApplicationContext(org.restcomm.protocols.ss7.map.api.MAPApplicationContext) ParameterFactoryImpl(org.restcomm.protocols.ss7.sccp.impl.parameter.ParameterFactoryImpl) InitialContext(javax.naming.InitialContext) MAPException(org.restcomm.protocols.ss7.map.api.MAPException)

Example 4 with MAPProvider

use of org.restcomm.protocols.ss7.map.api.MAPProvider in project smscgateway by RestComm.

the class HomeRoutingCommonSbb method setSbbContext.

@Override
public void setSbbContext(SbbContext sbbContext) {
    this.sbbContext = (SbbContextExt) sbbContext;
    try {
        Context ctx = (Context) new InitialContext().lookup("java:comp/env");
        this.mapAcif = (MAPContextInterfaceFactory) ctx.lookup("slee/resources/map/2.0/acifactory");
        this.mapProvider = (MAPProvider) ctx.lookup("slee/resources/map/2.0/provider");
        this.mapParameterFactory = this.mapProvider.getMAPParameterFactory();
        this.mapErrorMessageFactory = this.mapProvider.getMAPErrorMessageFactory();
        this.sccpParameterFact = new ParameterFactoryImpl();
        // this.smppServerSessions = (SmppSessions) ctx
        // .lookup("slee/resources/smpp/server/1.0/provider");
        this.persistence = (PersistenceRAInterface) this.sbbContext.getResourceAdaptorInterface(PERSISTENCE_ID, PERSISTENCE_LINK);
        this.logger = this.sbbContext.getTracer(this.className);
        itsMProcRa = (MProcRuleRaProvider) this.sbbContext.getResourceAdaptorInterface(MPROC_RATYPE_ID, MPROC_RA_LINK);
    } catch (Exception ne) {
        logger.severe("Could not set SBB context:", ne);
    }
// TODO : Handle proper error
}
Also used : Context(javax.naming.Context) InitialContext(javax.naming.InitialContext) SbbContext(javax.slee.SbbContext) RolledBackContext(javax.slee.RolledBackContext) ParameterFactoryImpl(org.restcomm.protocols.ss7.sccp.impl.parameter.ParameterFactoryImpl) InitialContext(javax.naming.InitialContext) CreateException(javax.slee.CreateException)

Example 5 with MAPProvider

use of org.restcomm.protocols.ss7.map.api.MAPProvider in project smscgateway by RestComm.

the class AlertSbb method setSbbContext.

@Override
public void setSbbContext(SbbContext sbbContext) {
    this.sbbContext = (SbbContextExt) sbbContext;
    try {
        Context ctx = (Context) new InitialContext().lookup("java:comp/env");
        this.mapAcif = (MAPContextInterfaceFactory) ctx.lookup("slee/resources/map/2.0/acifactory");
        this.mapProvider = (MAPProvider) ctx.lookup("slee/resources/map/2.0/provider");
        this.mapParameterFactory = this.mapProvider.getMAPParameterFactory();
        this.logger = this.sbbContext.getTracer(AlertSbb.class.getSimpleName());
        this.persistence = (PersistenceRAInterface) this.sbbContext.getResourceAdaptorInterface(PERSISTENCE_ID, PERSISTENCE_LINK);
        this.scheduler = (SchedulerRaSbbInterface) this.sbbContext.getResourceAdaptorInterface(SCHEDULER_ID, SCHEDULER_LINK);
    } catch (Exception ne) {
        logger.severe("Could not set SBB context:", ne);
    }
}
Also used : InitialContext(javax.naming.InitialContext) EventContext(javax.slee.EventContext) SbbContext(javax.slee.SbbContext) Context(javax.naming.Context) RolledBackContext(javax.slee.RolledBackContext) MAPApplicationContext(org.restcomm.protocols.ss7.map.api.MAPApplicationContext) InitialContext(javax.naming.InitialContext) CreateException(javax.slee.CreateException) PersistenceException(org.mobicents.smsc.cassandra.PersistenceException) MAPException(org.restcomm.protocols.ss7.map.api.MAPException)

Aggregations

Context (javax.naming.Context)5 InitialContext (javax.naming.InitialContext)5 SbbContext (javax.slee.SbbContext)5 CreateException (javax.slee.CreateException)3 EventContext (javax.slee.EventContext)3 RolledBackContext (javax.slee.RolledBackContext)3 MAPApplicationContext (org.restcomm.protocols.ss7.map.api.MAPApplicationContext)3 MAPException (org.restcomm.protocols.ss7.map.api.MAPException)3 ParameterFactoryImpl (org.restcomm.protocols.ss7.sccp.impl.parameter.ParameterFactoryImpl)3 RecoverablePduException (com.cloudhopper.smpp.type.RecoverablePduException)1 CharacterCodingException (java.nio.charset.CharacterCodingException)1 PersistenceException (org.mobicents.smsc.cassandra.PersistenceException)1 SmscProcessingException (org.mobicents.smsc.library.SmscProcessingException)1 MAPProvider (org.restcomm.protocols.ss7.map.api.MAPProvider)1