net.refractions.udig.catalog.service.database
Class DatabaseServiceDialect

java.lang.Object
  extended by net.refractions.udig.catalog.service.database.DatabaseServiceDialect

public abstract class DatabaseServiceDialect
extends java.lang.Object

This class abstracts out all of the service and database specific code for a Geotools Database-based DatastoreIService extension.

Author:
jeichar

Field Summary
 Param databaseParam
          The key of the parameter that identifies the database (within the database, this is concept is inherited from Postgis)
 Param hostParam
          The key that identifies the host server of the database
 DatabaseWizardLocalization localization
           
 Param passwordParam
          The key that identifies connecting user's password
 Param portParam
          The key that identifies the server port for connecting to the database
 Param schemaParam
          The key of the parameter that (at least in Postgis) identifies the schema that the table resides in.
 Param typeParam
          The key that indicates the type of Datastore to create.
 java.lang.String urlPrefix
          The prefix/host to put in a url that identifies this type of database.
 Param usernameParam
          The key that identifies connecting user's username
 
Constructor Summary
DatabaseServiceDialect(Param schemaParam, Param databaseParam, Param hostParam, Param portParam, Param usernameParam, Param passwordParam, Param typeParam, java.lang.String urlPrefix, DatabaseWizardLocalization localization)
           
 
Method Summary
 java.util.Collection<java.net.URL> constructResourceIDs(TableDescriptor[] descriptors, java.util.Map<java.lang.String,java.io.Serializable> params)
           
abstract  DatabaseConnectionRunnable createDatabaseConnectionRunnable(java.lang.String host, int port, java.lang.String username, java.lang.String password)
          Creates a DatabaseConnectionRunnable.
abstract  LookUpSchemaRunnable createLookupSchemaRunnable(java.lang.String host, int port, java.lang.String username, java.lang.String password, java.lang.String database)
          Creates a LookUpSchemaRunnable.
 java.util.Map<Control,Tab> createOptionConnectionPageTabs(TabFolder tabFolder, DataConnectionPage containingPage)
          The TabSelectionTab is always created, this method allows the specific implementation to add custom tabs.
abstract  IDialogSettings getDialogSetting()
           
abstract  void log(java.lang.String message, java.lang.Throwable e)
           
 java.net.URL toURL(java.util.Map<java.lang.String,java.io.Serializable> params)
           
 java.net.URL toURL(java.lang.String the_spec)
           
 java.net.URL toURL(java.lang.String the_username, java.lang.String the_password, java.lang.String the_host, java.lang.Integer intPort, java.lang.String the_database)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

schemaParam

public final Param schemaParam
The key of the parameter that (at least in Postgis) identifies the schema that the table resides in.


databaseParam

public final Param databaseParam
The key of the parameter that identifies the database (within the database, this is concept is inherited from Postgis)


hostParam

public final Param hostParam
The key that identifies the host server of the database


portParam

public final Param portParam
The key that identifies the server port for connecting to the database


usernameParam

public final Param usernameParam
The key that identifies connecting user's username


passwordParam

public final Param passwordParam
The key that identifies connecting user's password


typeParam

public final Param typeParam
The key that indicates the type of Datastore to create. For example PostgisDataStoreFactory#DBTYPE


urlPrefix

public final java.lang.String urlPrefix
The prefix/host to put in a url that identifies this type of database. For example the postgis one is: "jdbc.postgis"


localization

public final DatabaseWizardLocalization localization
Constructor Detail

DatabaseServiceDialect

public DatabaseServiceDialect(Param schemaParam,
                              Param databaseParam,
                              Param hostParam,
                              Param portParam,
                              Param usernameParam,
                              Param passwordParam,
                              Param typeParam,
                              java.lang.String urlPrefix,
                              DatabaseWizardLocalization localization)
Method Detail

constructResourceIDs

public java.util.Collection<java.net.URL> constructResourceIDs(TableDescriptor[] descriptors,
                                                               java.util.Map<java.lang.String,java.io.Serializable> params)

toURL

public java.net.URL toURL(java.util.Map<java.lang.String,java.io.Serializable> params)
                   throws java.net.MalformedURLException
Throws:
java.net.MalformedURLException

toURL

public java.net.URL toURL(java.lang.String the_username,
                          java.lang.String the_password,
                          java.lang.String the_host,
                          java.lang.Integer intPort,
                          java.lang.String the_database)
                   throws java.net.MalformedURLException
Throws:
java.net.MalformedURLException

toURL

public java.net.URL toURL(java.lang.String the_spec)
                   throws java.net.MalformedURLException
Throws:
java.net.MalformedURLException

getDialogSetting

public abstract IDialogSettings getDialogSetting()

log

public abstract void log(java.lang.String message,
                         java.lang.Throwable e)

createDatabaseConnectionRunnable

public abstract DatabaseConnectionRunnable createDatabaseConnectionRunnable(java.lang.String host,
                                                                            int port,
                                                                            java.lang.String username,
                                                                            java.lang.String password)
Creates a DatabaseConnectionRunnable.

Parameters:
host - the url of the host to connect to
port - the port on which to connect
username - the username for connections
password - the password for connection
database - In postgis there are databases within a database. This is a common construct but often named differently. Please try to make the mapping.
Returns:
DatabaseConnectionRunnable

createOptionConnectionPageTabs

public java.util.Map<Control,Tab> createOptionConnectionPageTabs(TabFolder tabFolder,
                                                                 DataConnectionPage containingPage)
The TabSelectionTab is always created, this method allows the specific implementation to add custom tabs. By default this method returns an empty HashMap

Parameters:
tabFolder - the parent folder of the tabs

createLookupSchemaRunnable

public abstract LookUpSchemaRunnable createLookupSchemaRunnable(java.lang.String host,
                                                                int port,
                                                                java.lang.String username,
                                                                java.lang.String password,
                                                                java.lang.String database)
Creates a LookUpSchemaRunnable.

Parameters:
host - the url of the host to connect to
port - the port on which to connect
username - the username for connections
password - the password for connection
database - In postgis there are databases within a database. This is a common construct but often named differently. Please try to make the mapping.
Returns:
LookUpSchemaRunnable