protected SessionTermRequest createSessionTermRequest(Request request) { return new SessionTermRequestImpl(request); }
protected SessionTermRequest createSessionTermRequest(Request request) { return new SessionTermRequestImpl(request); }
public void sendSessionTerminationRequest(SessionTerminationRequest request) throws IOException { try { //super.sendMessage(request); DiameterMessageImpl msg = (DiameterMessageImpl) request; this.clientSession.sendSessionTerminationRequest(new SessionTermRequestImpl(msg.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 sendGqSessionTerminationRequest(GqSessionTerminationRequest str) throws IOException { if (this.state != GqSessionState.OPEN && this.state != GqSessionState.PENDING) throw new DiameterException("Failed to validate, wrong state: " + this.state); DiameterMessageImpl msg = (DiameterMessageImpl) str; try { session.sendSessionTerminationRequest(new SessionTermRequestImpl((Request) 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() { if (request != null) { try { sendAndStateLock.lock(); if (request.getCommandCode() == factory.getAuthMessageCommandCode()) { handleEvent(new Event(RECEIVE_AUTH_REQUEST, factory.createAuthRequest(request))); } else if (request.getCommandCode() == SessionTermRequest.code) { handleEvent(new Event(RECEIVE_STR_REQUEST, new SessionTermRequestImpl(request))); } else { listener.doOtherEvent(session, factory.createAuthRequest(request), null); } } catch (Exception e) { logger.debug("Can not handle event", e); } finally { sendAndStateLock.unlock(); } } } }