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

E10653-04

oracle.adf.model.connection.url
Class FileURLConnection

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

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

FileURLConnection represents a URLConnection resource to a local file providing the services published by the URLConnection.

Since:
10.1.3
See Also:
URLConnection

Field Summary
protected static java.lang.String PROTOCOL
           
 
Fields inherited from interface oracle.adf.model.connection.url.URLConnection
ATTR_NAME, ATTR_URL
 
Constructor Summary
protected FileURLConnection(java.lang.String name, DocumentFragment description, java.util.Hashtable environment)
          Instantiate this URLConnection instance from the description and the corresponding environment.
protected FileURLConnection(java.lang.String name, java.net.URL url)
          Instantiate this URLConnection instance for the File 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 for the URL Connection.
 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 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

PROTOCOL

protected static final java.lang.String PROTOCOL
See Also:
Constant Field Values
Constructor Detail

FileURLConnection

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

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

FileURLConnection

protected FileURLConnection(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. 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

setProxy

public void setProxy(Proxy proxy)
Configure the proxy details for the URL access
 
 This is not supported for the File Protocol.
 A {#link java.lang.UnsupportedOperationException} is thrown if the client
 attempts to invoke this operation on this connection instance
 
 

Specified by:
setProxy in interface URLConnection
Parameters:
proxy - The Proxy details needed to access the URL
Throws:
{#java.lang.UnsupportedOperationException} - always when invoked on the file connection.

getProxy

public Proxy getProxy()
Get the proxy details for the URL Connection.
 
 This is not supported for the File Protocol.
 A null is always returned when a client invokes
 this operation on the file connection.
 
 

Specified by:
getProxy in interface URLConnection
Returns:
null always.

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.

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

getAuthenticationScheme

public AuthenticationScheme getAuthenticationScheme()
Get the AuthenticationScheme used by this connection to authenticate against the endpoint
 
  As of current implementation no Authentication schemes are supported
  for this FileURLConnection. Hence a call to this API by the client will
  always return null
 

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

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

setTimeout

public void setTimeout(int timeout)
Set the timeout property for the connection. This is a NOP for the FileURLConnection. Attempt to set the timeout on the FileURLConnection will not alter the state of the connection in anyway.

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

getTimeout

public int getTimeout()
Get the timeout set on this connection. This is a NOP on the FileURLConnection

Specified by:
getTimeout in interface URLConnection
Returns:
Always returns -1, to indicate this property is not valid on the FileURLConnection.

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

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.

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

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

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 - The ConnectionPool from which this connection instance was allocated.

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

E10653-04

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