Refine search
public static InterceptData get() { if (Session.exists()) { return Session.get().getMetaData(key); } return null; }
@Override protected final void onTimer(AjaxRequestTarget target) { stop(target); RequestCycle requestCycle = RequestCycle.get(); IRequestParameters requestParameters = requestCycle.getRequest().getRequestParameters(); WebClientInfo clientInfo = newWebClientInfo(requestCycle); clientInfo.getProperties().read(requestParameters); Session.get().setClientInfo(clientInfo); onClientInfo(target, clientInfo); }
/** * Get a new {@link PropertyResolverConverter} * * @return a new {@code PropertyResolverConverter} */ protected PropertyResolverConverter newPropertyResolverConverter() { return new PropertyResolverConverter(Application.get().getConverterLocator(), Session.get().getLocale()); }
private void onInternalDetach() { if (Session.exists()) { Session.get().internalDetach(); } if (Application.exists()) { IRequestLogger requestLogger = Application.get().getRequestLogger(); if (requestLogger != null) requestLogger.performLogging(); } }
/** * Check if already someone is authenticated to prevent duplicate logins. By default this checks * if the home page is authenticated. * * @return true if the user is already authenticated, false otherwise */ protected boolean isAuthenticated() { WaspAuthorizationStrategy strategy = (WaspAuthorizationStrategy)Session.get() .getAuthorizationStrategy(); return strategy.isClassAuthenticated(Application.get().getHomePage()); }
@Override public void onRequest() { RequestCycle.get().scheduleRequestHandlerAfterCurrent(EmptyAjaxRequestHandler.getInstance()); getLogger().info(String.format("Keeping session with id %s alive.", Session.get().getId())); }
/** * Based on the Session's locale determine the associated character encoding. * * @param cycle * @return Char set to use for response. */ public static String getEncoding(final RequestCycle cycle) { if (charSetMap == null) { initialize((WebApplication)Application.get()); } return charSetMap.getCharSet(Session.get().getLocale()); } }
private String getProjectDescription() { Project project = Session.get().getMetaData(SessionMetaData.CURRENT_PROJECT); if (project != null) { return project.getDescription(); } else { return "Please select a project."; } } }
@Override public void onDetach(final RequestCycle requestCycle) { if (Session.exists()) { Session.get().getPageManager().commitRequest(); } } });
public static TreeResourceSet get() { TreeResourceSet set = Session.get().getMetaData(KEY); if (set == null) { set = new TreeResourceSet(); Session.get().setMetaData(KEY, set); } return set; } }
public static void clear() { if (Session.exists()) { Session.get().setMetaData(key, null); } }
/** * @return whether the current session is temporary */ protected boolean isSessionTemporary() { return Session.exists() ? Session.get().isTemporary() : true; }