|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.1.0) E13403-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectoracle.javatools.db.AbstractDBObjectProvider
oracle.jdeveloper.offlinedb.OfflineDBObjectProvider
public abstract class OfflineDBObjectProvider
Extension of DBObjectProvider for the offline projects. Instead of the object definitions being stored in a Database Dictionary they are stored as XML files in a Project.
See DBObjectProvider for a full list of the methods available. Where the offline database has specific behaviour for a method it will have doc included (overriden) for this class.
For more information on using the offlinedb read the package documentation.
oracle.jdeveloper.offlinedb
Field Summary |
---|
Fields inherited from class oracle.javatools.db.AbstractDBObjectProvider |
---|
CASE_SENSITIVE_NAME_POLICY, EMPTY_LIST, LOWER_CASE_NAME_POLICY, MIXED_CASE_NAME_POLICY, TIMESTAMP_PROPERTY, UPPER_CASE_NAME_POLICY |
Fields inherited from interface oracle.javatools.db.DBObjectProvider |
---|
CREATE_PRIVILEDGE, DELETE_PRIVILEDGE, MODIFY_PRIVILEDGE, NEW_FROM_TEMPLATE_TYPE |
Constructor Summary | |
---|---|
protected |
OfflineDBObjectProvider(ProviderSettings settings,
java.net.URL url)
|
Method Summary | |
---|---|
abstract boolean |
canCreate(SchemaObject object,
boolean replace)
Returns true if the schema for this object exists, and the file representing this object can be saved. |
abstract void |
createObject(SchemaObject object,
boolean replace)
Used to create (or replace) a given SchemaObject. |
abstract void |
createSchema(Schema schema,
boolean replace)
Creates (or replaces) the given Schema. |
protected SchemaObject |
createSchemaObjectImpl(java.lang.String type,
Schema schema,
java.lang.String name)
Creates a schema object by looking on the filesystem (using listAllObjects) for the appropriate filename. |
protected DBObject |
findByID(DBObjectID id)
Finds a given object by ID. |
DBObject |
findGeneratedObject(DBObjectID id)
Deprecated. |
DBObject |
findImportedObject(DBObjectID id)
Deprecated. |
static OfflineDBObjectProvider |
findProvider(Project project,
BaseObjectID objID)
Iterates through the project's providers, and see if any contain a matching object id. |
static OfflineDBObjectProvider |
findProvider(Project p,
java.lang.String id)
Finds a provider by its ID in the given Project. |
static OfflineDBObjectProvider |
getDBObjectProvider(Context c)
Returns the provider for the given ide context. |
abstract Schema |
getDefaultSchema()
Returns the default schema for this provider - this schema may not (yet) exist in the provider. |
protected java.util.logging.Logger |
getLogger()
Gets the logger to use in this provider. |
java.lang.String |
getName()
Returns the name of this provider (from the provider's settings). |
abstract oracle.jdevimpl.offlinedb.browser.NodeCache |
getNodeCache()
Returns the cache that maps DBObjectIDs to the URLs of the navigator nodes in the project. |
SchemaObject |
getObject(SchemaObjectNode node)
Retrieves the SchemaObject from the given node ensuring that the object's ID is correctly setup for this provider. |
abstract SchemaObject |
getObject(java.net.URL url)
Retrieves the SchemaObject from the given URL ensuring that the object's ID is correctly setup for this provider. |
abstract OfflineDBObjectFactory |
getObjectFactory()
Get the object factory for this provider. |
protected SchemaObject |
getObjectImpl(java.lang.String objectType,
Schema schema,
java.lang.String name)
|
SchemaObjectManager |
getObjectManager()
Returns the object manager for this provider. |
static java.util.Iterator<OfflineDBObjectProvider> |
getProviderIterator(Project p)
Returns an iterator over the providers in a project. |
static java.util.Iterator<OfflineDBObjectProvider> |
getProviderIterator(Project p,
boolean incProjDeps)
Returns an iterator over the providers in a project. |
Schema |
getSchema(java.lang.String name)
Gets a Schema of given name from this provider. |
abstract Schema |
getSchema(java.lang.String name,
boolean incBuiltInSchemas)
Offline specific method for retrieving the schema with a given name without looking through the built-in schemas. |
ProviderSettings |
getSettings()
Returns the current settings for this offline provider. |
static java.lang.String |
getUniqueProviderName(Project p,
java.lang.String name)
Returns a unique provier name for the given provider within the project based on the given base name. |
abstract java.lang.String |
getUniqueSchemaName(java.lang.String base)
Returns a unique name for a schema within this provider given the base name. |
java.net.URL |
getURL()
Returns the URL for this offline provider. |
protected abstract boolean |
isClosed()
Tests whether this provider is closed, and therefore will not function. |
boolean |
isDependentProvider(OfflineDBObjectProvider provider)
Determines whether the given provider is in the dependency chain for this provider, i.e. |
protected abstract java.util.Collection<SchemaObject> |
listAllObjects(java.lang.String[] types,
Schema schema,
java.lang.String baseName,
DBObjectFilter<SchemaObject> accepts)
Lists the objects by type, schema and name (can include wildcard '%') from this provide only, not its dependencies. |
static java.util.List<OfflineDBObjectProvider> |
listDBObjectProviders(Project p)
Lists the providers that already exist on the given project's offline database source path. |
static java.util.List<OfflineDBObjectProvider> |
listDBObjectProviders(Project p,
boolean incProjDeps)
Lists the providers that already exist on the given project's offline database source path. |
protected java.util.Collection<SchemaObject> |
listObjectsImpl(java.lang.String[] types,
Schema schema,
java.lang.String ref)
Internal listObjects implementation. |
Schema[] |
listSchemas()
Lists the available Schema from this provider. |
abstract Schema[] |
listSchemas(boolean incBuiltInSchemas)
Lists the available Schema from this provider. |
protected void |
setURL(java.net.URL newURL)
|
abstract void |
updateObject(SchemaObject oldObject,
SchemaObject newObject)
Updates the definition of an object held in this provider. |
abstract void |
updateSchema(Schema oldSchema,
Schema newSchema)
Updates a given schema with a new definition. |
void |
validateObject(DBObject object)
Validates the given object using the DBObjectValidator registered against that object's type. |
void |
validateObject(DBObject original,
DBObject update)
Validates the given object update using the DBObjectValidator registered against that object's type. |
void |
validateObjectProperty(DBObject original,
DBObject update,
java.lang.Object property)
Checks to see if the updated children of a given object are valid. |
void |
validateObjectProperty(DBObject object,
java.lang.Object property)
Checks to see if the children of a given object are valid. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface oracle.javatools.db.DBObjectProvider |
---|
canCreate, canDelete, canDelete, createObjects, deleteObjects, deleteSchema, getDescriptor, undeleteObject, undeleteObjects, updateObjects |
Constructor Detail |
---|
protected OfflineDBObjectProvider(ProviderSettings settings, java.net.URL url)
Method Detail |
---|
public final ProviderSettings getSettings()
public final java.net.URL getURL()
protected final void setURL(java.net.URL newURL)
public final java.lang.String getName()
getName
in class AbstractDBObjectProvider
getSettings()
public final SchemaObject getObject(SchemaObjectNode node) throws DBException
DBException
- is this is not possible - e.g. the given node is a
duplicate on the database path for this provider.public abstract SchemaObject getObject(java.net.URL url) throws DBException
DBException
- is this is not possible.public abstract OfflineDBObjectFactory getObjectFactory()
@Deprecated public final DBObject findImportedObject(DBObjectID id)
@Deprecated public final DBObject findGeneratedObject(DBObjectID id)
public abstract boolean canCreate(SchemaObject object, boolean replace)
true
is only returned if replace is also true, and the
object's file is writable.
object
- the SchemaObject describing the object to createreplace
- whether to replace an existing object. If
replace
is false and the object exists, canCreate must
return false.
public abstract void createObject(SchemaObject object, boolean replace) throws DBException
Update messages are fired to any observers following the outcome of the operation.
Note: if you call this method with an object whose Schema hasn't
explicitly been retrieved from the
getSchema()
method then one
of two things will happen:
createObject
in interface DBObjectProvider
createObject
in class AbstractDBObjectProvider
object
- the SchemaObject describing the object to create.replace
- whether to replace an existing object. If
replace
is false and the object exists, createObject will
fail.
DBException
- if an error is encountered creating the object.DBObjectProvider.createObjects(oracle.javatools.db.SchemaObject[], boolean)
public abstract void updateObject(SchemaObject oldObject, SchemaObject newObject) throws DBException
copyTo( DBObject target, boolean includeID )
oracle.javatools.db.DBUtil
with true
to include IDs) - e.g. Table copy = (Table)table.copyTo( null, true );
This method updates an old SchemaObject with the properties of the given new object. If the "copy" is successful a message is sent to all observers of the old object.
updateObject
in interface DBObjectProvider
updateObject
in class AbstractDBObjectProvider
oldObject
- the old version of the objectnewObject
- the new version of the object
DBException
- if the update failsDBObjectProvider.updateObjects(oracle.javatools.db.diff.ResultSet, boolean, boolean)
,
DBObject.copyTo(oracle.javatools.db.DBObject, boolean)
public final Schema[] listSchemas() throws DBException
DBException
listSchemas(boolean)
public void validateObject(DBObject object) throws ValidationException
validateObject
in interface DBObjectProvider
validateObject
in class AbstractDBObjectProvider
object
- The object to validate
ValidationException
- if the object is not valid. The exception will
describe the validation failure. A MissingValidatorException is thrown if
the provider has no validator for the given object type.public void validateObject(DBObject original, DBObject update) throws ValidationException
validateObject
in interface DBObjectProvider
validateObject
in class AbstractDBObjectProvider
ValidationException
- if the updated object is not valid. The
exception will describe the validation failure. A
MissingValidatorException
is thrown if the provider has no
validator for the given object type.public void validateObjectProperty(DBObject original, DBObject update, java.lang.Object property) throws ValidationException
DBObjectProvider
DBObjectProvider.validateObject(DBObject,DBObject)
is called.
validateObjectProperty
in interface DBObjectProvider
validateObjectProperty
in class AbstractDBObjectProvider
original
- The original version of the edited objectupdate
- The edited object to validateproperty
- An identifier for a specific property to validate
ValidationException
- if the object is not valid. The exception will
describe the validation failure. A MissingValidatorException
is
thrown if the provider has no validator for the given object type, or
property.public void validateObjectProperty(DBObject object, java.lang.Object property) throws ValidationException
DBObjectProvider
DBObjectProvider.validateObject(DBObject)
is called.
validateObjectProperty
in interface DBObjectProvider
validateObjectProperty
in class AbstractDBObjectProvider
object
- The object to validateproperty
- An identifier for a specific property to validate
ValidationException
- if the object is not valid. The exception will
describe the validation failure. A MissingValidatorException is thrown if
the provider has no validator for the given object type, or property.public boolean isDependentProvider(OfflineDBObjectProvider provider)
provider
- the provider to compare with
public abstract Schema[] listSchemas(boolean incBuiltInSchemas) throws DBException
incBuiltInSchemas
- if false, only schemas containing objects belonging
to (or visible to) the user are returned
DBException
- if an error is encountered listing the schemas.listSchemas()
public final Schema getSchema(java.lang.String name) throws DBException
name
- a string containing the name of the schema
DBException
- if an error is encountered getting the schemapublic abstract Schema getSchema(java.lang.String name, boolean incBuiltInSchemas) throws DBException
name
- the schema to search forincBuiltInSchemas
- whether to search the built-in schemas, e.g.
complex type schemas, PUBLIC schema for synonyms etc.
DBException
getSchema(java.lang.String)
public abstract Schema getDefaultSchema()
public abstract void createSchema(Schema schema, boolean replace) throws DBException
Offline database schemas are CASE INSENSITIVE - i.e. SCOTT = scott =
Scott. If Schema SCOTT exists, and this method is called with a Schema
called scott and replace is
true
then SCOTT will be replaced
with scott.
schema
- the schema being createdreplace
- whether to replace an existing schema
DBException
- if an error is encountered creating the schema
public abstract void updateSchema(Schema oldSchema, Schema newSchema) throws DBException
includeIDs = true
.
oldSchema
- the old version of the schemanewSchema
- the new version of the schema
DBException
- if the update failsDBObject.copyTo(oracle.javatools.db.DBObject, boolean)
public abstract java.lang.String getUniqueSchemaName(java.lang.String base)
public abstract oracle.jdevimpl.offlinedb.browser.NodeCache getNodeCache()
public SchemaObjectManager getObjectManager()
getObjectManager
in interface DBObjectProvider
getObjectManager
in class AbstractDBObjectProvider
protected SchemaObject getObjectImpl(java.lang.String objectType, Schema schema, java.lang.String name) throws DBException
getObjectImpl
in class AbstractDBObjectProvider
DBException
protected DBObject findByID(DBObjectID id) throws DBException
findByID
in class AbstractDBObjectProvider
DBException
DBObjectID.resolveID()
protected SchemaObject createSchemaObjectImpl(java.lang.String type, Schema schema, java.lang.String name) throws DBException
createSchemaObjectImpl
in class AbstractDBObjectProvider
DBException
protected java.util.Collection<SchemaObject> listObjectsImpl(java.lang.String[] types, Schema schema, java.lang.String ref) throws DBException
AbstractDBObjectProvider
listObjectsImpl
in class AbstractDBObjectProvider
DBException
protected abstract java.util.Collection<SchemaObject> listAllObjects(java.lang.String[] types, Schema schema, java.lang.String baseName, DBObjectFilter<SchemaObject> accepts)
If the accepts parameter is not null then each object is tested using it once opened. If the object is aceepted then the iteration is stopped and just that object is returned in the Collection. This allows a "search" for an object to jump out and not load all the objects.
AbstractDBObjectProvider.listObjects(java.lang.String, oracle.javatools.db.Schema)
protected abstract boolean isClosed()
protected java.util.logging.Logger getLogger()
AbstractDBObjectProvider
getLogger
in class AbstractDBObjectProvider
public static final OfflineDBObjectProvider getDBObjectProvider(Context c)
ProviderWizard.showMissingProviderError(oracle.ide.Context, java.lang.String)
public static final java.util.List<OfflineDBObjectProvider> listDBObjectProviders(Project p)
getProviderIterator(Project)
public static final java.util.List<OfflineDBObjectProvider> listDBObjectProviders(Project p, boolean incProjDeps)
p
- the project to look inincProjDeps
- whether to search the project's dependencies as well.getProviderIterator(Project)
public static final java.util.Iterator<OfflineDBObjectProvider> getProviderIterator(Project p)
listDBObjectProviders(Project)
public static final java.util.Iterator<OfflineDBObjectProvider> getProviderIterator(Project p, boolean incProjDeps)
p
- the project to look inincProjDeps
- whether to search the project's dependencies as well.
listDBObjectProviders(Project)
public static final java.lang.String getUniqueProviderName(Project p, java.lang.String name)
public static final OfflineDBObjectProvider findProvider(Project p, java.lang.String id)
The ID isn't used by the DBObjectProviderFactory - because the URL is required to retrieve the provider succefully. The ID is provider as a mechanism to uniquely identify a provider within the context of a project.
p
- the project to search inid
- the id of the provider
ProviderSettings.getID()
,
getProviderIterator(oracle.ide.model.Project)
public static final OfflineDBObjectProvider findProvider(Project project, BaseObjectID objID)
p
- the project to search inobjID
- the id of an object you expect to find in your provider. This
needs its type and guid set, but not the provider obviously.
findProvider(oracle.ide.model.Project, java.lang.String)
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.1.0) E13403-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |