activemq-cpp-3.9.0
|
Concrete implementations of the abstract. More...
#include <src/main/decaf/net/URLConnection.h>
Public Member Functions | |
virtual | ~URLConnection () |
virtual void | connect ()=0 |
Establishes the connection to the earlier configured resource. More... | |
bool | getAllowUserInteraction () const |
Gets the option value which indicates whether user interaction is allowed on this URLConnection. More... | |
void | setAllowUserInteraction (bool newValue) |
Sets the flag indicating whether this connection allows user interaction or not. More... | |
std::string | getContentEncoding () const |
Gets the content encoding type specified by the response header field content-encoding or empty string if this field is not set. More... | |
int | getContentLength () const |
Gets the content length in bytes specified by the response header field 'content-length' or '-1' if this field is not set. More... | |
std::string | getContentType () const |
Gets the MIME-type of the content specified by the response header field 'content-type' or empty string if type is unknown. More... | |
long long | getDate () const |
Gets the timestamp when this response has been sent as a date in milliseconds since January 1, 1970 GMT or '0' if this timestamp is unknown. More... | |
bool | getDefaultUseCaches () const |
Gets the default setting whether this connection allows using caches. More... | |
void | setDefaultUseCaches (bool newValue) |
Sets the default value for the flag indicating whether this connection allows to use caches. More... | |
bool | getDoInput () const |
Gets the value of the option. More... | |
void | setDoInput (bool newValue) |
Sets the flag indicating whether this URLConnection allows input. More... | |
bool | getDoOutput () const |
Gets the value of the option doOutput which specifies whether this connection allows to send data. More... | |
void | setDoOutput (bool newValue) |
Sets the flag indicating whether this URLConnection allows output. More... | |
long | getExpiration () const |
Gets the timestamp when this response will be expired in milliseconds since January 1, 1970 GMT or 0 if this timestamp is unknown. More... | |
URL | getURL () const |
Gets the URL represented by this URLConnection. More... | |
bool | getUseCaches () const |
Gets the value of the flag which specifies whether this URLConnection allows to use caches. More... | |
void | setUseCaches (bool newValue) |
Sets the flag indicating whether this connection allows to use caches or not. More... | |
int | getConnectTimeout () const |
Gets the configured connecting timeout. More... | |
void | setConnectTimeout (int timeout) |
Sets the timeout value in milliseconds for establishing the connection to the resource pointed by this URLConnection instance. More... | |
int | getReadTimeout () const |
Gets the configured timeout for reading from the input stream of an established connection to the resource. More... | |
void | setReadTimeout (int timeout) |
Sets the timeout value in milliseconds for reading from the input stream of an established connection to the resource. More... | |
virtual std::string | toString () const |
Returns the string representation containing the name of this class and the URL. More... | |
virtual std::string | getHeaderField (int pos DECAF_UNUSED) const |
Gets the header value at the field position pos or empty string if the header has fewer than pos fields. More... | |
virtual std::string | getHeaderField (const std::string &key DECAF_UNUSED) const |
Gets the value of the header field specified by key or empty string if there is no field with this name. More... | |
long long | getHeaderFieldDate (const std::string &field, long long defaultValue) const |
Gets the specified header value as a date in milliseconds since January 1, 1970 GMT. More... | |
int | getHeaderFieldInt (const std::string &field, int defaultValue) const |
Gets the specified header value as a number. More... | |
long long | getLastModified () const |
Gets the value of the response header field 'last-modified' or zero if this value is not set. More... | |
virtual decaf::io::InputStream * | getInputStream () |
Gets an InputStream for reading data from the resource pointed by this URLConnection. More... | |
virtual decaf::io::OutputStream * | getOutputStream () |
Gets an OutputStream for writing data to this URLConnection. More... | |
long long | getIfModifiedSince () const |
Gets the point of time since when the data must be modified to be transmitted. More... | |
void | setIfModifiedSince (long long newValue) |
Sets the point of time since when the data must be modified to be transmitted. More... | |
Static Public Member Functions | |
static bool | getDefaultAllowUserInteraction () |
Gets the default setting whether this connection allows user interaction. More... | |
static void | setDefaultAllowUserInteraction (bool allows) |
Sets the default value for the flag indicating whether this connection allows user interaction or not. More... | |
Protected Member Functions | |
URLConnection (const URL &url) | |
Protected Attributes | |
URL | url |
long long | ifModifiedSince |
The data must be modified more recently than this time in milliseconds since January 1, 1970, GMT to be transmitted. More... | |
bool | useCaches |
Specifies whether the using of caches is enabled or the data has to be recent for every request. More... | |
bool | connected |
Specifies whether this. More... | |
bool | doOutput |
Specifies whether this. More... | |
bool | doInput |
Specifies whether this. More... | |
bool | allowUserInteraction |
Specifies whether this. More... | |
Concrete implementations of the abstract.
class provide a communication link to a URL for exchanging data with a specific protocol type. A
can only be set up after the instantiation but before connecting to the remote resource.
|
virtual |
|
pure virtual |
Establishes the connection to the earlier configured resource.
The connection can only be set up before this method has been called.
IOException | if an error occurs while connecting to the resource. |
|
inline |
Gets the option value which indicates whether user interaction is allowed on this URLConnection.
int decaf::net::URLConnection::getConnectTimeout | ( | ) | const |
Gets the configured connecting timeout.
|
inline |
Gets the content encoding type specified by the response header field content-encoding or empty string if this field is not set.
|
inline |
Gets the content length in bytes specified by the response header field 'content-length' or '-1' if this field is not set.
|
inline |
Gets the MIME-type of the content specified by the response header field 'content-type' or empty string if type is unknown.
|
inline |
Gets the timestamp when this response has been sent as a date in milliseconds since January 1, 1970 GMT or '0' if this timestamp is unknown.
|
inlinestatic |
Gets the default setting whether this connection allows user interaction.
|
inline |
Gets the default setting whether this connection allows using caches.
|
inline |
Gets the value of the option.
which specifies whether this connection allows to receive data.
|
inline |
Gets the value of the option doOutput which specifies whether this connection allows to send data.
|
inline |
Gets the timestamp when this response will be expired in milliseconds since January 1, 1970 GMT or 0 if this timestamp is unknown.
|
inlinevirtual |
Gets the header value at the field position pos or empty string if the header has fewer than pos fields.
The current implementation of this method returns always empty string.
pos | the field position of the response header. |
|
inlinevirtual |
Gets the value of the header field specified by key or empty string if there is no field with this name.
The current implementation of this method returns always empty string.
key | the name of the header field. |
long long decaf::net::URLConnection::getHeaderFieldDate | ( | const std::string & | field, |
long long | defaultValue | ||
) | const |
Gets the specified header value as a date in milliseconds since January 1, 1970 GMT.
Returns the defaultValue if no such header field could be found.
field | the header field name whose value is needed. |
defaultValue | the default value if no field has been found. |
int decaf::net::URLConnection::getHeaderFieldInt | ( | const std::string & | field, |
int | defaultValue | ||
) | const |
Gets the specified header value as a number.
Returns the defaultValue} if no such header field could be found or the value could not be parsed as an Integer.
field | the header field name whose value is needed. |
defaultValue | the default value if no field has been found. |
|
inline |
Gets the point of time since when the data must be modified to be transmitted.
Some protocols transmit data only if it has been modified more recently than a particular time.
|
inlinevirtual |
Gets an InputStream for reading data from the resource pointed by this URLConnection.
It throws an UnknownServiceException by default. This method must be overridden by its subclasses.
IOException | if no InputStream could be created. |
long long decaf::net::URLConnection::getLastModified | ( | ) | const |
Gets the value of the response header field 'last-modified' or zero if this value is not set.
|
inlinevirtual |
Gets an OutputStream for writing data to this URLConnection.
It throws an UnknownServiceException by default. This method must be overridden by its subclasses.
IOException | if no OutputStream could be created. |
int decaf::net::URLConnection::getReadTimeout | ( | ) | const |
Gets the configured timeout for reading from the input stream of an established connection to the resource.
|
inline |
Gets the URL represented by this URLConnection.
|
inline |
Gets the value of the flag which specifies whether this URLConnection allows to use caches.
void decaf::net::URLConnection::setAllowUserInteraction | ( | bool | newValue | ) |
Sets the flag indicating whether this connection allows user interaction or not.
This method can only be called prior to the connection establishment.
newValue | the value of the flag to be set. |
IllegalStateException | if this method attempts to change the flag after the connection has been established. |
void decaf::net::URLConnection::setConnectTimeout | ( | int | timeout | ) |
Sets the timeout value in milliseconds for establishing the connection to the resource pointed by this URLConnection instance.
A SocketTimeoutException is thrown if the connection could not be established in this time. Default is 0 which stands for an infinite timeout.
timeout | the connecting timeout in milliseconds. |
IllegalArgumentException | if the parameter timeout is less than zero. |
|
inlinestatic |
Sets the default value for the flag indicating whether this connection allows user interaction or not.
Existing URLConnections are unaffected.
allows | the default value of the flag to be used for new connections. |
void decaf::net::URLConnection::setDefaultUseCaches | ( | bool | newValue | ) |
Sets the default value for the flag indicating whether this connection allows to use caches.
Existing URLConnections are unaffected.
newValue | the default value of the flag to be used for new connections. |
void decaf::net::URLConnection::setDoInput | ( | bool | newValue | ) |
Sets the flag indicating whether this URLConnection allows input.
It cannot be set after the connection is established.
newValue | the new value for the flag to be set. |
IllegalAccessError | if this method attempts to change the value after the connection has been already established. |
void decaf::net::URLConnection::setDoOutput | ( | bool | newValue | ) |
Sets the flag indicating whether this URLConnection allows output.
It cannot be set after the connection is established.
newValue | the new value for the flag to be set. |
IllegalAccessError | if this method attempts to change the value after the connection has been already established. |
void decaf::net::URLConnection::setIfModifiedSince | ( | long long | newValue | ) |
Sets the point of time since when the data must be modified to be transmitted.
Some protocols transmit data only if it has been modified more recently than a particular time. The data will be transmitted regardless of its timestamp if this option is set to 0.
newValue | the time in milliseconds since January 1, 1970 GMT. |
IllegalStateException | if this URLConnection has already been connected. |
void decaf::net::URLConnection::setReadTimeout | ( | int | timeout | ) |
Sets the timeout value in milliseconds for reading from the input stream of an established connection to the resource.
A SocketTimeoutException is thrown if the connection could not be established in this time. Default is code 0 which stands for an infinite timeout.
timeout | the reading timeout in milliseconds. |
IllegalArgumentException | if the parameter timeout is less than zero. |
void decaf::net::URLConnection::setUseCaches | ( | bool | newValue | ) |
Sets the flag indicating whether this connection allows to use caches or not.
This method can only be called prior to the connection establishment.
newValue | the value of the flag to be set. |
IllegalStateException | if this method attempts to change the flag after the connection has been established. |
|
inlinevirtual |
Returns the string representation containing the name of this class and the URL.
|
protected |
Specifies whether this.
allows user interaction as it is needed for authentication purposes.
|
protected |
Specifies whether this.
is already connected to the remote resource. If this field is set to
the flags for setting up the connection are not changeable anymore.
|
protected |
Specifies whether this.
allows receiving data.
|
protected |
Specifies whether this.
allows sending data.
|
protected |
The data must be modified more recently than this time in milliseconds since January 1, 1970, GMT to be transmitted.
|
protected |
|
protected |
Specifies whether the using of caches is enabled or the data has to be recent for every request.