added method to distinguish logging of the user action from the login portlet from the actions performed through bookmarks

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/application-support-layer/applicationSupportLayerCore@33403 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Rena Tsantouli 2011-01-13 10:57:44 +00:00
parent ee56f071a1
commit fca01bfd33
1 changed files with 25 additions and 2 deletions

View File

@ -34,6 +34,7 @@ public class ASLSession{
private HashMap<String, Notifier> notifiers;
String scopeName;
private ASLGroupModel groupModel;
private boolean loggedIn = false;
// ACCESS LOGGER
@ -182,6 +183,7 @@ public class ASLSession{
public String getScopeName()
{
System.out.println("The scope is name: " + scope);
System.out.println("the username is: " + username);
if (scope != null)
return scope.toString();
else
@ -214,17 +216,38 @@ public class ASLSession{
System.out.println("la" + scope);
if(new PortalSecurityManager(this.scope).isSecurityEnabled())
this.credential = UserCredential.getCredential(username, scope);
if (previousScopeName != null && !previousScopeName.equals(scopeName)) {
// get the attribute that indicates of log in has been done from the login portlet - or if the user logs in from a bookmark
if (loggedIn == true) {
// don't log
initializeAttributes();
// clear the attribute
loggedIn = false;
System.out.println("Passing the logging because the variable was set");
return;
}
if ((previousScopeName != null && !previousScopeName.equals(scopeName)) || previousScopeName == null) {
System.out.println("Logging the entrance");
innerSession.clear();
// ACCESS LOGGER
LoginToVreAccessLogEntry loginEntry = new LoginToVreAccessLogEntry();
accessLogger.logEntry(username, scope, loginEntry);
}
} else
System.out.println("Passing the logging because the scope was the same");
initializeAttributes();
}
public void logUserLogin(String scope) {
System.out.println("LogUserLogin method called");
innerSession.clear();
loggedIn = true;
// ACCESS LOGGER
LoginToVreAccessLogEntry loginEntry = new LoginToVreAccessLogEntry();
accessLogger.logEntry(username, scope, loginEntry);
}
/**
* @param notification the name of the notification to wait for
* @throws InterruptedException when the thread is interrupted