Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 1 (11.1.1.6.0)

E10653-07

oracle.adf.model.connection.url
Class HttpURLConnection

java.lang.Object
  extended by oracle.adf.model.connection.url.HttpURLConnection
All Implemented Interfaces:
javax.naming.Referenceable, URLConnection

public class HttpURLConnection
extends java.lang.Object
implements URLConnection, javax.naming.Referenceable

URLConnectionImpl represents a URLConnection resource, providing the services published by the URLConnection.

Since:
10.1.3
See Also:
URLConnection

Field Summary
protected  AuthenticationScheme mAuthenticationScheme
           
 
Fields inherited from interface oracle.adf.model.connection.url.URLConnection
ATTR_NAME, ATTR_URL
 
Constructor Summary
protected HttpURLConnection(java.lang.String name, DocumentFragment description, java.util.Hashtable environment)
          Instantiate this URLConnection instance from the description and the corresponding environment.
protected HttpURLConnection(java.lang.String name, java.net.URL url)
          Instantiate this URLConnection instance for the URL resource
 
Method Summary
 void close()
          Close this connection.
protected  DocumentFragment describe()
          Create the DocumentFragment that describes this connection to the Connection Architecture.
 boolean equals(java.lang.Object connection)
          Tests for the equality of another URLConnection instance with the current instance.
 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 Connection
 Proxy getProxy()
          Get the proxy details associated with this connection instance
 javax.naming.Reference getReference()
          Return the Reference that describes the details of this 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.
protected  void setAuthenticationScheme(AuthenticationScheme authScheme)
          Registers an AuthenticationScheme for this connection to use when authenticating against the Resource.
protected  void setPool(ConnectionPool pool)
          Set the Connection pool on this instance.
 void setProxy(Proxy proxy)
          Configure the proxy details for the URL access
 void setTimeout(int timeout)
          Set the timeout property for the connection.
 java.lang.String toString()
          Returns a String representation of this Connection.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mAuthenticationScheme

protected AuthenticationScheme mAuthenticationScheme
Constructor Detail

HttpURLConnection

protected HttpURLConnection(java.lang.String name,
                            java.net.URL url)
                     throws ConnectionException
Instantiate this URLConnection instance for the URL resource

Parameters:
name - The Name of this Connection.
url - The URL resource
Throws:
{@link - ConnectionException} if the connection instance could not be created.
ConnectionException

HttpURLConnection

protected HttpURLConnection(java.lang.String name,
                            DocumentFragment description,
                            java.util.Hashtable environment)
                     throws ConnectionException
Instantiate this URLConnection instance from the description and the corresponding environment.

Parameters:
name - The Name of this Connection.
description - The DocumentFragment describing this connection
Environment - The Environment having the necessary credential information for this connection.
Throws:
{@link - ConnectionException} if the connection instance could not be created.
ConnectionException
Method Detail

getName

public java.lang.String getName()
Get the name of this Connection

Specified by:
getName in interface URLConnection
Returns:
The name of this connection

open

public void open()
          throws ConnectionException
Open the connection. Prepare the underlying physical communication channel, by doing the necessary authentication and intializations. The physcial connection to the resource is established for the client to start an interaction.

Specified by:
open in interface URLConnection
Throws:
{@link - ConnectionException} if the connection failed to open.
ConnectionException

getInteraction

public java.lang.Object getInteraction()
                                throws ConnectionException
Start the communication session. The Interaction represents the actual physical connection to communication channel. The Client must call 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.

Specified by:
getInteraction in interface URLConnection
Returns:
The HTTPConnection that represents the underlying communication channel.
Throws:
{@link - ConnectionException} if an error occurred in starting the interaction.
ConnectionException

setProxy

public void setProxy(Proxy proxy)
Configure the proxy details for the URL access

Specified by:
setProxy in interface URLConnection
Parameters:
proxy - The Proxy details needed to access the URL

getProxy

public Proxy getProxy()
Get the proxy details associated with this connection instance

Specified by:
getProxy in interface URLConnection
Returns:
The {#link Proxy} details for this connection.

getReference

public javax.naming.Reference getReference()
                                    throws javax.naming.NamingException
Return the Reference that describes the details of this connection.

Specified by:
getReference in interface javax.naming.Referenceable
Returns:
The java.naming.Reference instance describing this connection
Throws:
javax.naming.NamingException - if an error was encountered.

getAuthenticationScheme

public AuthenticationScheme getAuthenticationScheme()
Get the AuthenticationScheme used by this connection to authenticate against the endpoint

Specified by:
getAuthenticationScheme in interface URLConnection
Returns:
The AuthenticationScheme used by this connection. If the connection does not use any authentication null is returned.

getTimeout

public int getTimeout()
Get the timeout set on this connection. This is the timeout property for the underlying interaction instance.

Specified by:
getTimeout in interface URLConnection
Returns:
The timeout set on the connection. If the connection has been released or the time out property is not valid for certain types of URL Connections then a -1 is returned.

setTimeout

public void setTimeout(int timeout)
Set the timeout property for the connection. Clients can set the timeout on the connection before calling the open. The timeout property is preserved for the life time of this connection instance until a subsequent setTimeOut is invoked. The timeout semantics are as described for the HTTPConnection.

Specified by:
setTimeout in interface URLConnection
Parameters:
timeout - The timeout to be set on the connection instance.

close

public void close()
           throws ConnectionException
Close this connection. Reset the state of the interaction of this connection. Clients can Reopen the connection by calling open() on the connection again. Reopening the connection will reset the state of the interaction associated with this connection.

Specified by:
close in interface URLConnection
Throws:
{@link - ConnectionException} if a failure occured in closing the connection.
ConnectionException

release

public void release()
             throws ConnectionException
Release this connection instance back to the pool. This should be the last operation on a connection instance typically. Once the connection instance is released all operations on the connection reference cease to be valid. The connection reference cannot be reused again within the context of the application. The Client must do a lookup to reuse this connection instance.

Specified by:
release in interface URLConnection
Throws:
{@link - ConnectionException} if the connection could be released to the pool.
ConnectionException

equals

public boolean equals(java.lang.Object connection)
Tests for the equality of another URLConnection instance with the current instance. A URLConnection instance is equal to another instance iff the name with which it is bound in the Connection Manager's JNDI context is the same.

Overrides:
equals in class java.lang.Object
Returns:
true if the connection instances are the same falseotherwise.

toString

public java.lang.String toString()
Returns a String representation of this Connection.

Overrides:
toString in class java.lang.Object
Returns:
The String representation of this URLConnection. This will typically be of the format name:URL

getURL

public java.net.URL getURL()
Get the URL resource represented by this connection

Specified by:
getURL in interface URLConnection
Returns:
The URL resource of this connection

setAuthenticationScheme

protected void setAuthenticationScheme(AuthenticationScheme authScheme)
Registers an AuthenticationScheme for this connection to use when authenticating against the Resource. The AuthenticationScheme allows for extensions, to define custom authentication modules for a connection.

Parameters:
authScheme - AuthenticationScheme to be used when authenticating against the resource.

setPool

protected void setPool(ConnectionPool pool)
Set the Connection pool on this instance. This is the pool from which this connection instance was allocated and will be released after usage.

Parameters:
pool -

describe

protected DocumentFragment describe()
                             throws ConnectionException
Create the DocumentFragment that describes this connection to the Connection Architecture. The Connection Architecture will then provide this description to the Connection Factory to recreate this connection instance

Returns:
The DocumentFragment describing this connection instance.
Throws:
ConnectionException

Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 1 (11.1.1.6.0)

E10653-07

Copyright © 1997, 2011, Oracle. All rights reserved.