@Override public String getSessionId() { //use local object, its faster :) return this.session.getSessionId(); }
protected void dispatchEvent(AppEvent event) throws InternalException { try { session.send(event.getMessage(), this); // Store last destination information } catch (Exception e) { //throw new InternalException(e); logger.debug("Failure trying to dispatch event", e); } }
@Override public boolean isValid() { return session == null ? false : session.isValid(); }
@Override public void release() { logger.debug("Releasing application session for Session ID '{}' ({}).", getSessionId(), getSessionAppId()); this.session.setRequestListener(null); this.session.release(); this.appSessionData.remove(); }
public String sendMessage(Message message) { try { Avp sessionId = null; Session session = null; if((sessionId = message.getAvps().getAvp(Avp.SESSION_ID)) == null) { session = stack.getSessionFactory().getNewSession(); } else { session = stack.getSessionFactory().getNewSession(sessionId.getUTF8String()); } session.send(message); return session.getSessionId(); } catch (Exception e) { logger.error("", e); } return null; }
public boolean handleEvent(StateEvent event) throws InternalException, OverloadException { try { sendAndStateLock.lock(); if (!super.session.isValid()) { super.session.send(((AppEvent) event.getData()).getMessage(), this); super.session.send(((AppEvent) event.getData()).getMessage(), this); } finally { newState = SLhSessionState.TERMINATED;
@Override public void sendAccountAnswer(AccountAnswer accountAnswer) throws InternalException, IllegalStateException, RouteException, OverloadException { try { AvpSet avpSet = accountAnswer.getMessage().getAvps(); Avp acctInterimIntervalAvp = avpSet.getAvp(Avp.ACCT_INTERIM_INTERVAL); //Unsigned32 if (acctInterimIntervalAvp != null) { try { this.sessionData.setTsTimeout(acctInterimIntervalAvp.getUnsigned32()); } catch (AvpDataException e) { throw new InternalException(e); } } cancelTsTimer(); startTsTimer(); session.send(accountAnswer.getMessage()); /* TODO: Do we need to notify state change ? */ if (isStateless() && isValid()) { session.release(); } } catch (IllegalDiameterStateException e) { throw new IllegalStateException(e); } }
public void endActivity() { //TODO: check if this should be synced to ensure calls from SBBs work properly. this.setTerminateAfterProcessing(false); this.baseListener.stopActivityRemoveTimer((DiameterActivityHandle) handle); if(session != null) { session.release(); } try { //endpoint.endActivity(this.getActivityHandle()); this.baseListener.endActivity(this.getActivityHandle()); } catch (Exception e) { logger.error("Failed to end activity [" + this + "].", e); } }
public String sendMessage(Message message) { try { Avp sessionId = null; Session session = null; if((sessionId = message.getAvps().getAvp(Avp.SESSION_ID)) == null) { session = stack.getSessionFactory().getNewSession(); } else { session = stack.getSessionFactory().getNewSession(sessionId.getUTF8String()); } session.send(message); return session.getSessionId(); } catch (Exception e) { logger.error("", e); } return null; }
public String getSessionId() { return session.getSessionId(); }
@Override public String sendMessage(Message message) { try { Avp sessionId = null; Session session = null; if ((sessionId = message.getAvps().getAvp(Avp.SESSION_ID)) == null) { session = stack.getSessionFactory().getNewSession(); } else { session = stack.getSessionFactory().getNewSession(sessionId.getUTF8String()); } session.send(message); return session.getSessionId(); } catch (Exception e) { logger.error("", e); } return null; }
protected void dispatchEvent(AppEvent event) throws InternalException { try { session.send(event.getMessage(), this); // FIXME: add differentiation on server/client request } catch (Exception e) { logger.debug("Failed to dispatch event", e); } }
try { sendAndStateLock.lock(); if (!super.session.isValid()) { super.session.send(((AppEvent) event.getData()).getMessage(), this); newState = S13SessionState.MESSAGE_SENT_RECEIVED; setState(newState); super.session.send(((AppEvent) event.getData()).getMessage(), this); } finally { newState = S13SessionState.TERMINATED;
public boolean isValid() { return this.session.isValid(); }
public String getSessionId() { return session.getSessionId(); }
protected void dispatchEvent(AppEvent event) throws InternalException { try { session.send(event.getMessage(), this); } catch (Exception e) { //throw new InternalException(e); logger.debug("Failure trying to dispatch event", e); } }
try { sendAndStateLock.lock(); if (!super.session.isValid()) { super.session.send(((AppEvent) event.getData()).getMessage(), this); newState = SLhSessionState.MESSAGE_SENT_RECEIVED; setState(newState); super.session.send(((AppEvent) event.getData()).getMessage(), this); } finally { newState = SLhSessionState.TERMINATED;
public void setCurrentWorkingSession(Session session) { this.sessionId = session.getSessionId(); this.session = session; if (this.handle == null) { this.handle = new DiameterActivityHandle(this.sessionId); } }
protected void dispatchEvent(AppEvent event) throws InternalException { try { session.send(event.getMessage(), this); // Store last destination information // FIXME: add differentiation on server/client request //originRealm = event.getMessage().getAvps().getAvp(Avp.ORIGIN_REALM).getOctetString(); //originHost = event.getMessage().getAvps().getAvp(Avp.ORIGIN_HOST).getOctetString(); } catch (Exception e) { //throw new InternalException(e); logger.debug("Failure trying to dispatch event", e); } }