Yair Zaslavsky has posted comments on this change. Change subject: aaa: Added usage of AuthRecord.VALID_TO ......................................................................
Patch Set 18: (5 comments) http://gerrit.ovirt.org/#/c/26975/18/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/LoginBaseCommand.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/LoginBaseCommand.java: Line 116: return failCanDoAction(VdcBllMessages.USER_CANNOT_LOGIN_SESSION_MISSING); Line 117: } Line 118: Line 119: SessionDataContainer.getInstance().setSoftLimit(DateUtils.addMinutes(new Date(), Line 120: Config.<Integer> getValue(ConfigValues.UserSessionTimeOutInterval))); > why don't you call refresh? Done Line 121: Line 122: int maxSessionInterval = Config.<Integer> getValue(ConfigValues.MaxSessionTimeoutInterval); Line 123: Date validTo = maxSessionInterval != 0 ? DateUtils.addMinutes(new Date(), maxSessionInterval) : null; Line 124: try { Line 118: Line 119: SessionDataContainer.getInstance().setSoftLimit(DateUtils.addMinutes(new Date(), Line 120: Config.<Integer> getValue(ConfigValues.UserSessionTimeOutInterval))); Line 121: Line 122: int maxSessionInterval = Config.<Integer> getValue(ConfigValues.MaxSessionTimeoutInterval); > this is not an interval... 3rd time... it is a max session DURATION. done, replaced. Line 123: Date validTo = maxSessionInterval != 0 ? DateUtils.addMinutes(new Date(), maxSessionInterval) : null; Line 124: try { Line 125: Date fromExtension = Line 126: new SimpleDateFormat("yyyy-MM-dd HH:mm:ssZ").parse(authRecord.<String> get(AuthRecord.VALID_TO)); Line 125: Date fromExtension = Line 126: new SimpleDateFormat("yyyy-MM-dd HH:mm:ssZ").parse(authRecord.<String> get(AuthRecord.VALID_TO)); Line 127: if (validTo != null) { Line 128: validTo = validTo.compareTo(fromExtension) < 0 ? validTo : fromExtension; Line 129: } > else validTo = fromExtension Done Line 130: } catch (ParseException e) { Line 131: log.warn("Error parsing AuthRecord.VALID_TO . Default VALID_TO value will be set on session"); Line 132: } Line 133: SessionDataContainer.getInstance().setHardLimit(validTo); http://gerrit.ovirt.org/#/c/26975/18/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/session/SessionDataContainer.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/session/SessionDataContainer.java: Line 272: } Line 273: Line 274: private void refresh(SessionInfo sessionInfo) { Line 275: Date now = new Date(); Line 276: synchronized (sessionInfo) { > why do you syncrhonize? Done Line 277: Date softLimit = (Date) sessionInfo.contentOfSession.get(SOFT_LIMIT_PARAMETER_NAME); Line 278: if (softLimit == null) { Line 279: softLimit = now; Line 280: } Line 280: } Line 281: softLimit = Line 282: DateUtils.addMinutes(softLimit, Line 283: Config.<Integer> getValue(ConfigValues.UserSessionTimeOutInterval)); Line 284: sessionInfo.contentOfSession.put(SOFT_LIMIT_PARAMETER_NAME, softLimit); > I do not understand.... i thought that if softLimit is not null, you add x to softLimit, not to "now". Am I wrong? Line 285: } Line 286: } Line 287: -- To view, visit http://gerrit.ovirt.org/26975 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I53e4a371c1bae8d2480ddd2af921a560c6fe9a85 Gerrit-PatchSet: 18 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Yair Zaslavsky <yzasl...@redhat.com> Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com> Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches