-
May 26th, 2009, 03:35 PM
#1
NotifyNewSession
Hi,
I have a question regarding public void notifyNewSession(java.lang.String user, java.lang.String session, java.util.Map clientContext) of MetsdataProviderAdapter class. Where does the data of clientContext come from? Also is clientContext cached in memory and accessable later by Metadata Adapter or Data Adapter? If yes, how?
Thanks
Eric
-
May 27th, 2009, 08:53 AM
#2
The clientContext is a collection of available information about the client that is requesting a new session.
It is provided just in case, as information that might be useful in order to decide whether the request to open the session (or any other request related to the session) can be accepted.
The information is, therefore, associated to the specific session. However, it is not cached. Any caching for use in later operations must be performed by the Metadata Adapter.
-
June 4th, 2009, 04:08 PM
#3
Thanks, Dario.
Is there a list of data fields saved in ClientContext? Also, if I want to pass the data I get from Http Headers (unique to each session) from the call notifyUser(User,Password, http_headers) to notifyNewSession(User, LS_session, clientContext) what is the best way to do due to the fact that the same user id can be used for multiple connections/sessions?
Thanks again.
Eric
-
June 5th, 2009, 01:41 PM
#4
I can't understand your question
Is there a list of data fields saved in ClientContext?
Anyway, the clientContext contents are documented in the notifyNewSession javadoc.
You are right. There is no way to strictly associate a call to notifyUser with the calls to notifyNewSession and other methods related with the management of the same session request, hence the httpHeaders argument cannot be exported to those methods.
We introduced httpHeaders to support authentication based on cookies, but we thought that authorization tasks would not depend on such information after the user identity had been checked.
We will close this gap in the next release.
In the meantime, you might try to differentiate client requests by decorating the user name on the client side in some way.
-
May 25th, 2018, 11:50 AM
#5
Hello,
![Quote](images/styles/AestheticaGreen/misc/quote_icon.png)
Originally Posted by
DarioCrivelli
In the meantime, you might try to differentiate client requests by decorating the user name on the client side in some way.
Is this still the way to do it?
-
May 28th, 2018, 09:20 AM
#6
Hi, Thank you for reminding us of this pending thread.
We overcame the issue short time later, although in a tricky way, to avoid altering the interface.
Now, if you gather some information on the user in notifyUser, you can have this information passed to the subsequent and corresponding invocation of notifyNewSession by leveraging the "httpHeaders" Map.
In fact, we guarantee (and document) that the "HTTP_HEADERS" Map that is contained in the "clientContext" Map received by notifyNewSession is the same instance as the "HttpHeaders" Map received by notifyUser.
So, you can use that Map as a bridge and overload it with any other data computed in notifyUser.
In the rare cases in which notifyUser is not followed by notifyNewSession because of errors in the middle, the Map will be garbage-collected.
We hope that this is manageable in most cases.
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 08:59 PM.
Bookmarks