private Session givenSession(final String applicationId) { final Application application = new Application(applicationId); final User user = User.builder().withUserId(userId).withAccessToken("accessToken").build(); return Session.builder().withSessionId(sessionId) .withApplication(application).withUser(user).build(); }
private Session getSessionWithIsNew() { return Session.builder() .withApplication(session.getApplication()) .withUser(session.getUser()) .withIsNew(true) .withSessionId(session.getSessionId()) .withAttributes(session.getAttributes()) .build(); }
SpeechletResponse build() { SpeechletResponse response = new SpeechletResponse(); response.setOutputSpeech(speech); response.setCard(card); response.setReprompt(reprompt); response.setDirectives(directiveList); response.setNullableShouldEndSession(shouldEndSession); return response; }
@Override public void onSessionEnded( final SessionEndedRequest request, final Session session) throws SpeechletException { log.info("onSessionEnded requestId={}, sessionId={}", request.getRequestId(), session.getSessionId()); } }
@Override public void onSessionStarted( final SessionStartedRequest request, final Session session) throws SpeechletException { log.info("onSessionStarted requestId={}, sessionId={}", request.getRequestId(), session.getSessionId()); }
@Override public SpeechletResponse onLaunch( final LaunchRequest request, final Session session) throws SpeechletException { log.info("onLaunch requestId={}, sessionId={}", request.getRequestId(), session.getSessionId()); return Response.welcome(session); }
/** * Helper method that retrieves the system state from the request context. * @param context request context. * @return SystemState the systemState */ private SystemState getSystemState(Context context) { return context.getState(SystemInterface.class, SystemState.class); } }
@Override public void onSessionEnded(SpeechletRequestEnvelope<SessionEndedRequest> requestEnvelope) { log.info("onSessionEnded requestId={}, sessionId={}", requestEnvelope.getRequest().getRequestId(), requestEnvelope.getSession().getSessionId()); // any cleanup logic goes here }
@Override public void onSessionStarted(SpeechletRequestEnvelope<SessionStartedRequest> requestEnvelope) { log.info("onSessionStarted requestId={}, sessionId={}", requestEnvelope.getRequest().getRequestId(), requestEnvelope.getSession().getSessionId()); // any initialization logic goes here }
SpeechletResponse build() { SpeechletResponse response = new SpeechletResponse(); response.setOutputSpeech(speech); response.setCard(card); response.setReprompt(reprompt); response.setDirectives(directiveList); response.setNullableShouldEndSession(shouldEndSession); return response; }
/** * Helper method that retrieves the system state from the request context. * @param context request context. * @return SystemState the systemState */ private SystemState getSystemState(Context context) { return context.getState(SystemInterface.class, SystemState.class); }
@Override public void onSessionEnded(SpeechletRequestEnvelope<SessionEndedRequest> requestEnvelope) { log.info("onSessionEnded requestId={}, sessionId={}", requestEnvelope.getRequest().getRequestId(), requestEnvelope.getSession().getSessionId()); }
@Override public void onSessionStarted(SpeechletRequestEnvelope<SessionStartedRequest> requestEnvelope) { log.info("onSessionStarted requestId={}, sessionId={}", requestEnvelope.getRequest().getRequestId(), requestEnvelope.getSession().getSessionId()); // any initialization logic goes here }
/** * Logs information about the session, and is triggered when the session ends for any reason. * * @param envelope SpeechletRequestEnvelope containing the Context, Session, Version, and SessionEndedRequest */ @Override public void onSessionEnded(final SpeechletRequestEnvelope<SessionEndedRequest> envelope) { LOG.info("onSessionEnded requestId={}, sessionId={}", envelope.getRequest().getRequestId(), envelope.getSession().getSessionId()); }
@Override public void onSessionStarted(SpeechletRequestEnvelope<SessionStartedRequest> requestEnvelope) { log.info("onSessionStarted requestId={}, sessionId={}", requestEnvelope.getRequest().getRequestId(), requestEnvelope.getSession().getSessionId()); // any initialization logic goes here }
@Override public void onSessionEnded(SpeechletRequestEnvelope<SessionEndedRequest> requestEnvelope) { SessionEndedRequest request = requestEnvelope.getRequest(); Session session = requestEnvelope.getSession(); log.info("onSessionEnded requestId={}, sessionId={}", request.getRequestId(), session.getSessionId()); // any session cleanup logic would go here }
@Override public void onSessionEnded(SpeechletRequestEnvelope<SessionEndedRequest> requestEnvelope) { log.info("onSessionEnded requestId={}, sessionId={}", requestEnvelope.getRequest().getRequestId(), requestEnvelope.getSession().getSessionId()); // any session cleanup logic would go here }
@Override public void onSessionEnded(SpeechletRequestEnvelope<SessionEndedRequest> requestEnvelope) { log.info("onSessionEnded requestId={}, sessionId={}", requestEnvelope.getRequest().getRequestId(), requestEnvelope.getSession().getSessionId()); // any cleanup logic goes here }
/** * Logs information about the session, and is triggered when the session ends for any reason. * * @param envelope SpeechletRequestEnvelope containing the Context, Session, Version, and SessionEndedRequest */ @Override public void onSessionEnded(final SpeechletRequestEnvelope<SessionEndedRequest> envelope) { LOG.info("onSessionEnded requestId={}, sessionId={}", envelope.getRequest().getRequestId(), envelope.getSession().getSessionId()); }
@Override public void onSessionEnded(SpeechletRequestEnvelope<SessionEndedRequest> requestEnvelope) { log.info("onSessionEnded requestId={}, sessionId={}", requestEnvelope.getRequest().getRequestId(), requestEnvelope.getSession().getSessionId()); // any cleanup logic goes here }