-
October 2nd, 2017, 07:08 AM
#1
Light streamer delete same user loggedin previously
In my case, I need to delete the session who logged in with the same credential in previously. It shouldn't allow keeping same user credentials to more than one user. So that I need to terminate the session if a new user logged in with same credentials. I need to serve only to the new user session.
I have tried in my metadata like below but I couldn't disconnect the previous session of the same user name.
private final ConcurrentHashMap<String, Map<String, String>> sessions = new ConcurrentHashMap<String, Map<String, String>>();
private final ConcurrentHashMap<String, String> userinfo = new ConcurrentHashMap<String, String>();
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
synchronized public void notifyNewSession(String user, String sessionID, Map sessionInfo)
throws CreditsException, NotificationException {
assert (!sessions.containsKey(sessionID));
sessions.put(sessionID, sessionInfo);
if (userinfo.containsKey(user)) {
sessions.remove(userinfo.get(user));
System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>> REMOVED USER NAME : " + user);
System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>> REMOVED USER SESSION : " + userinfo.get(user));
}
userinfo.put(user, sessionID);
}
Similar Threads
-
Replies: 0
Last Post: September 24th, 2022, 12:52 PM
-
By rvkvino in forum General
Replies: 1
Last Post: February 24th, 2017, 10:06 AM
-
By rvkvino in forum General
Replies: 3
Last Post: September 25th, 2013, 09:20 AM
-
By pradeepgamage in forum Adapter SDKs
Replies: 7
Last Post: May 17th, 2012, 09:21 AM
-
By mnenchev in forum General
Replies: 5
Last Post: September 8th, 2009, 03:07 PM
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
All times are GMT +1. The time now is 06:20 PM.
Bookmarks