|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.2.0) E17493-03 |
|||||||||
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 | |
---|---|
static java.lang.String |
PROVIDER_TYPE Used to identify OfflineDBObjectProvider implementations when using DBObjectProviderFactory . |
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(java.net.URL url) |
Method Summary | ||
---|---|---|
boolean |
canCreate(SystemObject object, boolean replace) Returns true if the schema for this object exists, and the file representing this object can be saved. |
|
boolean |
canDelete(SystemObject object, boolean cascade) Returns true if a delete operation on the given schema object is likely to succeed. |
|
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. |
|
protected abstract java.net.URL |
findObjectURL(DBObjectID id) Finds the URL containing the given object ID. |
|
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. |
|
DBObject |
getDefaultTemplateForType(java.lang.String type) Returns the default template object for the given type, or null if none defined |
|
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). |
|
NodeCache |
getNodeCache() Deprecated. |
|
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) |
|
Node |
getObjectNode(DBObjectID id) Gets the Node for the given object id if it exists within the current provider. |
|
Node |
getObjectNode(SystemObject obj) Gets the Node for the given object id if it exists within the current provider. |
|
java.net.URL |
getObjectURL(DBObjectID id) Gets the URL for the given object id if it exists within the current provider. |
|
java.net.URL |
getObjectURL(SystemObject obj) Gets the URL for the given object id if it exists within the current provider. |
|
java.lang.Object |
getProviderIdentifier() Gets the String that identifies this DBObjectProvider uniquely (within providers of the same type). |
|
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. |
|
java.lang.String |
getProviderType() Gets the String that identifies the type of DBObjectProvider this is an instance of. |
|
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. |
|
abstract 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. |
|
boolean |
isEditable(DBObject object) Returns whether or not the object can be edited |
|
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. |
|
static java.lang.Iterable<java.net.URL> |
listDBObjectProviderURLs(Project p, boolean incProjDeps) Lists the URLs of any OfflineDBObjectProviders in the given project. |
|
protected
|
listObjectsImpl(DBObjectCriteria<T> criteria) Internal listObjects implementation. |
|
void |
setDefaultTemplateForType(java.lang.String type, DBObject so) Sets the default template object for the given type. |
|
protected void |
setURL(java.net.URL newURL) |
|
java.lang.String |
toString() |
|
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, wait, wait, wait |
Methods inherited from interface oracle.javatools.db.DBObjectProvider |
---|
getDescriptor |
Field Detail |
---|
public static final java.lang.String PROVIDER_TYPE
DBObjectProviderFactory
.
Constructor Detail |
---|
protected OfflineDBObjectProvider(java.net.URL url)
Method Detail |
---|
public final java.lang.String getProviderType()
DBObjectProvider
DBObjectProvider.getProviderIdentifier()
, DBObjectProviderFactory.findOrCreateProvider(String,Object)
public final java.lang.Object getProviderIdentifier()
DBObjectProvider
getName()
for a displayable String).DBObjectProvider.getProviderType()
, DBObjectProviderFactory.findOrCreateProvider(String,Object)
, DBObjectProvider.getName()
public abstract ProviderSettings getSettings()
public final java.net.URL getURL()
protected final void setURL(java.net.URL newURL)
public final java.lang.String getName()
getSettings()
protected java.util.logging.Logger getLogger()
AbstractDBObjectProvider
getLogger
in class AbstractDBObjectProvider
public java.lang.String toString()
toString
in class java.lang.Object
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.protected abstract java.net.URL findObjectURL(DBObjectID id)
public final java.net.URL getObjectURL(DBObjectID id)
id
- the DBObjectID to lookupgetObjectURL(SystemObject)
public final java.net.URL getObjectURL(SystemObject obj)
obj
- the object to lookupgetObjectURL(DBObjectID)
public final Node getObjectNode(SystemObject obj)
obj
- the object to lookupgetObjectNode(DBObjectID)
, getObjectURL(SystemObject)
public final Node getObjectNode(DBObjectID id)
id
- the DBObjectID to lookupgetObjectNode(SystemObject)
, getObjectURL(DBObjectID)
public boolean isEditable(DBObject object)
DBObjectProvider
isEditable
in interface DBObjectProvider
isEditable
in class AbstractDBObjectProvider
public 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 boolean canDelete(SystemObject object, boolean cascade)
object
- the object to checkcascade
- whether to assume a cascading delete should be used.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)
@Deprecated
public final 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(DBObjectCriteria)
protected abstract boolean isClosed()
Calling this method will attempt to reinitialize the provider. Do not call it unless the provider is expected to function.
public DBObject getDefaultTemplateForType(java.lang.String type)
AbstractDBObjectProvider
getDefaultTemplateForType
in interface DBObjectProvider
getDefaultTemplateForType
in class AbstractDBObjectProvider
public void setDefaultTemplateForType(java.lang.String type, DBObject so)
AbstractDBObjectProvider
setDefaultTemplateForType
in interface DBObjectProvider
setDefaultTemplateForType
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)
project
- 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)
public static java.lang.Iterable<java.net.URL> listDBObjectProviderURLs(Project p, boolean incProjDeps)
p
- the project to look inincProjDeps
- whether to include dependencies of the project
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.2.0) E17493-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |