protected AbortSessionAnswer createAbortSessionAnswer(Answer answer) { return new AbortSessionAnswerImpl(answer); }
protected AbortSessionAnswer createAbortSessionAnswer(Answer answer) { return new AbortSessionAnswerImpl(answer); }
public void sendAbortSessionAnswer(AbortSessionAnswer answer) throws IOException { try { // super.sendMessage(answer); DiameterMessageImpl asa = (DiameterMessageImpl) answer; this.clientSession.sendAbortSessionAnswer(new AbortSessionAnswerImpl((Answer) asa.getGenericData())); } catch (org.jdiameter.api.validation.AvpNotAllowedException e) { throw new AvpNotAllowedException("Message validation failed.", e, e.getAvpCode(), e.getVendorId()); } catch (Exception e) { throw new IOException("Failed to send message, due to: " + e.getMessage()); } }
@Override public void run() { try { sendAndStateLock.lock(); if (request.getCommandCode() == ReAuthRequest.code) { listener.doReAuthAnswerEvent(session, createReAuthRequest(request), createReAuthAnswer(answer)); } else if (request.getCommandCode() == AbortSessionRequest.code) { handleEvent(new Event(RECEIVE_ASR_ANSWER, new AbortSessionAnswerImpl(answer))); } else { listener.doOtherEvent(session, factory.createAuthRequest(request), new AppAnswerEventImpl(answer)); } } catch (Exception e) { logger.debug("Can not handle event", e); } finally { sendAndStateLock.unlock(); } } }
@Override public void sendGqAbortSessionAnswer(GqAbortSessionAnswer asa) throws IOException { if (this.state == GqSessionState.PENDING) throw new DiameterException("Failed to validate, wrong state: " + this.state); DiameterMessageImpl msg = (DiameterMessageImpl) asa; try { session.sendAbortSessionAnswer(new AbortSessionAnswerImpl((Answer) msg.getGenericData())); } catch (AvpNotAllowedException e) { throw new AvpNotAllowedException("Message validation failed.", e, e.getAvpCode(), e.getVendorId()); } catch (Exception e) { throw new IOException("Failed to send message, due to: " + e); } }
@Override public void run() { try { sendAndStateLock.lock(); if (request.getCommandCode() == factory.getAuthMessageCommandCode()) { handleEvent(new Event(RECEIVE_AUTH_REQUEST, factory.createAuthRequest(request))); } else if (request.getCommandCode() == AbortSessionRequest.code) { handleEvent(new Event(RECEIVE_ASR_ANSWER, new AbortSessionAnswerImpl(answer))); } else { listener.doOtherEvent(session, factory.createAuthRequest(request), new AppAnswerEventImpl(answer)); } } catch (Exception e) { logger.debug("Can not handle event", e); } finally { sendAndStateLock.unlock(); } } }