use of org.mobicents.slee.resource.diameter.base.DiameterMessageFactoryImpl in project jain-slee.diameter by RestComm.
the class DiameterCCAResourceAdaptor method sessionCreated.
// CCA Session Creation Listener --------------------------------------
private void sessionCreated(ClientCCASession ccClientSession) {
// Make sure it's a new session and there's no activity created yet.
if (this.getActivity(getActivityHandle(ccClientSession.getSessions().get(0).getSessionId())) != null) {
tracer.warning("Activity found for created Credit-Control Client Session. Shouldn't exist. Aborting.");
return;
}
// Get Message Factories (for Base and CCA)
DiameterMessageFactoryImpl baseMsgFactory = new DiameterMessageFactoryImpl(ccClientSession.getSessions().get(0), this.stack);
CreditControlMessageFactory ccaMsgFactory = new CreditControlMessageFactoryImpl(baseMsgFactory, ccClientSession.getSessions().get(0), this.stack, this.ccaAvpFactory);
// Create Client Activity
CreditControlClientSessionImpl activity = new CreditControlClientSessionImpl(ccaMsgFactory, this.ccaAvpFactory, ccClientSession, null, null);
// session.addStateChangeNotification(activity);
activity.setSessionListener(this);
activityCreated(activity, false);
}
use of org.mobicents.slee.resource.diameter.base.DiameterMessageFactoryImpl in project jain-slee.diameter by RestComm.
the class DiameterCxDxResourceAdaptor method sessionCreated.
/*
* (non-Javadoc)
* @see org.mobicents.slee.resource.diameter.cxdx.handlers.CxDxSessionCreationListener#sessionCreated(org.jdiameter.api.cxdx.ClientCxDxSession)
*/
public void sessionCreated(ClientCxDxSession session) {
DiameterMessageFactoryImpl baseMsgFactory = new DiameterMessageFactoryImpl(session.getSessions().get(0), stack);
CxDxMessageFactoryImpl sessionMsgFactory = new CxDxMessageFactoryImpl(baseMsgFactory, session.getSessions().get(0), stack, new DiameterIdentity[] {});
// Set the first configured Application-Id as default for message factory
ApplicationId firstAppId = authApplicationIds.get(0);
sessionMsgFactory.setApplicationId(firstAppId.getVendorId(), firstAppId.getAuthAppId());
CxDxClientSessionImpl clientActivity = new CxDxClientSessionImpl(sessionMsgFactory, cxdxAvpFactory, session, this, null, null, sleeEndpoint);
// session.addStateChangeNotification(clientActivity);
// addActivity(clientActivity);
clientActivity.setSessionListener(this);
}
use of org.mobicents.slee.resource.diameter.base.DiameterMessageFactoryImpl in project jain-slee.diameter by RestComm.
the class DiameterCxDxResourceAdaptor method sessionCreated.
/*
* (non-Javadoc)
* @see org.mobicents.slee.resource.diameter.cxdx.handlers.CxDxSessionCreationListener#sessionCreated(org.jdiameter.api.Session)
*/
public void sessionCreated(Session session) {
DiameterMessageFactoryImpl sessionMsgFactory = new DiameterMessageFactoryImpl(session, stack, null, null);
DiameterActivityImpl activity = new DiameterActivityImpl(sessionMsgFactory, baseAvpFactory, session, this, null, null);
// TODO: Do we need to manage session?
// session.addStateChangeNotification(activity);
activity.setSessionListener(this);
addActivity(activity, false);
}
use of org.mobicents.slee.resource.diameter.base.DiameterMessageFactoryImpl in project jain-slee.diameter by RestComm.
the class DiameterGqResourceAdaptor method sessionCreated.
public void sessionCreated(GqServerSession serverSession) {
// Make sure it's a new session and there's no activity created yet.
if (this.getActivity(getActivityHandle(serverSession.getSessions().get(0).getSessionId())) != null) {
tracer.warning("Activity found for created Credit-Control Server Session. Shouldn't exist. Aborting.");
return;
}
// Get Message Factories (for Base and Gq)
DiameterMessageFactoryImpl baseMsgFactory = new DiameterMessageFactoryImpl(serverSession.getSessions().get(0), this.stack);
// RoMessageFactoryImpl ccaMsgFactory = new RoMessageFactoryImpl(baseMsgFactory, ccClientSession.getSessionId(), this.stack);
// Create Server Activity
GqServerSessionActivityImpl activity = new GqServerSessionActivityImpl(baseMsgFactory, this.baseAvpFactory, serverSession, null, null, stack);
// Update Session Activity FSM to allow correct requests/responses
serverSession.addStateChangeNotification(activity);
activity.setSessionListener(this);
addActivity(activity, false);
}
use of org.mobicents.slee.resource.diameter.base.DiameterMessageFactoryImpl in project jain-slee.diameter by RestComm.
the class DiameterRoResourceAdaptor method raActive.
public void raActive() {
if (tracer.isFineEnabled()) {
tracer.fine("Diameter Ro RA :: raActive.");
}
try {
if (tracer.isInfoEnabled()) {
tracer.info("Activating Diameter Ro RA Entity");
}
this.diameterMultiplexerObjectName = new ObjectName("diameter.mobicents:service=DiameterStackMultiplexer");
Object object = null;
if (ManagementFactory.getPlatformMBeanServer().isRegistered(this.diameterMultiplexerObjectName)) {
// trying to get via MBeanServer
object = ManagementFactory.getPlatformMBeanServer().invoke(this.diameterMultiplexerObjectName, "getMultiplexerMBean", new Object[] {}, new String[] {});
if (tracer.isInfoEnabled()) {
tracer.info("Trying to get via Platform MBeanServer: " + this.diameterMultiplexerObjectName + ", object: " + object);
}
} else {
// trying to get via locateJBoss
object = MBeanServerLocator.locateJBoss().invoke(this.diameterMultiplexerObjectName, "getMultiplexerMBean", new Object[] {}, new String[] {});
if (tracer.isInfoEnabled()) {
tracer.info("Trying to get via JBoss MBeanServer: " + this.diameterMultiplexerObjectName + ", object: " + object);
}
}
if (object != null && object instanceof DiameterStackMultiplexerMBean) {
this.diameterMux = (DiameterStackMultiplexerMBean) object;
}
// this.activities = new ConcurrentHashMap<ActivityHandle, DiameterActivity>();
// Initialize the protocol stack
initStack();
// Initialize activities mgmt
initActivitiesMgmt();
// Initialize factories
this.baseAvpFactory = new DiameterAvpFactoryImpl();
this.baseMessageFactory = new DiameterMessageFactoryImpl(stack);
this.roAvpFactory = new RoAvpFactoryImpl(baseAvpFactory);
this.roMessageFactory = new RoMessageFactoryImpl(baseMessageFactory, null, stack);
// Set the first configured Application-Id as default for message factory
ApplicationId firstAppId = authApplicationIds.get(0);
((RoMessageFactoryImpl) this.roMessageFactory).setApplicationId(firstAppId.getVendorId(), firstAppId.getAuthAppId());
this.sessionFactory = this.stack.getSessionFactory();
this.ccaSessionFactory = new RoSessionFactory(this, sessionFactory, defaultDirectDebitingFailureHandling, defaultCreditControlFailureHandling, defaultValidityTime, defaultTxTimerValue);
// Register CCA App Session Factories
((ISessionFactory) sessionFactory).registerAppFacory(ServerRoSession.class, this.ccaSessionFactory);
((ISessionFactory) sessionFactory).registerAppFacory(ClientRoSession.class, this.ccaSessionFactory);
} catch (Exception e) {
tracer.severe("Error Activating Diameter Ro RA Entity", e);
}
}
Aggregations