activemq-cpp-3.9.0
|
The abstract class URLStreamHandler is the common superclass for all stream protocol handlers. More...
#include <src/main/decaf/net/URLStreamHandler.h>
Public Member Functions | |
virtual | ~URLStreamHandler () |
Protected Member Functions | |
virtual URLConnection * | openConnection (const URL &url)=0 |
Establishes a new connection to the resource specified by the given URL. More... | |
virtual URLConnection * | openConnection (const URL &url, const Proxy *proxy) |
Establishes a new connection to the resource specified by the given URL. More... | |
virtual bool | equals (const URL &source, const URL &other) const |
Provides the default equals calculation. More... | |
virtual int | hashCode (const URL &url) const |
Provides the default hashCode calculation. More... | |
virtual bool | hostsEqual (const URL &source, const URL &other) const |
Compares the host components of two URLs. More... | |
virtual bool | sameFile (const URL &source, const URL &other) const |
Compare two URLs to see whether they refer to the same file, i.e., having the same protocol, host, port, and path. More... | |
virtual decaf::lang::String | toExternalForm (const URL &url) const |
Converts the URL into a string representation. More... | |
virtual InetAddress | getHostAddress (const URL &url) const |
Attempts to get the IP address of the host. More... | |
virtual int | getDefaultPort () const |
Returns the default port for a URL parsed by this handler. More... | |
virtual void | parseURL (URL &url, const decaf::lang::String &spec, int start, int limit) |
Parses the clear text URL in spec into a URL object. More... | |
void | setURL (URL &url, const decaf::lang::String &protocol, const decaf::lang::String &host, int port, const decaf::lang::String &authority, const decaf::lang::String &userInfo, const decaf::lang::String &path, const decaf::lang::String &query, const decaf::lang::String &ref) |
Sets the fields of the URL This method is only intended to be used by subclasses of URLStreamHandler so it is kept protected. More... | |
Friends | |
class | URL |
The abstract class URLStreamHandler is the common superclass for all stream protocol handlers.
A stream protocol handler knows how to make a connection for a particular protocol type, such as http, ftp, or https etc.
In most cases, an instance of a URLStreamHandler subclass is not created directly by an application. Rather, the first time a protocol name is encountered when constructing a URL, the appropriate stream protocol handler is automatically created from a registered stream handler factory.
|
virtual |
|
protectedvirtual |
Provides the default equals calculation.
May be overridden by handlers for other protocols that have different requirements for equals().
source | The URL class that is invoking this comparison. |
other | The URL that is being compared to source. |
|
protectedvirtual |
Returns the default port for a URL parsed by this handler.
This method should be overidden by handlers with knowledge of the default port numbers as the default implementation simply returns -1.
Reimplemented in decaf::internal::net::file::FileHandler, decaf::internal::net::http::HttpHandler, and decaf::internal::net::https::HttpsHandler.
|
protectedvirtual |
Attempts to get the IP address of the host.
Based on DNS errors or other conditions it's possible this method will return an empty string.
url | The URL to construct the string from. |
Provides the default hashCode calculation.
May be overridden by handlers for other protocols that have different algorithms for computing a hash code..
url | The URL class that is invoking this hash code computation. |
|
protectedpure virtual |
Establishes a new connection to the resource specified by the given URL.
Since different protocols also have unique ways of connecting, it must be overridden by the subclass.
url | the URL to the resource where a connection has to be opened. |
IOException | if an I/O error occurs during opening the connection. |
Implemented in decaf::internal::net::file::FileHandler, decaf::internal::net::http::HttpHandler, and decaf::internal::net::https::HttpsHandler.
|
protectedvirtual |
Establishes a new connection to the resource specified by the given URL.
The version uses a Proxy to establish the connection if proxying is supported by the URLConnection implementation in use, otherwise the proxy is ignored.
url | the URL to the resource where a connection has to be opened. |
proxy | the Proxy through which the connection should be made. |
IOException | if an I/O error occurs during opening the connection. |
UnsupportedOperationException | if the protocol in use doesn't support this. |
Reimplemented in decaf::internal::net::file::FileHandler, decaf::internal::net::http::HttpHandler, and decaf::internal::net::https::HttpsHandler.
|
protectedvirtual |
Parses the clear text URL in spec into a URL object.
URL strings generally have the following format:
http://www.company.com/java/file1.java#reference
The string is parsed in HTTP format. If the protocol has a different URL format this method must be overridden.
|
protected |
Sets the fields of the URL This method is only intended to be used by subclasses of URLStreamHandler so it is kept protected.
protocol | the name of the protocol to use. |
host | the name of the host. |
port | the specific port number of the URL. Value of -1 represents the default port of the protocol. |
authority | the authority value. |
userInfo | the user info value. |
path | the path value. |
query | the query value. |
ref | the internal reference in the URL |
SecurityException | if the protocol handler of the URL is not this instance. |
|
protectedvirtual |
|
friend |