NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

Re: [netcdf-java] Possibility for per-dataset http client?

Hi Jon:

Are you managing a database of user/password credentials for the various remote 
sites? 

Another design is that ncWMS has a single logon to each of your remote sites. 
Give each remote site a role, and manage access to them through standard 
role-based tomcat authentication, ie users are given that role if they have 
authorization. 

I have some more thoughts about what to do if that doesnt work.

John



Jon Blower wrote:
> Hi,
> 
> Accessing OPeNDAP or remote NetCDF files in nj4.0 uses the Apache
> Commons HttpClient library.  If my understanding is correct then nj4.0
> uses the same HttpClient instance for all connections, and this
> instance is set with static methods:
> 
>         opendap.dap.DConnect2.setHttpClient(client);
>         ucar.unidata.io.http.HTTPRandomAccessFile.setHttpClient(client);
> 
> In my case, I have a Java web application (running in a single VM)
> accessing lots of remote servers via HTTP.  The entire application
> uses the same HttpClient instance, and therefore there is no way to
> distinguish between the users of my application.  Say I have two users
> going via my application to the same secure OPeNDAP server.  My
> application can only associate a *single* username/password
> combination with the host:port of the OPeNDAP server, following the
> Credentials framework in HttpClient.  There is no way to register two
> different username/password combinations for the same remote server.
> 
> One possible way to fix this would be to allow each NetcdfDataset to
> be associated with its own HttpClient instance.  This could be
> provided as an optional parameter to openDataset(), defaulting back to
> the VM-wide one if omitted.  Then I could store an HttpClient (with
> associated credentials) in the user's session object in my
> application.  (I am not sure if this is good practice for HttpClient
> though.)
> 
> Is this easily remedied or a tough job?
> 
> Cheers, Jon
> 


  • 2009 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdf-java archives: