Locale locale = LocaleUtils.toLocale(startCommand.getLanguage()); IFrontendController<RComponent, RIcon, RAction> controller = getFrontendController(); if (!dupSessionNotifiedOnce && isDupSessionDetectionEnabled() int currentOffset = serverTimeZone.getOffset(System.currentTimeMillis()); TimeZone clientTz = null; if (currentOffset == startCommand.getTimezoneOffset()) { clientTz = serverTimeZone; } else { String[] availableIds = TimeZone.getAvailableIDs(startCommand .getTimezoneOffset()); if (availableIds.length > 0) { for (int i = 0; i < availableIds.length && clientTz == null; i++) { start(); controller = getFrontendController(); if (startCommand.getVersion() != null && !isClientVersionCompatible(startCommand.getVersion())) { return handleVersionIncompatibility(startCommand, controller, locale);
String[] keysToTranslate = ((RemoteStartCommand) command).getKeysToTranslate(); if (keysToTranslate != null) { clientKeysToTranslate = keysToTranslate; if (((RemoteStartCommand) command).getClientType() != null) { getApplicationSession().setClientType(EClientType.valueOf(((RemoteStartCommand) command).getClientType())); getApplicationSession().setClientPlatformName(((RemoteStartCommand) command).getClientPlatformName()); getApplicationSession().setClientPlatformVersion(((RemoteStartCommand) command).getClientPlatformVersion()); if (isLoginInteractive()) { registerCommand(createLocaleCommand());
/** * Handle version incompatibility list. * * @param startCommand * the start command * @param controller * the controller * @param locale * the locale * @return the list */ protected List<RemoteCommand> handleVersionIncompatibility(RemoteStartCommand startCommand, IFrontendController<RComponent, RIcon, RAction> controller, Locale locale) { RemoteMessageCommand errorMessage = createErrorMessageCommand(); assert controller != null; errorMessage.setMessage(controller.getTranslation( "incompatible.client.version", new Object[] { startCommand.getVersion(), Build.getJspressoVersion() }, locale)); // Do not return the singleton list directly since subclasses might add commands to it. return new ArrayList<>(Collections.singleton((RemoteCommand) errorMessage)); }