|
com.im.df.api 5.9 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface DFSchemaProvider
This interface should be used as primary source of connected and activated DFSchema objects and all its subelements (DFEntity/DFField/...). The typical usage is to get somewhere instance of DFSchemaProvider (perhaps through some factory) and then do these steps:
DFSchemaProvider schemaProvider = new SomeSchemaProviderImpl();
DFLock lock = schemaProvider.getLockable().obtainLock("Connect to schema");
DFEnvironmentRW env = EnvUtils.createDefaultEnvironmentRW(lock, "Connecting to schema", true);
for (;;) {
SchemaProvider.State state = schemaProvider.getState();
if (state.isSchemaReady())
break;
Object options = state.getOptions();
if (options != null) {
// customize options: find customizer and present to user.
// The dialog with customizer should have cancel button to stop connecting anytime
}
schemaProvider.proceedToNextState(env);
}
// Close the environment and release the lock - the best approach is to do this in finally block
// => and return the activated schema instance
DFSchema schema = schemaProvider.getState().isSchemaReady() ? schemaProvider.getSchema() : null;
Notes about events:getLockable() when the lock is released. This should happen either
after the initialization completes successfully (DFSchema is returned from the provider) or fails (no Schema is returned).
| Nested Class Summary | |
|---|---|
static interface |
DFSchemaProvider.State
State description |
static interface |
DFSchemaProvider.StepInfo
Return code of "Proceed to next state". |
| Field Summary | |
|---|---|
static String |
PROP_STATE
This property is fired whenever state changes |
| Method Summary | |
|---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
|
void |
closeSchema(DFEnvironmentRW env)
Closes the schema and invalidates DFSchema and all its subitems (property "valid" of DFItem). |
void |
deleteSchema(DFEnvironmentRW env,
boolean deleteMetaDataTables)
Deletes the schema metadata items from the database. |
Map<String,String> |
getAllSchemas(DFEnvironmentRO env)
Retrieves all schemas available at the database connection. |
DFLockable |
getLockable()
Provides lockable for state operations. |
SchemaType |
getSchemaType()
Provides a schema type. |
DFSchemaProvider.State |
getState()
Get current state |
void |
proceedToNextState(DFEnvironmentRW env)
Continue to next phase. |
void |
removePropertyChangeListener(PropertyChangeListener listener)
|
| Field Detail |
|---|
static final String PROP_STATE
| Method Detail |
|---|
DFSchemaProvider.State getState()
DFLockable getLockable()
SchemaType getSchemaType()
nullvoid proceedToNextState(DFEnvironmentRW env)
void closeSchema(DFEnvironmentRW env)
void deleteSchema(DFEnvironmentRW env,
boolean deleteMetaDataTables)
throws IOException
env - The f eedback environmentdeleteMetaDataTables - Whether IJC_* tables should be deleted as well.
IOException - if the schema is not open, or on schema-manipulation error.Map<String,String> getAllSchemas(DFEnvironmentRO env)
void addPropertyChangeListener(PropertyChangeListener listener)
void removePropertyChangeListener(PropertyChangeListener listener)
|
com.im.df.api 5.9 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||