This method will be invoked after {@link SlackBot#askTimeForMeeting(WebSocketSession, Event)}.

@param session
@param event
548509
@Controller
    public void askWhetherToRepeat(WebSocketSession session, Event event) {
        if (event.getText().contains("yes")) {
            reply(session, event, "Great! I will remind you tomorrow before the meeting.");
        } else {
            reply(session, event, "Okay, don't forget to attend the meeting tomorrow :)");
        }
        stopConversation(event);    // stop conversation
    }
278632
public void createSession(Session session) {
        sessionMap.put(session.id(), session);
        Event event = new Event();
        event.attribute("session", session);

        eventManager.fireEvent(EventType.SESSION_CREATED, event);
    }
465491
public void initFormForSession(
        final String sessionId,
        final Element formElement,
        final I_CmsClientCmsUgcSessionCallback onSuccess,
        final I_CmsErrorCallback onError) {

        getRpcHelper().executeRpc(SERVICE.getContent(new CmsUUID(sessionId), new AsyncCallback<CmsUgcContent>() {

            public void onFailure(Throwable caught) {

                handleError(caught, onError);
            }

            public void onSuccess(CmsUgcContent result) {

                CmsClientUgcSession session = new CmsClientUgcSession(CmsXmlContentUgcApi.this, result);
                session.initFormElement(formElement);
                onSuccess.call(session);
            }
        }));
    }
819186
public final void registerSession(Session session, EventType event) {
		if (session.isClosed() && event != EventType.UNREGISTER) {
			return;
		}
		Reactor reactor = (Reactor) session.getAttribute(REACTOR_ATTRIBUTE);

		if (reactor == null) {
			reactor = nextReactor();
			final Reactor oldReactor = (Reactor) session.setAttributeIfAbsent(
					REACTOR_ATTRIBUTE, reactor);
			if (oldReactor != null) {
				reactor = oldReactor;
			}
		}
		reactor.registerSession(session, event);
	}
194366
public void onClose(Session session, CloseReason closeReason) {
        if (getOnCloseHandle() != null) {
            callMethod(getOnCloseHandle(), getOnCloseParameters(), session, true, closeReason);
        }
    }
632031
protected final Object getEventSessionMutex(HttpSession session) {
        synchronized (WebUtils.getSessionMutex(session)) {
            SerializableObject mutex =
                    (SerializableObject) session.getAttribute(EVENT_SESSION_MUTEX);
            if (mutex == null) {
                mutex = new SerializableObject();
                session.setAttribute(EVENT_SESSION_MUTEX, mutex);
            }

            return mutex;
        }
    }
503107
private void invokeChainedMethod(Event event) {
        Queue<MethodWrapper> queue = conversationQueueMap.get(event.getSender().getId());

        if (queue != null && !queue.isEmpty()) {
            MethodWrapper methodWrapper = queue.peek();

            try {
                EventType[] eventTypes = methodWrapper.getMethod().getAnnotation(Controller.class).events();
                for (EventType eventType : eventTypes) {
                    if (eventType.name().equalsIgnoreCase(event.getType().name())) {
                        methodWrapper.getMethod().invoke(this, event);
                        return;
                    }
                }
            } catch (Exception e) {
                logger.error("Error invoking chained method: ", e);
            }
        }
    }
11223
public void sessionWillPassivate(SipApplicationSessionEvent event) {
		logger.info("Following sip application session just passivated " + event.getApplicationSession().getId() + " cause " + ((SipApplicationSessionActivationEvent)event).getCause());

	}
844808
@Controller(events = EventType.PIN_ADDED)
    public void onPinAdded(WebSocketSession session, Event event) {
        reply(session, event, "Thanks for the pin! You can find all pinned items under channel details.");
    }
1291528
@Override
    public JSONObject handleEvent(SlackEvent event) throws ServiceException {
        if (event.getCallbackId() != null && event.getCallbackId().indexOf('_') > 0 && event.getCallbackId().indexOf('/') > 0 && event.getTs() != null) {
            Long instanceId = Long.parseLong(event.getCallbackId().substring(event.getCallbackId().lastIndexOf('/') + 1));
            new Thread(() -> {
                Map<String,String> indexes = new HashMap<>();
                logger.debug("Saving slack:message_ts=" + event.getTs() + " for task " + instanceId);
                indexes.put("slack:message_ts", event.getTs());
                try {
                    ServiceLocator.getTaskServices().updateIndexes(instanceId, indexes);
                }
                catch (Exception ex) {
                    logger.severeException("Error updating indexes for task " + instanceId + ": " + ex, ex);
                }
            }).start();
        }
        else if (event.getThreadTs() != null && event.getUser() != null) {
            new Thread(() -> {
                try {
                    TaskServices taskServices = ServiceLocator.getTaskServices();
                    Query query = new Query();
                    query.setFilter("index", "slack:message_ts=" + event.getThreadTs());
                    List<TaskInstance> instances = taskServices.getTasks(query).getTasks();
                    for (TaskInstance instance : instances) {
                        // add a corresponding note
                        Comment comment = new Comment();
                        comment.setCreated(Date.from(Instant.now()));
                        // TODO: lookup (or cache) users
                        comment.setCreateUser(event.getUser().equals("U4V5SG5PU") ? "Donald Oakes" : event.getUser());
                        comment.setContent(event.getText());
                        comment.setOwnerType(OwnerType.TASK_INSTANCE);
                        comment.setOwnerId(instance.getTaskInstanceId());
                        comment.setName("slack_message");
                        ServiceLocator.getCollaborationServices().createComment(comment);
                    }
                }
                catch (Exception ex) {
                    logger.severeException(ex.getMessage(), ex);
                }
            }).start();
        }
        return null;
    }
505844
public void addSession(Session session) {
		InetSocketAddress remoteSocketAddress = session
				.getRemoteSocketAddress();
		log.warn("Add a session: "
				+ SystemUtils.getRawAddress(remoteSocketAddress) + ":"
				+ remoteSocketAddress.getPort());
		this.sessionList.add(session);
	}
288095
protected void subscriptionRequestSent(IoSession session,
			SubscriptionMessage subscriptionMessage) {

		this.sentSubscription = subscriptionMessage;
		log.info("Sent {}", subscriptionMessage);
	}
265108
@SuppressWarnings("unchecked")
	public void sessionCreated(HttpSessionEvent se) {
		Descriptor<? extends Context> descriptor = container.contexts().get(Session.class);
		
		if (descriptor != null) {
			WebContext<HttpSession> context = (WebContext<HttpSession>) container.component(descriptor);
			context.associate(se.getSession());
		}
	}
731546
public static void log(IoSession session, Throwable t) {
        Logger logger = getTransportLogger(session);
        log(session, logger, t);
    }
699877
@Override
    public void sessionCreated(HttpSessionEvent event) {

        if (tc.isDebugEnabled()) {
            Tr.debug(tc, "HttpSession created: HttpSession ID: " + event.getSession().getId());
        }
        // nothing to do here, since later the code will add the session id to a map 

    }
951016
public static void notifyIdleness(Iterator<? extends IoSession> sessions, long currentTime) {
        IoSession s;
        while (sessions.hasNext()) {
            s = sessions.next();
            notifyIdleSession(s, currentTime);
        }
    }
1212484
protected final void startConversation(Event event, String methodName) {
        startConversation(event.getSender().getId(), methodName);
    }