Alon Bar-Lev has posted comments on this change.

Change subject: core : Persist engine session on login and delete on logout
......................................................................


Patch Set 4:

(4 comments)

http://gerrit.ovirt.org/#/c/35361/4/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/aaa/SessionDataContainer.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/aaa/SessionDataContainer.java:

Line 95:         SessionInfo sessionInfo = getSessionInfo(sessionId);
Line 96:         if (sessionInfo != null) {
Line 97:             EngineSession engineSession = new EngineSession();
Line 98:             engineSession.setEngineSessionId(sessionId);
Line 99:             DbUser user = getUser(sessionId, false);
per mu previous question... any reason why we cannot use DbUser within 
EngineSession and remove the specifics from here?
Line 100:             engineSession.setUserId(user.getId());
Line 101:             engineSession.setUserName(user.getLoginName());
Line 102:             engineSession.setGroupIds(user.getGroupIds());
Line 103:             sessionInfo.contentOfSession.put(ENGINE_SESSION_SEQ_ID, 
getDbFacade().getEngineSessionDao().save(engineSession));


Line 106: 
Line 107:     public long getSessionSeqId(String sessionId) {
Line 108:         return sessionInfoMap.containsKey(sessionId) ?
Line 109:                 (Long) 
sessionInfoMap.get(sessionId).contentOfSession.get(ENGINE_SESSION_SEQ_ID) :
Line 110:                 -1;
won't it better to raise exception?
Line 111:     }
Line 112: 
Line 113:     public void cleanupAllEngineSessions() {
Line 114:         getDbFacade().getEngineSessionDao().removeAll();


Line 109:                 (Long) 
sessionInfoMap.get(sessionId).contentOfSession.get(ENGINE_SESSION_SEQ_ID) :
Line 110:                 -1;
Line 111:     }
Line 112: 
Line 113:     public void cleanupAllEngineSessions() {
I suggest this renamed to onStartup(), initialize() or something similar, as 
caller should not care what you do at this point. I also unsure if we need this 
as the first getInstance() can handle this.
Line 114:         getDbFacade().getEngineSessionDao().removeAll();
Line 115:     }
Line 116: 
Line 117:     /**


Line 247:                 message,
Line 248:                 msgArgs
Line 249:                 );
Line 250:         sessionInfoMap.remove(sessionId);
Line 251:         
getDbFacade().getEngineSessionDao().removeBySessionId(sessionId);
you can remove by seq... no?
Line 252:     }
Line 253: 
Line 254:     private String getPrincipalName(String sessionId) {
Line 255:         return (String) getData(sessionId, PRINCIPAL_PARAMETER_NAME, 
false);


-- 
To view, visit http://gerrit.ovirt.org/35361
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id716d9c6f65898ccd0ffd84d8b05926b78ac9692
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Ravi Nori <rn...@redhat.com>
Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com>
Gerrit-Reviewer: Eli Mesika <emes...@redhat.com>
Gerrit-Reviewer: Oved Ourfali <oourf...@redhat.com>
Gerrit-Reviewer: Ravi Nori <rn...@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

Reply via email to