/** * Retrieves a conversation id, if any, that is associated with a {@link Page} instance * * @param page * page instance * @return conversation id, if any */ public String getConversationMarker(Page page) { return page.getMetaData(ConversationIdMetaKey.INSTANCE); }
public static String getConversationIdFromPage(Page page) { return page.getMetaData(CONVERSATION_ID_KEY); }
/** * @param page * @return initial page parameters */ public static PageParameters getInitialPagePageParameters(final Page page) { return page.getMetaData(PAGE_PARAMETERS_META_DATA_KEY); }
/** * Retrieves a conversation id, if any, that is associated with a {@link Page} instance * * @param page page instance * @return conversation id, if any */ public String getConversationMarker(Page page) { return page.getMetaData(ConversationIdMetaKey.INSTANCE); }
/** * @param page * @return */ public static PageParameters getInitialPagePageParameters(Page page) { return (PageParameters)page.getMetaData(PAGE_PARAMETERS_META_DATA_KEY); }
/** * Find the Atmosphere UUID for the suspended connection for the given page (if any). * * @param page * @return The UUID of the Atmosphere Resource, or null if no resource is suspended for the * page. */ public static String getUUID(Page page) { return page.getMetaData(ATMOSPHERE_UUID); }
/** * Find the Atmosphere UUID for the suspended connection for the given page (if any). * * @param page * @return The UUID of the Atmosphere Resource, or null if no resource is suspended for the * page. */ public static String getUUID(Page page) { return page.getMetaData(ATMOSPHERE_UUID); }
public static String getConversationIdFromPage(Page page) { return page.getMetaData(CONVERSATION_ID_KEY); }
@Override public String getObject() { Page page = getModelObject(); if (page != null) { Long renderTime = page.getMetaData(PageView.RENDER_KEY); if (renderTime != null) { return renderTime.toString(); } } return "n/a"; } };
@Override public String getObject() { Page page = getModelObject(); if (page != null) { Long renderTime = page.getMetaData(PageView.RENDER_KEY); if (renderTime != null) { return renderTime.toString(); } } return "n/a"; } };
/** * Returns the number of trailing slashes in the url when the page in request target was created * or null if the number can't be determined. * * @param requestTarget * @return */ private Integer getOriginalOriginalTrailingSlashesCount(IRequestTarget requestTarget) { if (requestTarget instanceof ListenerInterfaceRequestTarget) { ListenerInterfaceRequestTarget target = (ListenerInterfaceRequestTarget)requestTarget; Page page = target.getPage(); return (Integer)page.getMetaData(ORIGINAL_TRAILING_SLASHES_COUNT_METADATA_KEY); } return null; }
/** * Returns the number of trailing slashes in the url when the page in request target was created * or null if the number can't be determined. * * @param requestTarget * @return the number of trailing slashes */ private Integer getOriginalOriginalTrailingSlashesCount(final IRequestTarget requestTarget) { if (requestTarget instanceof ListenerInterfaceRequestTarget) { ListenerInterfaceRequestTarget target = (ListenerInterfaceRequestTarget)requestTarget; Page page = target.getPage(); return page.getMetaData(ORIGINAL_TRAILING_SLASHES_COUNT_METADATA_KEY); } return null; }
Long renderTime = page.getMetaData(RENDER_KEY); if (renderTime != null)
Long renderTime = page.getMetaData(RENDER_KEY); if (renderTime != null)
public void onRequestHandlerResolved(RequestCycle cycle, IRequestHandler handler) { String cid = cycle.getRequest().getRequestParameters().getParameterValue(CID).toString(); Page page = getPage(handler); if (cid == null && page != null) { cid = page.getMetaData(CID_KEY); } Conversation current = getConversation(cycle); if (current != null && !Objects.isEqual(current.getId(), cid)) { logger.info("Conversation {} has expired for {}", cid, page); throw new ConversationExpiredException(null, cid, page, handler); } activateConversationIfNeeded(cycle, handler, cid); }
@Override public void onRequestHandlerResolved(RequestCycle cycle, IRequestHandler handler) { Conversation conversation = getConversation(); logger.debug("In onRequestHandlerResolved id = {}", conversation.getId()); String cid = cycle.getRequest().getRequestParameters().getParameterValue(CID_ATTR).toString(); Page page = getPage(handler); if (page == null) { return; } if (cid == null) { cid = page.getMetaData(CID_KEY); } if (cid != null && !conversation.isTransient() && !Objects.isEqual(conversation.getId(), cid)) { logger.info("Conversation {} has expired for {}", cid, page); throw new ConversationExpiredException(null, cid, page, handler); } activateConversationIfNeeded(page, cycle, handler, cid); }