net.refractions.udig.catalog.ui
Class UDIGConnectionFactory

java.lang.Object
  extended by net.refractions.udig.catalog.ui.UDIGConnectionFactory
Direct Known Subclasses:
AbstractUDIGConnectionFactory, FileConnectionFactory, NewServiceConnectionFactory

public abstract class UDIGConnectionFactory
extends java.lang.Object

Implementations of this class provide connection information based on context.

The connection information can be in the form of a map of connection Parameters, or a url, or both.

Implementations of this class have two responsibilities. The first is to create a set of connection parameters based on context. The second is to create a user interface capable of capturing user connection parameters.

Implementations of this class are provided via the net.refractions.udig.catalog.ui.connectionFactory extension point.

Author:
Justin Deoliveira,Refractions Research Inc.,jdeolive@refractions.net

Field Summary
protected  UDIGConnectionFactoryDescriptor descriptor
           
static java.lang.String XPID
          extension point id
 
Constructor Summary
UDIGConnectionFactory()
           
 
Method Summary
abstract  boolean canProcess(java.lang.Object context)
          Determines if the connection factory is capable of providing some connection information based on the context object.
 UDIGConnectionPage createConnectionPage(int pageIndex)
          This method returns the wizard page used to capture connection parameters.
abstract  java.util.Map<java.lang.String,java.io.Serializable> createConnectionParameters(java.lang.Object context)
          Get the connection parameters based on the provided context.
abstract  java.net.URL createConnectionURL(java.lang.Object context)
          Get a connection url based on the provided context.
 void setDescriptor(UDIGConnectionFactoryDescriptor descriptor)
          Sets the descriptor which describes the connection factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XPID

public static final java.lang.String XPID
extension point id

See Also:
Constant Field Values

descriptor

protected UDIGConnectionFactoryDescriptor descriptor
Constructor Detail

UDIGConnectionFactory

public UDIGConnectionFactory()
Method Detail

canProcess

public abstract boolean canProcess(java.lang.Object context)
Determines if the connection factory is capable of providing some connection information based on the context object.

Parameters:
object - The object to be "processed" or "adapted" into connection information.
Returns:
True if the info can be returned based on the context, otherwise false.

createConnectionParameters

public abstract java.util.Map<java.lang.String,java.io.Serializable> createConnectionParameters(java.lang.Object context)
Get the connection parameters based on the provided context.

Context is often data from a workbench selection, but does not have to be.

Parameters:
object - The object to be "processed" or "adapted" into a map of connection parameters.
Returns:
Map of connection parameters, or null if no such parameters could be created.

createConnectionURL

public abstract java.net.URL createConnectionURL(java.lang.Object context)
Get a connection url based on the provided context.

Context is often data from a workbench selection, but does not have to be.

Parameters:
object - The object to be "processed" or "adapted" into a url.
Returns:
An url, or null if no such url can be created.

setDescriptor

public void setDescriptor(UDIGConnectionFactoryDescriptor descriptor)
Sets the descriptor which describes the connection factory.


createConnectionPage

public UDIGConnectionPage createConnectionPage(int pageIndex)
This method returns the wizard page used to capture connection parameters. Subclasses may extend, but not override this method.

Returns:
A wizard connection page used to capture connection parameters.