I hope this helps, it's been a while since the last time I worked on this...
Ing. Simone Giannecchini
@simogeo
Founder/Director
GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 333 8128928
Hi Andrea, Chris,
Andrea, thanks for the input.
Chris, it seems like several handlers could be gathered up for the one-go at
registering them. That said, I'm a little worried that if other
applications in a container are trying to do the same, then we'll lose. I
don't know if that concern is a show-stopper or not.
Thanks,
Jim
On 04/04/2016 12:44 PM, Chris Snider wrote:
Hi,
I read the base question and the accepted answer from Andrea’s reference.
It seems the para 4 could be an issue requiring a wrapper to be written to
handle multiple custom protocols.
Ref:
http://stackoverflow.com/questions/26363573/registering-and-using-a-custom-java-net-url-protocol
“4 Finally register it during application's startup via
URL#setURLStreamHandlerFactory()
URL.setURLStreamHandlerFactory(new CustomURLStreamHandlerFactory());
Note that the Javadoc explicitly says that you can set it at most once. So
if you intend to support multiple custom protocols in the same application,
you'd need to generify the custom URLStreamHandlerFactory implementation to
cover them all inside the createURLStreamHandler() method.”
So if an installation wants HDFS and not S3, or vice-versa, the wrapper
class would have to know about and handle the referencing implementation for
specific protocols encountered. Thus we could also add
“myprotocol”/”myspecialclass” and what-not to a Spring bean, I suppose, that
could return the appropriate URLStreamHandler implemented in the
“myspecialclass” or an exception as necessary.
Chris Snider
Senior Software Engineer
Intelligent Software Solutions, Inc.
From: Andrea Aime [mailto:andrea.aime@anonymised.com]
Sent: Monday, April 04, 2016 9:23 AM
To: Jim Hughes <jnh5y@anonymised.com>
Cc: Geoserver-devel <geoserver-devel@lists.sourceforge.net>
Subject: Re: [Geoserver-devel] Custom URL protocol handling
Hi Jim,
as said in the other mail, I don't know, but I'm afraid if you don't go for
URL handlers
you'll have to modify more than just geotools and geoserver (and go down in
imageio).
I was actually skeptical about joining this thread because I don't have any
direct experience on this
subject, nor the time to perform research.
That said, if you look at my previous stackoverflow link it seems that URL
handlers
can be registered programmatically
Cheers
Andrea
On Mon, Apr 4, 2016 at 4:53 PM, Jim Hughes <jnh5y@anonymised.com> wrote:
Hi Andrea, all,
In terms of ease, would it be preferable to 1) ask HDFS/S3 minded users to
add URL handlers to their JVM or 2) handle this at the GeoTools/GeoServer
level?
For #1, I get the sense that adding URL handlers is more challenging. Also,
I doubt all installations would be ok with steps which add things to the JVM
setup. On the plus side, it might require little or no code changes on the
GT/GS side of things.
For #2, I imagine there may be more code to update, etc. As Andrew points
out, whenever a Java File is used directly, we might have to tweak code.
Thoughts?
Tentatively, I'm for the second approach.
Jim
On 04/04/2016 10:42 AM, Andrea Aime wrote:
Hi Rich,
it should be something along these lines (as said, never tried personally,
was just barely aware it should be possible):
http://stackoverflow.com/questions/26363573/registering-and-using-a-custom-java-net-url-protocol
Cheers
Andrea
On Mon, Apr 4, 2016 at 4:37 PM, Rich Fecher <rfecher@anonymised.com> wrote:
It is definitely possible we missed an extension point to register protocol
handlers at the JVM level. I just hadn't thought of it at the time and
didn't dig in, but I'll keep it in mind. Also, I'm curious if that works in
the case of 'hdfs' and 's3' protocol because then I'd think it should work
for us too. Thanks!
On Mon, Apr 4, 2016 at 10:34 AM, Andrew Hulbert <ahulbert@anonymised.com> wrote:
Yeah the only thing we will have to worry about is if the code is written
against java.io.File instead of some other URL lib. At some point I guess we
could dig in and look. I'll ask Jim for more info and see if we can mock it
up...while we're at it we can do S3 or something too for another test.
On Mon, Apr 04, 2016 at 04:31:13PM +0200, Andrea Aime wrote:
On Mon, Apr 4, 2016 at 4:30 PM, Andrea Aime <andrea.aime@anonymised.com>
wrote:
> That said, I'm not sure this has ever been tried, not at any level, but
> especially with imageio-ext,
>
Sorry, mis-typed, I meant jai-imageio there
Cheers
Andrea
--
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*
Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.
The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure,
reproduction,
copying, distribution, or either dissemination, either whole or partial,
is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.
-------------------------------------------------------
--
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.
==
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
AVVERTENZE AI SENSI DEL D.Lgs. 196/2003
Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i
file/s allegato/i sono da considerarsi strettamente riservate. Il loro
utilizzo è consentito esclusivamente al destinatario del messaggio, per le
finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio
senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia
via e-mail e di procedere alla distruzione del messaggio stesso,
cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo
anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per
finalità diverse, costituisce comportamento contrario ai principi dettati
dal D.Lgs. 196/2003.
The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender does
not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.
-------------------------------------------------------
------------------------------------------------------------------------------
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel
------------------------------------------------------------------------------
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel
--
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.
==
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
AVVERTENZE AI SENSI DEL D.Lgs. 196/2003
Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i
file/s allegato/i sono da considerarsi strettamente riservate. Il loro
utilizzo è consentito esclusivamente al destinatario del messaggio, per le
finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio
senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia
via e-mail e di procedere alla distruzione del messaggio stesso,
cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo
anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per
finalità diverse, costituisce comportamento contrario ai principi dettati
dal D.Lgs. 196/2003.
The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender does
not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.
-------------------------------------------------------
------------------------------------------------------------------------------
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel