|
Oracle Fusion Middleware Java API Reference for Oracle ADF Model 11g Release 1 (11.1.1) E10653-04 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface URLConnection
URLConnection represents a communication channel to a URL resource. The Connection provides services such as authentication , securing the communication channel, interaction management.
Clients intending to use the URLConnection must first call
open()
, which opens the channel. The underlying interaction
model is intialized. The interaction represents the actual channel to
the reosurce. Authentication if needed will be performed against the
resource. Once the connection has been successfully opened, the channel
is prepared for the communication to happen between the client and the
URL resource.
Every communication session is represented by an Interaction. The default
interaction mdoel for the URLConnection is HTTP / HTTPS. A client begins a
communication session by calling getInteraction()
. This will return
an instance of HttpClient.HTTPConnection
which represents the
actual physical connection for this URLConnection.
Connections representing other protocol models of communication must
implement their specific interaction models and override the necessary
methods to achieve the communication.
Once the communication has been completed, it is the client's responsibility
to release the connection by explicitly calling the close()
.
This will return the connection back to the provider to be released to the
connection pool.
Field Summary | |
---|---|
static java.lang.String |
ATTR_NAME
Connection Name attribute |
static java.lang.String |
ATTR_URL
Connection endpoint attribute |
Method Summary | |
---|---|
void |
close()
Close this connection. |
AuthenticationScheme |
getAuthenticationScheme()
Get the AuthenticationScheme used by this connection
to authenticate against the endpoint |
java.lang.Object |
getInteraction()
Start the communication session. |
java.lang.String |
getName()
Get the name of this URLConnection. |
Proxy |
getProxy()
Get the proxy details associated for this URL Connection. |
int |
getTimeout()
Get the timeout set on this connection. |
java.net.URL |
getURL()
Get the URL resource represented by this connection |
void |
open()
Open the connection. |
void |
release()
Release this connection instance back to the pool. |
void |
setProxy(Proxy proxy)
Configure the proxy details for the URL access |
void |
setTimeout(int timeout)
Set the timeout property for the connection. |
Field Detail |
---|
static final java.lang.String ATTR_NAME
static final java.lang.String ATTR_URL
Method Detail |
---|
java.lang.String getName()
void open() throws ConnectionException
{@link
- ConnectionException} if the connection failed to open.
ConnectionException
void setProxy(Proxy proxy)
proxy
- The Proxy details needed to access the URLProxy getProxy()
java.lang.Object getInteraction() throws ConnectionException
open()
before
starting the interaction. This is necessary to initialize and prepare the atual
physical channel for communication. The default interaction model for the
URLConnection is the HttpClient.HTTPConnection
.
The HTTPConnection
supports the HTTP and HTTPS protocols of
communication.
HTTPConnection
that represents the underlying
communication channel.
{@link
- ConnectionException} if an error occurred in starting the
interaction.
ConnectionException
AuthenticationScheme getAuthenticationScheme()
AuthenticationScheme
used by this connection
to authenticate against the endpoint
AuthenticationScheme
used by this
connection. If the connection does not use any authentication
null
is returned.java.net.URL getURL()
URL
resource of this connectionint getTimeout()
void setTimeout(int timeout)
timeout
- The timeout to be set on the connection instance.
This is the time in milliseconds.
A time of 0 means wait indefinitely.void close() throws ConnectionException
open()
on the connection again. Reopening the connection will reset the state
of the interaction associated with this connection.
{@link
- ConnectionException} if a failure occured in closing the
connection.
ConnectionException
void release() throws ConnectionException
{@link
- ConnectionException} if the connection could be released to
the pool.
ConnectionException
|
Oracle Fusion Middleware Java API Reference for Oracle ADF Model 11g Release 1 (11.1.1) E10653-04 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |