@Nullable protected SessionUrlsHolder getSessionUrlsHolder() { SecurityContext securityContext = AppContext.getSecurityContext(); if (securityContext == null) return null; UserSession session = securityContext.getSession(); if (session == null || session instanceof ClientBasedSession && ((ClientBasedSession) session).hasRequestScopedInfo()) return anonymousSessionUrlsHolder; return new UserSessionUrlsHolder(session); } }
@Override public RemoteInvocation createRemoteInvocation(MethodInvocation methodInvocation) { SecurityContext securityContext = AppContext.getSecurityContext(); CubaRemoteInvocation remoteInvocation = new CubaRemoteInvocation(methodInvocation, securityContext == null ? null : securityContext.getSessionId()); if (securityContext != null) { UserSession session = securityContext.getSession(); if (session instanceof ClientBasedSession && ((ClientBasedSession) session).hasRequestScopedInfo()) { remoteInvocation.setLocale(session.getLocale() != null ? session.getLocale().toLanguageTag() : null); remoteInvocation.setTimeZone(session.getTimeZone()); remoteInvocation.setAddress(session.getAddress()); remoteInvocation.setClientInfo(session.getClientInfo()); } } return remoteInvocation; } }
UserSession session = securityContext.getSession(); if (session instanceof ClientBasedSession && ((ClientBasedSession) session).hasRequestScopedInfo()) { invocation.setLocale(session.getLocale() != null ? session.getLocale().toLanguageTag() : null); invocation.setTimeZone(session.getTimeZone());
UserSession session = securityContext.getSession(); if (session instanceof ClientBasedSession && ((ClientBasedSession) session).hasRequestScopedInfo()) { invocation.setLocale(session.getLocale() != null ? session.getLocale().toLanguageTag() : null); invocation.setTimeZone(session.getTimeZone());