PageRenderTime 61ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/servers/diameter/core/jdiameter/impl/src/main/java/org/jdiameter/common/impl/app/cxdx/CxDxSessionFactoryImpl.java

http://mobicents.googlecode.com/
Java | 558 lines | 278 code | 62 blank | 218 comment | 41 complexity | 4907d4559e6fccbe749f777d55726f6b MD5 | raw file
Possible License(s): LGPL-3.0, GPL-3.0, LGPL-2.1, GPL-2.0, CC-BY-SA-3.0, CC0-1.0, Apache-2.0, BSD-3-Clause
  1. /*
  2. * JBoss, Home of Professional Open Source
  3. * Copyright 2009, Red Hat, Inc. and individual contributors
  4. * by the @authors tag. See the copyright.txt in the distribution for a
  5. * full listing of individual contributors.
  6. *
  7. * This is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU Lesser General Public License as
  9. * published by the Free Software Foundation; either version 2.1 of
  10. * the License, or (at your option) any later version.
  11. *
  12. * This software is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with this software; if not, write to the Free
  19. * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  20. * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  21. */
  22. package org.jdiameter.common.impl.app.cxdx;
  23. import org.jdiameter.api.Answer;
  24. import org.jdiameter.api.ApplicationId;
  25. import org.jdiameter.api.IllegalDiameterStateException;
  26. import org.jdiameter.api.InternalException;
  27. import org.jdiameter.api.OverloadException;
  28. import org.jdiameter.api.Request;
  29. import org.jdiameter.api.RouteException;
  30. import org.jdiameter.api.SessionFactory;
  31. import org.jdiameter.api.acc.ClientAccSession;
  32. import org.jdiameter.api.acc.ServerAccSession;
  33. import org.jdiameter.api.app.AppAnswerEvent;
  34. import org.jdiameter.api.app.AppRequestEvent;
  35. import org.jdiameter.api.app.AppSession;
  36. import org.jdiameter.api.app.StateChangeListener;
  37. import org.jdiameter.api.cxdx.ClientCxDxSession;
  38. import org.jdiameter.api.cxdx.ClientCxDxSessionListener;
  39. import org.jdiameter.api.cxdx.ServerCxDxSession;
  40. import org.jdiameter.api.cxdx.ServerCxDxSessionListener;
  41. import org.jdiameter.api.cxdx.events.JLocationInfoAnswer;
  42. import org.jdiameter.api.cxdx.events.JLocationInfoRequest;
  43. import org.jdiameter.api.cxdx.events.JMultimediaAuthAnswer;
  44. import org.jdiameter.api.cxdx.events.JMultimediaAuthRequest;
  45. import org.jdiameter.api.cxdx.events.JPushProfileAnswer;
  46. import org.jdiameter.api.cxdx.events.JPushProfileRequest;
  47. import org.jdiameter.api.cxdx.events.JRegistrationTerminationAnswer;
  48. import org.jdiameter.api.cxdx.events.JRegistrationTerminationRequest;
  49. import org.jdiameter.api.cxdx.events.JServerAssignmentAnswer;
  50. import org.jdiameter.api.cxdx.events.JServerAssignmentRequest;
  51. import org.jdiameter.api.cxdx.events.JUserAuthorizationAnswer;
  52. import org.jdiameter.api.cxdx.events.JUserAuthorizationRequest;
  53. import org.jdiameter.client.api.ISessionFactory;
  54. import org.jdiameter.client.impl.app.cxdx.CxDxClientSessionImpl;
  55. import org.jdiameter.client.impl.app.cxdx.IClientCxDxSessionData;
  56. import org.jdiameter.common.api.app.IAppSessionDataFactory;
  57. import org.jdiameter.common.api.app.cxdx.ICxDxMessageFactory;
  58. import org.jdiameter.common.api.app.cxdx.ICxDxSessionData;
  59. import org.jdiameter.common.api.app.cxdx.ICxDxSessionFactory;
  60. import org.jdiameter.common.api.data.ISessionDatasource;
  61. import org.jdiameter.server.impl.app.cxdx.CxDxServerSessionImpl;
  62. import org.jdiameter.server.impl.app.cxdx.IServerCxDxSessionData;
  63. import org.slf4j.Logger;
  64. import org.slf4j.LoggerFactory;
  65. /**
  66. *
  67. * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a>
  68. * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a>
  69. */
  70. public class CxDxSessionFactoryImpl implements ICxDxSessionFactory, ClientCxDxSessionListener, ServerCxDxSessionListener,
  71. ICxDxMessageFactory, StateChangeListener<AppSession> {
  72. private static final Logger logger = LoggerFactory.getLogger(CxDxSessionFactoryImpl.class);
  73. protected ISessionFactory sessionFactory;
  74. protected ClientCxDxSessionListener clientSessionListener;
  75. protected ServerCxDxSessionListener serverSessionListener;
  76. protected ICxDxMessageFactory messageFactory;
  77. protected StateChangeListener<AppSession> stateListener;
  78. protected ISessionDatasource iss;
  79. protected IAppSessionDataFactory<ICxDxSessionData> sessionDataFactory;
  80. public CxDxSessionFactoryImpl(SessionFactory sessionFactory) {
  81. super();
  82. this.sessionFactory = (ISessionFactory) sessionFactory;
  83. this.iss = this.sessionFactory.getContainer().getAssemblerFacility().getComponentInstance(ISessionDatasource.class);
  84. this.sessionDataFactory = (IAppSessionDataFactory<ICxDxSessionData>) this.iss.getDataFactory(ICxDxSessionData.class);
  85. }
  86. /**
  87. * @return the clientSessionListener
  88. */
  89. public ClientCxDxSessionListener getClientSessionListener() {
  90. if (clientSessionListener != null) {
  91. return clientSessionListener;
  92. }
  93. else {
  94. return this;
  95. }
  96. }
  97. /**
  98. * @param clientSessionListener
  99. * the clientSessionListener to set
  100. */
  101. public void setClientSessionListener(ClientCxDxSessionListener clientSessionListener) {
  102. this.clientSessionListener = clientSessionListener;
  103. }
  104. /**
  105. * @return the serverSessionListener
  106. */
  107. public ServerCxDxSessionListener getServerSessionListener() {
  108. if (serverSessionListener != null) {
  109. return serverSessionListener;
  110. }
  111. else {
  112. return this;
  113. }
  114. }
  115. /**
  116. * @param serverSessionListener
  117. * the serverSessionListener to set
  118. */
  119. public void setServerSessionListener(ServerCxDxSessionListener serverSessionListener) {
  120. this.serverSessionListener = serverSessionListener;
  121. }
  122. /**
  123. * @return the messageFactory
  124. */
  125. public ICxDxMessageFactory getMessageFactory() {
  126. if (messageFactory != null) {
  127. return messageFactory;
  128. }
  129. else {
  130. return this;
  131. }
  132. }
  133. /**
  134. * @param messageFactory
  135. * the messageFactory to set
  136. */
  137. public void setMessageFactory(ICxDxMessageFactory messageFactory) {
  138. this.messageFactory = messageFactory;
  139. }
  140. /**
  141. * @return the stateListener
  142. */
  143. public StateChangeListener<AppSession> getStateListener() {
  144. if (stateListener != null) {
  145. return stateListener;
  146. }
  147. else {
  148. return this;
  149. }
  150. }
  151. /**
  152. * @param stateListener
  153. * the stateListener to set
  154. */
  155. public void setStateListener(StateChangeListener<AppSession> stateListener) {
  156. this.stateListener = stateListener;
  157. }
  158. @Override
  159. public AppSession getSession(String sessionId, Class<? extends AppSession> aClass) {
  160. if (sessionId == null) {
  161. throw new IllegalArgumentException("SessionId must not be null");
  162. }
  163. if (!this.iss.exists(sessionId)) {
  164. return null;
  165. }
  166. AppSession appSession = null;
  167. try {
  168. if (aClass == ClientCxDxSession.class) {
  169. IClientCxDxSessionData sessionData = (IClientCxDxSessionData) this.sessionDataFactory.getAppSessionData(ClientCxDxSession.class, sessionId);
  170. CxDxClientSessionImpl clientSession = new CxDxClientSessionImpl(sessionData, this.getMessageFactory(), this.sessionFactory,
  171. this.getClientSessionListener());
  172. clientSession.getSessions().get(0).setRequestListener(clientSession);
  173. appSession = clientSession;
  174. }
  175. else if (aClass == ServerCxDxSession.class) {
  176. IServerCxDxSessionData sessionData = (IServerCxDxSessionData) this.sessionDataFactory.getAppSessionData(ServerCxDxSession.class, sessionId);
  177. CxDxServerSessionImpl serverSession = new CxDxServerSessionImpl(sessionData, getMessageFactory(), sessionFactory,
  178. this.getServerSessionListener());
  179. serverSession.getSessions().get(0).setRequestListener(serverSession);
  180. appSession = serverSession;
  181. }
  182. else {
  183. throw new IllegalArgumentException("Wrong session class: " + aClass + ". Supported[" + ClientAccSession.class + "," + ServerAccSession.class + "]");
  184. }
  185. }
  186. catch (Exception e) {
  187. logger.error("Failure to obtain new Cx/Dx Session.", e);
  188. }
  189. return appSession;
  190. }
  191. /*
  192. * (non-Javadoc)
  193. *
  194. * @see
  195. * org.jdiameter.common.api.app.IAppSessionFactory#getNewSession(java.lang
  196. * .String, java.lang.Class, org.jdiameter.api.ApplicationId,
  197. * java.lang.Object[])
  198. */
  199. public AppSession getNewSession(String sessionId, Class<? extends AppSession> aClass, ApplicationId applicationId, Object[] args) {
  200. AppSession appSession = null;
  201. if (aClass == ClientCxDxSession.class) {
  202. if (sessionId == null) {
  203. if (args != null && args.length > 0 && args[0] instanceof Request) {
  204. Request request = (Request) args[0];
  205. sessionId = request.getSessionId();
  206. }
  207. else {
  208. sessionId = this.sessionFactory.getSessionId();
  209. }
  210. }
  211. IClientCxDxSessionData sessionData = (IClientCxDxSessionData) this.sessionDataFactory.getAppSessionData(ClientCxDxSession.class, sessionId);
  212. sessionData.setApplicationId(applicationId);
  213. CxDxClientSessionImpl clientSession = new CxDxClientSessionImpl(sessionData, this.getMessageFactory(), this.sessionFactory, this
  214. .getClientSessionListener());
  215. iss.addSession(clientSession);
  216. clientSession.getSessions().get(0).setRequestListener(clientSession);
  217. appSession = clientSession;
  218. }
  219. else if (aClass == ServerCxDxSession.class) {
  220. if (sessionId == null) {
  221. if (args != null && args.length > 0 && args[0] instanceof Request) {
  222. Request request = (Request) args[0];
  223. sessionId = request.getSessionId();
  224. }
  225. else {
  226. sessionId = this.sessionFactory.getSessionId();
  227. }
  228. }
  229. IServerCxDxSessionData sessionData = (IServerCxDxSessionData) this.sessionDataFactory.getAppSessionData(ServerCxDxSession.class, sessionId);
  230. sessionData.setApplicationId(applicationId);
  231. CxDxServerSessionImpl serverSession = new CxDxServerSessionImpl(sessionData, getMessageFactory(),sessionFactory, this.getServerSessionListener());
  232. iss.addSession(serverSession);
  233. serverSession.getSessions().get(0).setRequestListener(serverSession);
  234. appSession = serverSession;
  235. }
  236. else {
  237. throw new IllegalArgumentException("Wrong session class: " + aClass + ". Supported[" + ServerCxDxSession.class + "," + ClientCxDxSession.class + "]");
  238. }
  239. return appSession;
  240. }
  241. // Cx/Dx Message Factory Methods ------------------------------------------
  242. /*
  243. * (non-Javadoc)
  244. *
  245. * @see org.jdiameter.common.api.app.cxdx.ICxDxMessageFactory#createLocationInfoAnswer(org.jdiameter.api.Answer)
  246. */
  247. public JLocationInfoAnswer createLocationInfoAnswer(Answer answer) {
  248. return new JLocationInfoAnswerImpl(answer);
  249. }
  250. /*
  251. * (non-Javadoc)
  252. *
  253. * @see org.jdiameter.common.api.app.cxdx.ICxDxMessageFactory#createLocationInfoRequest(org.jdiameter.api.Request)
  254. */
  255. public JLocationInfoRequest createLocationInfoRequest(Request request) {
  256. return new JLocationInfoRequestImpl(request);
  257. }
  258. /*
  259. * (non-Javadoc)
  260. *
  261. * @see org.jdiameter.common.api.app.cxdx.ICxDxMessageFactory#createMultimediaAuthAnswer(org.jdiameter.api.Answer)
  262. */
  263. public JMultimediaAuthAnswer createMultimediaAuthAnswer(Answer answer) {
  264. return new JMultimediaAuthAnswerImpl(answer);
  265. }
  266. /*
  267. * (non-Javadoc)
  268. *
  269. * @see org.jdiameter.common.api.app.cxdx.ICxDxMessageFactory#createMultimediaAuthRequest(org.jdiameter.api.Request)
  270. */
  271. public JMultimediaAuthRequest createMultimediaAuthRequest(Request request) {
  272. return new JMultimediaAuthRequestImpl(request);
  273. }
  274. /*
  275. * (non-Javadoc)
  276. *
  277. * @see org.jdiameter.common.api.app.cxdx.ICxDxMessageFactory#createPushProfileAnswer(org.jdiameter.api.Answer)
  278. */
  279. public JPushProfileAnswer createPushProfileAnswer(Answer answer) {
  280. return new JPushProfileAnswerImpl(answer);
  281. }
  282. /*
  283. * (non-Javadoc)
  284. *
  285. * @seeorg.jdiameter.common.api.app.cxdx.ICxDxMessageFactory#createPushProfileRequest(org.jdiameter.api.Request)
  286. */
  287. public JPushProfileRequest createPushProfileRequest(Request request) {
  288. return new JPushProfileRequestImpl(request);
  289. }
  290. /*
  291. * (non-Javadoc)
  292. *
  293. * @see org.jdiameter.common.api.app.cxdx.ICxDxMessageFactory#createRegistrationTerminationAnswer(org.jdiameter.api.Answer)
  294. */
  295. public JRegistrationTerminationAnswer createRegistrationTerminationAnswer(Answer answer) {
  296. return new JRegistrationTerminationAnswerImpl(answer);
  297. }
  298. /*
  299. * (non-Javadoc)
  300. *
  301. * @see org.jdiameter.common.api.app.cxdx.ICxDxMessageFactory#createRegistrationTerminationRequest(org.jdiameter.api.Request)
  302. */
  303. public JRegistrationTerminationRequest createRegistrationTerminationRequest(Request request) {
  304. return new JRegistrationTerminationRequestImpl(request);
  305. }
  306. /*
  307. * (non-Javadoc)
  308. *
  309. * @see org.jdiameter.common.api.app.cxdx.ICxDxMessageFactory#createServerAssignmentAnswer(org.jdiameter.api.Answer)
  310. */
  311. public JServerAssignmentAnswer createServerAssignmentAnswer(Answer answer) {
  312. return new JServerAssignmentAnswerImpl(answer);
  313. }
  314. /*
  315. * (non-Javadoc)
  316. *
  317. * @see org.jdiameter.common.api.app.cxdx.ICxDxMessageFactory#createServerAssignmentRequest(org.jdiameter.api.Request)
  318. */
  319. public JServerAssignmentRequest createServerAssignmentRequest(Request request) {
  320. return new JServerAssignmentRequestImpl(request);
  321. }
  322. /*
  323. * (non-Javadoc)
  324. *
  325. * @see org.jdiameter.common.api.app.cxdx.ICxDxMessageFactory#createUserAuthorizationAnswer(org.jdiameter.api.Answer)
  326. */
  327. public JUserAuthorizationAnswer createUserAuthorizationAnswer(Answer answer) {
  328. return new JUserAuthorizationAnswerImpl(answer);
  329. }
  330. /*
  331. * (non-Javadoc)
  332. *
  333. * @see org.jdiameter.common.api.app.cxdx.ICxDxMessageFactory#createUserAuthorizationRequest(org.jdiameter.api.Request)
  334. */
  335. public JUserAuthorizationRequest createUserAuthorizationRequest(Request request) {
  336. return new JUserAuthorizationRequestImpl(request);
  337. }
  338. /*
  339. * (non-Javadoc)
  340. *
  341. * @see org.jdiameter.common.api.app.cxdx.ICxDxMessageFactory#getApplicationId()
  342. */
  343. public long getApplicationId() {
  344. return 16777216;
  345. }
  346. // Session Listeners --------------------------------------------------------
  347. /*
  348. * (non-Javadoc)
  349. *
  350. * @see org.jdiameter.api.cxdx.ServerCxDxSessionListener#doLocationInformationRequest(
  351. * org.jdiameter.api.cxdx.ServerCxDxSession, org.jdiameter.api.cxdx.events.JLocationInfoRequest)
  352. */
  353. public void doLocationInformationRequest(ServerCxDxSession appSession, JLocationInfoRequest request)
  354. throws InternalException, IllegalDiameterStateException, RouteException, OverloadException {
  355. logger.info("Diameter Cx/Dx Session Factory :: doLocationInformationRequest :: appSession[{}], Request[{}]", appSession, request);
  356. }
  357. /*
  358. * (non-Javadoc)
  359. *
  360. * @see org.jdiameter.api.cxdx.ServerCxDxSessionListener#doMultimediaAuthRequest(
  361. * org.jdiameter.api.cxdx.ServerCxDxSession, org.jdiameter.api.cxdx.events.JMultimediaAuthRequest)
  362. */
  363. public void doMultimediaAuthRequest(ServerCxDxSession appSession, JMultimediaAuthRequest request)
  364. throws InternalException, IllegalDiameterStateException, RouteException, OverloadException {
  365. logger.info("Diameter Cx/Dx Session Factory :: doMultimediaAuthRequest :: appSession[{}], Request[{}]", appSession, request);
  366. }
  367. /*
  368. * (non-Javadoc)
  369. *
  370. * @see org.jdiameter.api.cxdx.ServerCxDxSessionListener#doOtherEvent(org.jdiameter.api.app.AppSession,
  371. * org.jdiameter.api.app.AppRequestEvent, org.jdiameter.api.app.AppAnswerEvent)
  372. */
  373. public void doOtherEvent(AppSession appSession, AppRequestEvent request, AppAnswerEvent answer)
  374. throws InternalException, IllegalDiameterStateException, RouteException, OverloadException {
  375. logger.info("Diameter Cx/Dx Session Factory :: doOtherEvent :: appSession[{}], Request[{}], Answer[{}]", new Object[]{appSession, request, answer});
  376. }
  377. /*
  378. * (non-Javadoc)
  379. *
  380. * @see org.jdiameter.api.cxdx.ServerCxDxSessionListener#doPushProfileAnswer(org.jdiameter.api.cxdx.ServerCxDxSession,
  381. * org.jdiameter.api.cxdx.events.JPushProfileRequest, org.jdiameter.api.cxdx.events.JPushProfileAnswer)
  382. */
  383. public void doPushProfileAnswer(ServerCxDxSession appSession, JPushProfileRequest request, JPushProfileAnswer answer)
  384. throws InternalException, IllegalDiameterStateException, RouteException, OverloadException {
  385. logger.info("Diameter Cx/Dx Session Factory :: doPushProfileAnswer :: appSession[{}], Request[{}], Answer[{}]", new Object[]{appSession, request, answer});
  386. }
  387. /*
  388. * (non-Javadoc)
  389. *
  390. * @see org.jdiameter.api.cxdx.ServerCxDxSessionListener#doRegistrationTerminationAnswer(org.jdiameter.api.cxdx.ServerCxDxSession,
  391. * org.jdiameter.api.cxdx.events.JRegistrationTerminationRequest, org.jdiameter.api.cxdx.events.JRegistrationTerminationAnswer)
  392. */
  393. public void doRegistrationTerminationAnswer(ServerCxDxSession appSession, JRegistrationTerminationRequest request,
  394. JRegistrationTerminationAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException {
  395. logger.info("Diameter Cx/Dx Session Factory :: doRegistrationTerminationAnswer :: appSession[{}], Request[{}], Answer[{}]", new Object[]{appSession, request, answer});
  396. }
  397. /*
  398. * (non-Javadoc)
  399. *
  400. * @see
  401. * org.jdiameter.api.cxdx.ServerCxDxSessionListener#doServerAssignmentRequest(
  402. * org.jdiameter.api.cxdx.ServerCxDxSession, org.jdiameter.api.cxdx.events.JServerAssignmentRequest)
  403. */
  404. public void doServerAssignmentRequest(ServerCxDxSession appSession, JServerAssignmentRequest request)
  405. throws InternalException, IllegalDiameterStateException, RouteException, OverloadException {
  406. logger.info("Diameter Cx/Dx Session Factory :: doServerAssignmentRequest :: appSession[{}], Request[{}]", appSession, request);
  407. }
  408. /*
  409. * (non-Javadoc)
  410. *
  411. * @see org.jdiameter.api.cxdx.ServerCxDxSessionListener#doUserAuthorizationRequest(
  412. * org.jdiameter.api.cxdx.ServerCxDxSession, org.jdiameter.api.cxdx.events.JUserAuthorizationRequest)
  413. */
  414. public void doUserAuthorizationRequest(ServerCxDxSession appSession, JUserAuthorizationRequest request)
  415. throws InternalException, IllegalDiameterStateException, RouteException, OverloadException {
  416. logger.info("Diameter Cx/Dx Session Factory :: doUserAuthorizationRequest :: appSession[{}], Request[{}]", appSession, request);
  417. }
  418. /*
  419. * (non-Javadoc)
  420. *
  421. * @see org.jdiameter.api.cxdx.ClientCxDxSessionListener#doLocationInformationAnswer(org.jdiameter.api.cxdx.ClientCxDxSession,
  422. * org.jdiameter.api.cxdx.events.JLocationInfoRequest, org.jdiameter.api.cxdx.events.JLocationInfoAnswer)
  423. */
  424. public void doLocationInformationAnswer(ClientCxDxSession appSession, JLocationInfoRequest request, JLocationInfoAnswer answer)
  425. throws InternalException, IllegalDiameterStateException, RouteException, OverloadException {
  426. logger.info("Diameter Cx/Dx Session Factory :: doLocationInformationAnswer :: appSession[{}], Request[{}], Answer[{}]", new Object[]{appSession, request, answer});
  427. }
  428. /*
  429. * (non-Javadoc)
  430. *
  431. * @see org.jdiameter.api.cxdx.ClientCxDxSessionListener#doMultimediaAuthAnswer(org.jdiameter.api.cxdx.ClientCxDxSession,
  432. * org.jdiameter.api.cxdx.events.JMultimediaAuthRequest, org.jdiameter.api.cxdx.events.JMultimediaAuthAnswer)
  433. */
  434. public void doMultimediaAuthAnswer(ClientCxDxSession appSession, JMultimediaAuthRequest request, JMultimediaAuthAnswer answer)
  435. throws InternalException, IllegalDiameterStateException, RouteException, OverloadException {
  436. logger.info("Diameter Cx/Dx Session Factory :: doMultimediaAuthAnswer :: appSession[{}], Request[{}], Answer[{}]", new Object[]{appSession, request, answer});
  437. }
  438. /*
  439. * (non-Javadoc)
  440. *
  441. * @see org.jdiameter.api.cxdx.ClientCxDxSessionListener#doPushProfileRequest(
  442. * org.jdiameter.api.cxdx.ClientCxDxSession, org.jdiameter.api.cxdx.events.JPushProfileRequest)
  443. */
  444. public void doPushProfileRequest(ClientCxDxSession appSession, JPushProfileRequest request) throws InternalException,
  445. IllegalDiameterStateException, RouteException, OverloadException {
  446. logger.info("Diameter Cx/Dx Session Factory :: doPushProfileRequest :: appSession[{}], Request[{}]", appSession, request);
  447. }
  448. /*
  449. * (non-Javadoc)
  450. *
  451. * @seeorg.jdiameter.api.cxdx.ClientCxDxSessionListener#doRegistrationTerminationRequest(
  452. * org.jdiameter.api.cxdx.ClientCxDxSession, org.jdiameter.api.cxdx.events.JRegistrationTerminationRequest)
  453. */
  454. public void doRegistrationTerminationRequest(ClientCxDxSession appSession, JRegistrationTerminationRequest request)
  455. throws InternalException, IllegalDiameterStateException, RouteException, OverloadException {
  456. logger.info("Diameter Cx/Dx Session Factory :: doRegistrationTerminationRequest :: appSession[{}], Request[{}]", appSession, request);
  457. }
  458. /*
  459. * (non-Javadoc)
  460. *
  461. * @see org.jdiameter.api.cxdx.ClientCxDxSessionListener#doServerAssignmentAnswer(org.jdiameter.api.cxdx.ClientCxDxSession,
  462. * org.jdiameter.api.cxdx.events.JServerAssignmentRequest, org.jdiameter.api.cxdx.events.JServerAssignmentAnswer)
  463. */
  464. public void doServerAssignmentAnswer(ClientCxDxSession appSession, JServerAssignmentRequest request, JServerAssignmentAnswer answer)
  465. throws InternalException, IllegalDiameterStateException, RouteException, OverloadException {
  466. logger.info("Diameter Cx/Dx Session Factory :: doServerAssignmentAnswer :: appSession[{}], Request[{}], Answer[{}]", new Object[]{appSession, request, answer});
  467. }
  468. /*
  469. * (non-Javadoc)
  470. *
  471. * @see org.jdiameter.api.cxdx.ClientCxDxSessionListener#doUserAuthorizationAnswer(org.jdiameter.api.cxdx.ClientCxDxSession,
  472. * org.jdiameter.api.cxdx.events.JUserAuthorizationRequest, org.jdiameter.api.cxdx.events.JUserAuthorizationAnswer)
  473. */
  474. public void doUserAuthorizationAnswer(ClientCxDxSession appSession, JUserAuthorizationRequest request, JUserAuthorizationAnswer answer)
  475. throws InternalException, IllegalDiameterStateException, RouteException, OverloadException {
  476. logger.info("Diameter Cx/Dx Session Factory :: doUserAuthorizationAnswer :: appSession[{}], Request[{}], Answer[{}]", new Object[]{appSession, request, answer});
  477. }
  478. /*
  479. * (non-Javadoc)
  480. *
  481. * @see org.jdiameter.api.app.StateChangeListener#stateChanged(java.lang.Enum, java.lang.Enum)
  482. */
  483. @SuppressWarnings("unchecked")
  484. public void stateChanged(Enum oldState, Enum newState) {
  485. logger.info("Diameter Cx/Dx Session Factory :: stateChanged :: oldState[{}], newState[{}]", oldState, newState);
  486. }
  487. /*
  488. * (non-Javadoc)
  489. *
  490. * @see org.jdiameter.api.app.StateChangeListener#stateChanged(java.lang.Object, java.lang.Enum, java.lang.Enum)
  491. */
  492. @SuppressWarnings("unchecked")
  493. public void stateChanged(AppSession source, Enum oldState, Enum newState) {
  494. logger.info("Diameter Cx/Dx Session Factory :: stateChanged :: Session, [{}], oldState[{}], newState[{}]", new Object[]{source, oldState, newState});
  495. }
  496. }