|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.7.2) E13403-10 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.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, NEW_FROM_TEMPLATE_TYPE, TIMESTAMP_PROPERTY, UPPER_CASE_NAME_POLICY |
Fields inherited from interface oracle.javatools.db.DBObjectProvider |
---|
CREATE_PRIVILEDGE, DELETE_PRIVILEDGE, MODIFY_PRIVILEDGE |
Constructor Summary | |
---|---|
protected |
OfflineDBObjectProvider(ProviderSettings settings, java.net.URL url) |
Method Summary | ||
---|---|---|
abstract boolean |
canCreate(SystemObject object, boolean replace) Returns true if the schema for this object exists, and the file representing this object can be saved. |
|
protected SystemObject |
createObjectImpl(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. |
|
void |
createObjects(SystemObject[] objects, boolean replace) Used to create (or replace) the given SystemObjects. |
|
void |
deleteObjects(SystemObject[] objects, boolean cascade) Deletes a set of objects together. |
|
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) Deprecated. replaced by #findProviderByID(Project,String }. |
|
static OfflineDBObjectProvider |
findProviderByID(Project p, java.lang.String id) Finds a provider by its ID in the given Project. |
|
static OfflineDBObjectProvider |
findProviderByName(Context c, java.lang.String name) Finds an Offline Database with the given name in the given Context. |
|
static OfflineDBObjectProvider |
findProviderByName(Project p, java.lang.String name) Finds an Offline Database with the given name in the context of 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 NodeCache |
getNodeCache() Gets the cache that maps DBObjectIDs to the URLs of the files on disk the offline database objects are stored in. |
|
DBObject |
getObject(OfflineDBObjectNode node) Retrieves the object from the given node ensuring that the object's ID is correctly setup for this provider. |
|
SchemaObject |
getObject(SchemaObjectNode node) Retrieves the SchemaObject from the given node ensuring that the object's ID is correctly setup for this provider. |
|
abstract SystemObject |
getObject(java.net.URL url) Retrieves the SchemaObject from the given URL ensuring that the object's ID is correctly setup for this provider. |
|
protected
|
getObjectImpl(DBObjectCriteria<T> criteria) |
|
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, 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
|
listAllObjects(DBObjectCriteria<T> criteria) 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
|
listObjectsImpl(DBObjectCriteria<T> criteria) Internal listObjects implementation. |
|
protected void |
setURL(java.net.URL newURL) |
|
void |
undeleteObject(SchemaObject object) This method is not currently supported in the offline provider. |
|
void |
undeleteObjects(SchemaObject[] objects) This method is not currently supported in the offline provider. |
|
abstract void |
updateObjects(Difference rs, boolean replace, boolean cascade) Updates the definition objects held in this provider. |
|
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.String property) Checks to see if the updated children of a given object are valid. |
|
void |
validateObjectProperty(DBObject object, java.lang.String 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 |
---|
canDelete, getDescriptor |
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 final DBObject getObject(OfflineDBObjectNode 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 SystemObject getObject(java.net.URL url) throws DBException
DBException
- is this is not possible.
@Deprecated
public final DBObject findImportedObject(DBObjectID id)
@Deprecated
public final DBObject findGeneratedObject(DBObjectID id)
public abstract boolean canCreate(SystemObject object, boolean replace)
true
is only returned if replace is also true, and the object's file is writable.object
- the SystemObject describing the object to createreplace
- whether to replace an existing object. If replace
is false and the object exists, canCreate must return false.public final void createObjects(SystemObject[] objects, 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:
objects
- the SystemObject[] describing the objects to create.replace
- whether to replace an existing objects. If replace
is false and the object exists, createObjects will fail.DBException
- if an error is encountered creating the objects.DBObjectProvider.createObjects(oracle.javatools.db.SystemObject[], boolean)
public final void deleteObjects(SystemObject[] objects, boolean cascade) throws DBException
objects
- the objects to deletecascade
- whether to delete dependent objectsDBException
- if an error is encountered performing the deletepublic abstract void updateObjects(Difference rs, boolean replace, boolean cascade) 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 SystemObject with the properties of the given new object. If the "copy" is successful a message is sent to all observers of the old object.
rs
- the changes described as a Difference
- this should be a LIST Difference with the old objects as a() and the new objects as b().replace
- true if an existing object is to be replaced (when creating)cascade
- true if cascade delete should be used to replace an object (when deleting)DBException
DBObjectProvider.updateObjects(oracle.javatools.db.diff.Difference, boolean, boolean)
, DBObject.copyTo(oracle.javatools.db.DBObject, boolean)
public void undeleteObject(SchemaObject object) throws DBException
object
- the object to be undeletedDBException
- if an error is encountered performing the undeletepublic void undeleteObjects(SchemaObject[] objects) throws DBException
objects
- the objects to be undeletedDBException
- if an error is encountered performing the undeletepublic void validateObject(DBObject object) throws ValidationException
validateObject
in interface DBObjectProvider
validateObject
in class AbstractDBObjectProvider
object
- The object to validateValidationException
- 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.String 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 validateValidationException
- 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.String 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 validateValidationException
- 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 withpublic final 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
AbstractDBObjectProvider.getSchema(java.lang.String)
public abstract Schema getDefaultSchema()
public abstract java.lang.String getUniqueSchemaName(java.lang.String base)
public abstract NodeCache getNodeCache()
protected <T extends SystemObject> T getObjectImpl(DBObjectCriteria<T> criteria) throws DBException
getObjectImpl
in class AbstractDBObjectProvider
DBException
protected DBObject findByID(DBObjectID id) throws DBException
findByID
in class AbstractDBObjectProvider
DBException
DBObjectID.resolveID()
protected SystemObject createObjectImpl(java.lang.String type, Schema schema, java.lang.String name) throws DBException
createObjectImpl
in class AbstractDBObjectProvider
DBException
protected <T extends SystemObject> java.util.Collection<T> listObjectsImpl(DBObjectCriteria<T> criteria) throws DBException
AbstractDBObjectProvider
listObjectsImpl
in class AbstractDBObjectProvider
DBException
protected abstract <T extends SystemObject> java.util.Collection<T> listAllObjects(DBObjectCriteria<T> criteria)
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)
@Deprecated
public static final OfflineDBObjectProvider findProvider(Project p,
java.lang.String id)
#findProviderByID(Project,String
}.public static final OfflineDBObjectProvider findProviderByName(Context c, java.lang.String name)
c
- the context to searchname
- the name of the offline database to findpublic static final OfflineDBObjectProvider findProviderByName(Project p, java.lang.String name)
p
- the project to searchname
- the name of the offline database to findpublic static final OfflineDBObjectProvider findProviderByID(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 providerProviderSettings.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.7.2) E13403-10 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |