public Recoder(SessionFactory factory, MetaData metaData) { this.metaData = metaData; try { this.rawSession = (RawSessionImpl) factory.getNewRawSession(); } catch (InternalException e) { throw new IllegalArgumentException(e); } } // =======================================================================================
public Session getNewSession(String sessionId) throws InternalException { Session session = sessionFactory.getNewSession(sessionId); sessionCreated(session); return session; }
public String getSessionId(String customPart) { return sessionFactory.getSessionId(customPart); } };
public <T extends AppSession> T getNewAppSession(String sessionId, ApplicationId applicationId, Class<? extends AppSession> userSession) throws InternalException { return (T)sessionFactory.getNewAppSession(sessionId, applicationId, userSession); }
public <T extends AppSession> T getNewAppSession(ApplicationId applicationId, Class<? extends AppSession> userSession) throws InternalException { return (T)sessionFactory.getNewAppSession(applicationId, userSession); }
protected Message createRawMessage(int commandCode) { try { return stack.getSessionFactory().getNewRawSession().createMessage(commandCode, gqAppId); } catch (IllegalDiameterStateException e) { logger.error("Failed to get session factory for message creation.", e); } catch (InternalException e) { logger.error("Failed to create new raw session for message creation.", e); } return null; }
public Session getNewSession(String sessionId) throws InternalException { Session session = sessionFactory.getNewSession(sessionId); sessionCreated(session); return session; }
public String getSessionId() { return sessionFactory.getSessionId(); }
public <T extends AppSession> T getNewAppSession(String sessionId, ApplicationId applicationId, Class<? extends AppSession> userSession) throws InternalException { return (T)sessionFactory.getNewAppSession(sessionId, applicationId, userSession); }
public RawSession getNewRawSession() throws InternalException { try { return stack.getSessionFactory().getNewRawSession(); } catch ( IllegalDiameterStateException e ) { tracer.severe( "Failure while obtaining Session Factory for new Raw Session.", e ); return null; } }
public Session getNewSession() throws InternalException { Session session = sessionFactory.getNewSession(); sessionCreated(session); return session; }
public String getSessionId(String customPart) { return sessionFactory.getSessionId(customPart); } };
public <T extends AppSession> T getNewAppSession(ApplicationId applicationId, Class<? extends AppSession> userSession) throws InternalException { return (T)sessionFactory.getNewAppSession(applicationId, userSession); }
public RawSession getNewRawSession() throws InternalException { try { return stack.getSessionFactory().getNewRawSession(); } catch ( IllegalDiameterStateException e ) { tracer.severe( "Failure while obtaining Session Factory for new Raw Session.", e ); return null; } }
public Session getNewSession() throws InternalException { Session session = sessionFactory.getNewSession(); sessionCreated(session); return session; }
public String getSessionId() { return sessionFactory.getSessionId(); }
public Message createMessage(boolean isRequest, int commandCode, long applicationId) { try { Message message = this.stack.getSessionFactory().getNewRawSession().createMessage(commandCode, org.jdiameter.api.ApplicationId.createByAccAppId(applicationId), new Avp[]{}); message.setRequest(isRequest); return message; } catch (Exception e) { logger.error("Failure while creating message.", e); } return null; }
public net.java.slee.resource.diameter.sh.events.ProfileUpdateAnswer profileUpdateRequest(ProfileUpdateRequest message) throws IOException { // This is sync, we dont care about activities or FSM, someone else should care... if (message == null) { throw new IOException("Cant send null message"); } try { String sessionID = message.getSessionId(); if (sessionID == null) { throw new IllegalArgumentException("Session Id must not be null."); } Session session = stack.getSessionFactory().getNewSession(sessionID); Future<Message> f = session.send(((DiameterMessageImpl) message).getGenericData()); return new ProfileUpdateAnswerImpl(f.get()); } catch (AvpNotAllowedException e) { throw e; } catch (Exception e) { throw new IOException("Failed to send due to: " + e.getLocalizedMessage()); } }
SessionImpl(IContainer container) { setContainer(container); try { sessionId = container.getSessionFactory().getSessionId(); } catch (IllegalDiameterStateException idse) { throw new IllegalStateException("Unable to generate Session-Id", idse); } }
public Message createMessage(boolean isRequest, int commandCode, long applicationId) { try { Message message = this.stack.getSessionFactory().getNewRawSession().createMessage(commandCode, org.jdiameter.api.ApplicationId.createByAccAppId(applicationId), new Avp[]{}); message.setRequest(isRequest); return message; } catch (Exception e) { logger.error("Failure while creating message.", e); } return null; }