com.im.df/1 5.9.1

com.im.df.impl.db.api
Class DBImplSchemaProvider

java.lang.Object
  extended by com.im.df.impl.db.api.DBImplSchemaProvider

public class DBImplSchemaProvider
extends Object

This class is used as starting point to DIF database implementation of DFSchemaProvider. Use createSchemaProvider(PropsProvider) method to create a new instance of DFSchemaProvider.

The basic idea is that this class creates a default implementation of DFSchemaProvider and through this other basic DIF objects will be accessed (DFSchema, DFEntities, etc.). To connect to data source this default implementation needs some configuration information (usually DB driver, DB URL, username, password, etc.). These properties can be modified during schema initialisation process and so should be stored for next time (e.g. remember username).

And so there is a DBImplSchemaProvider.PropsProvider interface which provide the current connection properties and is able to store updated values. The typical implementation of this interface will read/write the props from file.


Nested Class Summary
static interface DBImplSchemaProvider.PropsProvider
          Callback for reading/writing schema init properties.
static interface DBImplSchemaProvider.PropsProviderExtra
          Extra implementation can provide also a capability to be added to DFSchema when it's created.
static class DBImplSchemaProvider.ShowOpts
           
 
Field Summary
static String CUSTOM_OBJECT_POOL_FACTORY
          Constant used by DBImplSchemaProvider.PropsProvider.
static String DATABASE_CATALOG
          Constant used by DBImplSchemaProvider.PropsProvider.
static String DATABASE_DRIVER
          Constant used by DBImplSchemaProvider.PropsProvider.
static String DATABASE_IS_LOCAL
          Constant used by DBImplSchemaProvider.PropsProvider.
static String DATABASE_PASSWORD
          Constant used by DBImplSchemaProvider.PropsProvider.
static String DATABASE_SCHEMA
          Constant used by DBImplSchemaProvider.PropsProvider.
static String DATABASE_URL
          Constant used by DBImplSchemaProvider.PropsProvider.
static String DATABASE_USERNAME
          Constant used by DBImplSchemaProvider.PropsProvider.
static String IJC_LICENSE
           
static String IJC_PASSWORD
          Constant used by DBImplSchemaProvider.PropsProvider.
static String IJC_USERNAME
          Constant used by DBImplSchemaProvider.PropsProvider.
static String SCHEMA_AUTO_CONNECT
          Constant used by DBImplSchemaProvider.PropsProvider.
static String SCHEMA_ID
          Constant used by DBImplSchemaProvider.PropsProvider.
static String SCHEMA_NAME
          Constant used by DBImplSchemaProvider.PropsProvider.
static String SERVER_IS_REMOTE
          Constant used by DBImplSchemaProvider.PropsProvider.
static String SERVER_PASSWORD
          Constant used by DBImplSchemaProvider.PropsProvider.
static String SERVER_URL
          Constant used by DBImplSchemaProvider.PropsProvider.
static String SERVER_USERNAME
          Constant used by DBImplSchemaProvider.PropsProvider.
static String SHOW_OPTIONS_DB_USERNAME
           
static String SHOW_OPTIONS_IJC_USERNAME
           
static String SHOW_OPTIONS_IJCSERVER_USERNAME
           
static String SHOW_OPTIONS_MODE_SELECT
           
 
Constructor Summary
DBImplSchemaProvider()
           
 
Method Summary
static DBImplSchemaProvider.PropsProvider createDefaultReadOnlyPropsProvider(File schemaFile)
          Creates a new default instance of PropsProvider, which provides properties of the schema.
static DFSchemaProvider createSchemaProvider(DBImplSchemaProvider.PropsProvider propsProvider)
          Creates the schema provider based on properties given by propsProvider.
static void decryptUserAndPass(Properties props, Set<String> encryptedKeys)
           
static void encrypUserAndPass(Properties props, Set<String> originallyEncryptedKeys)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCHEMA_ID

public static final String SCHEMA_ID
Constant used by DBImplSchemaProvider.PropsProvider. DFSchema's id

See Also:
Constant Field Values

SCHEMA_NAME

public static final String SCHEMA_NAME
Constant used by DBImplSchemaProvider.PropsProvider. DFSchema's display name

See Also:
Constant Field Values

SCHEMA_AUTO_CONNECT

public static final String SCHEMA_AUTO_CONNECT
Constant used by DBImplSchemaProvider.PropsProvider. Should schema be auto-connected after project opening? If not present means 'false'

See Also:
Constant Field Values

DATABASE_IS_LOCAL

public static final String DATABASE_IS_LOCAL
Constant used by DBImplSchemaProvider.PropsProvider. Is the database local or remote?

See Also:
Constant Field Values

DATABASE_URL

public static final String DATABASE_URL
Constant used by DBImplSchemaProvider.PropsProvider. Database URL

See Also:
Constant Field Values

DATABASE_DRIVER

public static final String DATABASE_DRIVER
Constant used by DBImplSchemaProvider.PropsProvider. Database driver

See Also:
Constant Field Values

DATABASE_USERNAME

public static final String DATABASE_USERNAME
Constant used by DBImplSchemaProvider.PropsProvider. Database connection username

See Also:
Constant Field Values

DATABASE_PASSWORD

public static final String DATABASE_PASSWORD
Constant used by DBImplSchemaProvider.PropsProvider. Database connection password

See Also:
Constant Field Values

DATABASE_SCHEMA

public static final String DATABASE_SCHEMA
Constant used by DBImplSchemaProvider.PropsProvider. Database schema (some DBs don't use that)

See Also:
Constant Field Values

DATABASE_CATALOG

public static final String DATABASE_CATALOG
Constant used by DBImplSchemaProvider.PropsProvider. Database catalog (some DBs don't use that)

See Also:
Constant Field Values

CUSTOM_OBJECT_POOL_FACTORY

public static final String CUSTOM_OBJECT_POOL_FACTORY
Constant used by DBImplSchemaProvider.PropsProvider. to determine if custom GenericObjectPoolFactory

See Also:
Constant Field Values

SERVER_USERNAME

public static final String SERVER_USERNAME
Constant used by DBImplSchemaProvider.PropsProvider. Server connection username

See Also:
Constant Field Values

SERVER_PASSWORD

public static final String SERVER_PASSWORD
Constant used by DBImplSchemaProvider.PropsProvider. Server connection password

See Also:
Constant Field Values

SERVER_URL

public static final String SERVER_URL
Constant used by DBImplSchemaProvider.PropsProvider. Server URL

See Also:
Constant Field Values

SERVER_IS_REMOTE

public static final String SERVER_IS_REMOTE
Constant used by DBImplSchemaProvider.PropsProvider. Is DIF server implementation provided remotely ?

See Also:
Constant Field Values

IJC_LICENSE

public static final String IJC_LICENSE
See Also:
Constant Field Values

IJC_USERNAME

public static final String IJC_USERNAME
Constant used by DBImplSchemaProvider.PropsProvider. IJC username (if IJC authorization is used)

See Also:
Constant Field Values

IJC_PASSWORD

public static final String IJC_PASSWORD
Constant used by DBImplSchemaProvider.PropsProvider. IJC password (if IJC authorization is used)

See Also:
Constant Field Values

SHOW_OPTIONS_IJCSERVER_USERNAME

public static final String SHOW_OPTIONS_IJCSERVER_USERNAME
See Also:
Constant Field Values

SHOW_OPTIONS_IJC_USERNAME

public static final String SHOW_OPTIONS_IJC_USERNAME
See Also:
Constant Field Values

SHOW_OPTIONS_DB_USERNAME

public static final String SHOW_OPTIONS_DB_USERNAME
See Also:
Constant Field Values

SHOW_OPTIONS_MODE_SELECT

public static final String SHOW_OPTIONS_MODE_SELECT
See Also:
Constant Field Values
Constructor Detail

DBImplSchemaProvider

public DBImplSchemaProvider()
Method Detail

createSchemaProvider

public static DFSchemaProvider createSchemaProvider(DBImplSchemaProvider.PropsProvider propsProvider)
Creates the schema provider based on properties given by propsProvider. If you want to simplify the schema initialization, use DIFUtilities.registerWhenSchemaReady(DFSchemaProvider, SchemaReadyRunnable) then.

Parameters:
propsProvider - The PropsProvider which provides the properties required to initialize the DFSchemaProvider
Returns:
A fully initialized DFSchemaProvider instance.

createDefaultReadOnlyPropsProvider

public static DBImplSchemaProvider.PropsProvider createDefaultReadOnlyPropsProvider(File schemaFile)
                                                                             throws IOException
Creates a new default instance of PropsProvider, which provides properties of the schema. This properties provider is read-only, which means method DBImplSchemaProvider.PropsProvider.rewriteProperties(java.util.Properties, java.util.List) of returned object will throw UnsupportedOperationException.

Parameters:
schemaFile -
Returns:
The new default instance of PropsProvider
Throws:
IOException

encrypUserAndPass

public static void encrypUserAndPass(Properties props,
                                     Set<String> originallyEncryptedKeys)

decryptUserAndPass

public static void decryptUserAndPass(Properties props,
                                      Set<String> encryptedKeys)

com.im.df/1 5.9.1