Interface TargetedURLStreamHandlerPluginExtension
-
- All Superinterfaces:
PluginExtension
,URLStreamHandlerPluginExtensionConstants
@API(type=EXTENDABLE, src=PUBLIC) public interface TargetedURLStreamHandlerPluginExtension extends PluginExtension, URLStreamHandlerPluginExtensionConstants
Usually oXygen has specific fixed URL stream handlers for http and https protocols. This URL stream handler plugin extension provides the possibility to impose custom stream handlers for specific URLs.
If the plugin decides that it could handle connections for a particular protocol (canHandleProtocol(String)
), it will be asked to provide the handler for each opened connection of an URL having that protocol(getURLStreamHandler(URL)
).
This extension can be useful in situations when opened connections from a specific host must be handled in a particular way.
For example, the Oxygen HTTP URLStreamHandler may not be compatible for sending and receiving SOAP using the SUN Webservices implementation. In this case you can override the stream handler set by Oxygen for HTTP to use the default SUN URLStreamHandler which is more compatible with sending and receiving SOAP requests.
This extension can handle the following protocols:http
,https
,ftp
orsftp
.
If it is necessary to impose the application stream URL handlers for protocols different than the one handled by the application, theURLStreamHandlerPluginExtension
can be used.- Since:
- 13.2
-
-
Field Summary
-
Fields inherited from interface ro.sync.exml.plugin.urlstreamhandler.URLStreamHandlerPluginExtensionConstants
ADVICE_CLOSE, ADVICE_RELOAD, LOCATION_HEADER, OXYGEN_ACTION_HEADER, OXYGEN_READ_ONLY_HEADER, OXYGEN_READ_ONLY_REASON_CODE_HEADER, OXYGEN_READ_ONLY_REASON_HEADER, OXYGEN_SAVE_TYPE, SAVE_AS, SAVE_AUTO
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
canHandleProtocol(java.lang.String protocol)
Check if the plugin can handle a specific protocol.java.net.URLStreamHandler
getURLStreamHandler(java.net.URL url)
Get the URL handler for the specified URL.
-
-
-
Method Detail
-
canHandleProtocol
boolean canHandleProtocol(java.lang.String protocol)
Check if the plugin can handle a specific protocol. If this method returnstrue
for a specific protocol, thegetURLStreamHandler(URL)
method will be called for each opened connection of an URL having this protocol.
The plugin can handle multiple protocols like:http
,https
,ftp
,sftp
.- Parameters:
protocol
- The protocol.- Returns:
true
if this plugin extension can handle this protocol type.
-
getURLStreamHandler
java.net.URLStreamHandler getURLStreamHandler(java.net.URL url)
Get the URL handler for the specified URL. This method is called for each opened connection of an URL with a protocol for which thecanHandleProtocol(String)
method returnstrue
. If this method returnsnull
, the OxygenURLStreamHandler
is used.- Parameters:
url
- The URL to provide a handler for.- Returns:
- The URL stream handler.
-
-