|
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
public abstract class AbstractDBObjectProvider
Provides a base implementation of the DBObjectProvider
interface. AbstractDBObjectProvider
provides support for registering DBObjectBuilder
instances for building specific types of DBObject
s. The list of builders is used to determine the types of objects supported by the DBObjectProvider
implementation, to list the available objects of a specific type, and to retrieve the SchemaObject representations of the objects.
Subclasses are responsible for ensuring that DBObjectBuilder and DBObjectValidator instances are registered for the types of objects that will be supported. AbstractDBObjectProvider is abstract; sublasses are also responsible for providing implementations of those methods that do not have a generic implementation.
AbstractDBObjectProvider
also handles caching of DBObject
instances. When new instances are created, they are stored in a WeakHashMap. Subsequent requests for the same metadata will result in the same DBObject
instance being returned.
Field Summary | |
---|---|
static int |
CASE_SENSITIVE_NAME_POLICY Unquoted Names are case sensitive and stored in mixed case |
protected static java.lang.String[] |
EMPTY_LIST |
static int |
LOWER_CASE_NAME_POLICY Unquoted Names are case insensitive and stored in lower case |
static int |
MIXED_CASE_NAME_POLICY Unquoted Names are case insensitive and stored in mixed case |
static java.lang.String |
NEW_FROM_TEMPLATE_TYPE |
static java.lang.String |
TIMESTAMP_PROPERTY |
static int |
UPPER_CASE_NAME_POLICY Unquoted Names are case insensitive and stored in upper case |
Fields inherited from interface oracle.javatools.db.DBObjectProvider |
---|
CREATE_PRIVILEDGE, DELETE_PRIVILEDGE, MODIFY_PRIVILEDGE |
Constructor Summary | |
---|---|
protected |
AbstractDBObjectProvider() |
protected |
AbstractDBObjectProvider(boolean weakCaching) |
Method Summary | ||
---|---|---|
void |
addObjectListener(DBObjectListener list, DBObjectCriteria crit) Adds a listener that is notified of any updates to objects that match the given criteria. |
|
void |
addObjectListener(DBObjectListener list, SystemObject obj) Adds a listener that is notified of any updates to the given object. |
|
void |
addProviderListener(DBObjectProviderListener list) Adds the given listener to the list of registered listener for events on this provider. |
|
void |
addProviderListener(DBObjectProviderListener list) Deprecated. use addProviderListener(DBObjectProviderListener) |
|
protected void |
cacheObject(SystemObject object, boolean loadOperation) Adds an object to the cache. |
|
protected
|
checkCachedObject(T object) Use by getObjectImpl to verify that the given object in the cache is still valid. |
|
protected void |
clearAllCaches() Clears all the object caches. |
|
static java.lang.String |
convertObject(DBObject obj) Converts a DBObject into a String representation of the object name. |
|
protected SystemObject |
createByIDImpl(DBObjectID id) |
|
void |
createObject(SystemObject obj, boolean replace) Causes the creation of the object described by the specified meta data. |
|
protected SystemObject |
createObjectImpl(java.lang.String type, Schema schema, java.lang.String name) Uses listObjectsImpl to find or create an object with the given type, schema and name. |
|
protected SchemaObjectManager |
createObjectManager() Creates the object manager for this provider. |
|
void |
createSchema(Schema schema, boolean replace) Causes the creation of a new Schema in the persistent storage. |
|
void |
deleteObject(SystemObject obj, boolean cascade) Deletes the object. |
|
void |
deleteSchema(Schema schema, boolean cascade) Deletes the schema. |
|
protected void |
destroyCache() Destroys the object cache. |
|
protected DBObject |
findByID(DBObjectID id) |
|
protected SystemObject |
findObject(DBObjectID id) Looks for the specified object id in the cache. |
|
protected SystemObject |
findObject(java.lang.String type, Schema schema, java.lang.String name) Looks for the specified object in the cache. |
|
protected Schema |
findSchema(java.lang.String name) Method for use within the provider that retrieves a schema and doesn't check the database if the schema is found in the cache. |
|
protected void |
fireObjectsAdded(java.util.Collection<? extends SystemObject> sysObjs) |
|
void |
fireObjectsAdded(Schema schema, SchemaObject[] objs) Deprecated. |
|
protected void |
fireObjectsRemoved(java.util.Collection<? extends SystemObject> sysObjs) |
|
protected void |
fireObjectsRemoved(Schema schema, SchemaObject[] objs) Deprecated. |
|
protected void |
fireObjectUpdated(DBObjectChange change) Notifies all listeners of an update to a SystemObject. |
|
protected void |
fireProviderClosed() Fires a providerClosed event to all listeners. |
|
void |
fireProviderDeleted() Deprecated. |
|
protected void |
fireProviderOpened() Fires a providerOpened event to all listeners. |
|
protected void |
fireProviderReloaded() Fires a providerReloaded event to all listeners. |
|
protected void |
fireSchemaAdded(Schema schema) Deprecated. |
|
protected void |
fireSchemaObjectUpdated(DBObjectChange change) Deprecated. |
|
protected void |
fireSchemaRemoved(Schema schema) Deprecated. |
|
protected void |
fireSchemaUpdated(DBObjectChange change) Deprecated. |
|
protected DBObjectBuilder |
getBuilderForType(java.lang.String type) Retrieves the DBObjectBuilder registered for a type of object. |
|
protected java.lang.Object |
getCachedTimestamp(java.lang.Object obj) Use to check whether timestamps are suspended and that the given object is a key in the cache of timestamp values. |
|
SchemaObjectManager |
getCascadeManager() By default creates a SchemaObjectManager. |
|
protected int |
getCasePolicy() Retrieves the provider's case policy for unquoted names. |
|
DataType |
getDataType(java.lang.String typeName) Retrieves the datatype represented by a specific name. |
|
DDLGenerator |
getDDLGenerator() Convinience method that wrap DatabaseDescriptor.getDDLGenerator |
|
DBObject |
getDefaultTemplateForType(java.lang.String type) Returns the default template object for the given type, or null if none defined |
|
DiffEngine |
getDiffEngine() Returns a diff engine setup with the appropriate set of differs for object updating. |
|
protected java.lang.Long |
getExistingTimestamp(SystemObject object) |
|
java.lang.String |
getExternalName(java.lang.String name) Converts the specified name into the format used externally to represent the identifier. |
|
java.lang.String |
getExternalName(java.lang.String name, java.lang.String objectType) Converts the specified name into the format used externally to represent the identifier. |
|
protected java.lang.Long |
getExternalTimestamp(SystemObject object) |
|
protected java.lang.Long |
getExternalTimestampImpl(SystemObject object) Retrieves the external timestamp for the specified object. |
|
java.lang.String |
getIdentifierQuoteString() Retrieves the string used to quote identifiers. |
|
java.lang.String |
getInternalName(java.lang.String name) Converts the specified name into the format used internally within the metadata. |
|
java.lang.String |
getInternalName(java.lang.String name, java.lang.String objectType) Converts the specified name into the format used internally within the metadata. |
|
protected java.util.logging.Logger |
getLogger() Gets the logger to use in this provider. |
|
|
getObject(DBObjectCriteria<T> criteria) Retrieves the SystemObject representing a specific database object. |
|
SchemaObject |
getObject(java.lang.String objectType, Schema schema, java.lang.String name) Retrieves the SchemaObject representing a specific database object. |
|
DBObjectFactory |
getObjectFactory() Get the object factory for this provider. |
|
protected
|
getObjectImpl(DBObjectCriteria<T> criteria) |
|
SchemaObjectManager |
getObjectManager() Deprecated. |
|
DataType |
getOrCreateDataType(java.lang.String typeName) Retrieves the datatype represented by a specific name. |
|
PropertyManager |
getPropertyManager() Gets the PropertyManager (if available) for this provider. |
|
protected int |
getQuotedNameCasePolicy() Retrieves the provider's case policy for quoted names. |
|
Schema |
getSchema(java.lang.String name) Retrieves the Schema object associated with a specific name. |
|
SchemaObjectExpander[] |
getSchemaObjectExpanders() |
|
java.lang.Long |
getTimestamp(DBObjectID id) Retrieves the timestamp for the object represented by the given ID. |
|
java.lang.Long |
getTimestamp(java.lang.String type, Schema schema, java.lang.String objectName) Retrieves the timestamp representing the last modification time of the specified object's metadata. |
|
java.lang.String |
getUniqueName(java.lang.String type, DBObject contextObject, java.lang.String base) Returns a unique name for an object of given type within contextObject using base name. |
|
protected DBObjectValidator |
getValidatorForType(java.lang.String type) Retrieves the DBObjectValidator registered for a type of object. |
|
boolean |
hasObjectPrivilege(SystemObject object, java.lang.String priv) Checks to see whether the user has the requisite permissions to perform the specified operation on the given object. |
|
boolean |
hasPriviledge(java.lang.String type, Schema schema, java.lang.String priv) Deprecated. - use hasSystemPrivilege(java.lang.String, oracle.javatools.db.Schema, java.lang.String) |
|
boolean |
hasSystemPrivilege(java.lang.String type, Schema schema, java.lang.String priv) Checks to see whether the user has the requisite permissions to perform the specified operation. |
|
boolean |
isEditable(DBObject object) Returns whether or not the object can be edited |
|
boolean |
isNewFromTemplateType(java.lang.String type) Test whether the given type is the pseudo type used for new objects that are being created from a template. |
|
protected boolean |
isRequestedObject(SystemObject object, java.lang.String type, Schema schema, java.lang.String name) Returns true if SchemaObject object is of type type, owned by schema schema, and named name. |
|
boolean |
isValidName(java.lang.String name) Deprecated. - use isValidName( String type, String name ) |
|
boolean |
isValidName(java.lang.String type, java.lang.String name) Checks to see whether a name is valid. |
|
|
listObjects(DBObjectCriteria<T> criteria) Lists the objects from this provider that match the given criteria. |
|
SchemaObject[] |
listObjects(java.lang.String[] objectTypes, Schema schema) Lists the objects of multiple types available from this provider. |
|
SchemaObject[] |
listObjects(java.lang.String[] objectTypes, Schema schema, java.lang.String ref) Lists the objects of multiple types available from this provider. |
|
java.lang.String[] |
listObjects(java.lang.String objectType, Schema schema) Lists the objects of a given type available from this provider. |
|
java.lang.String[] |
listObjects(java.lang.String objectType, Schema schema, java.lang.String ref) Lists the objects of a given type available from this provider. |
|
protected
|
listObjectsFromCache(DBObjectCriteria<T> criteria) Lists the objects that are in the internal memory cache for this provider. |
|
protected abstract
|
listObjectsImpl(DBObjectCriteria<T> criteria) Internal listObjects implementation. |
|
protected java.util.Collection<SystemObject> |
listObjectsImpl(java.lang.String[] objectTypes, Schema schema, java.lang.String ref) Internal listObjects implementation. |
|
protected java.lang.String[] |
listObjectsImpl(java.lang.String type, Schema schema, java.lang.String ref) Retrieves the list of objects by using a registered builder. |
|
java.lang.String[] |
listObjectTypes() Returns a sorted array of the object types supported in this provider. |
|
Schema[] |
listSchemas() Retrieves the list of schemas available from this provider regardless of their visibility to the user. |
|
Schema[] |
listSchemas(boolean showAll) Retrieves the list of schemas available from this provider. |
|
DataType[] |
listSupportedDataTypes() Retrieves the list of datatypes supported by this provider. |
|
protected void |
logEvent(java.lang.String msg, java.lang.Object... params) Use to log provider events. |
|
protected void |
markForLazyInit(AbstractBuildableObject object) |
|
protected void |
markForLazyInit(AbstractBuildableObject object, DBObjectBuilder builder) |
|
protected java.lang.String |
normaliseType(java.lang.String type) |
|
protected java.lang.Object |
putCachedTimestampKey(java.lang.Object obj, java.lang.Object value) Checks that timestamps are suspended, and if they are caches the given key and value in the timestamp cache. |
|
java.lang.String |
quoteIdentifier(java.lang.String internalName, boolean force) Determines if internalName needs quoting to make it a valid external name, and if so returns a quoted copy of it. |
|
protected void |
registerBuilder(java.lang.String type, DBObjectBuilder builder) Registers a Builder for a specific object type. |
|
protected abstract void |
registerExpanders() |
|
protected void |
registerSchemaObjectExpander(SchemaObjectExpander expander) |
|
protected void |
registerType(java.lang.String type, DBObjectBuilder builder, DBObjectValidator validator) Registers a Builder and Validator for a specific object type. |
|
protected void |
registerValidator(java.lang.String type, DBObjectValidator validator) Registers a Validator for a specific object type. |
|
void |
removeObjectListener(DBObjectListener list) Removes the given object listener that had been added using DBObjectProvider.addObjectListener(DBObjectListener,SystemObject) or DBObjectProvider.addObjectListener(DBObjectListener,DBObjectCriteria) . |
|
void |
removeProviderListener(DBObjectProviderListener list) Removes the given listener from the list of registered listener for events on this provider. |
|
void |
removeProviderListener(DBObjectProviderListener list) Deprecated. use removeProviderListener(DBObjectProviderListener) |
|
protected void |
resetObject(SystemObject object, SystemObject listed, java.lang.Long timestamp) If it has been noticed that the timestamp has changed on an object, or we have updated it in the database, we want to turn it back into an object that needs building again. |
|
protected void |
resetObject(SystemObject object, SystemObject listed, java.lang.Long timestamp, boolean updated) If it has been noticed that the timestamp has changed on an object, or we have updated it in the database, we want to turn it back into an object that needs building again. |
|
void |
resumeTimestampQueries(java.lang.String key) Resumes the calls to get the external timestamp for a given object. |
|
void |
setDefaultTemplateForType(java.lang.String type, DBObject template) Sets the default template object for the given type. |
|
boolean |
supportsObjectType(java.lang.String type) Convinience method to check whether this provider supports the given object type - i.e. |
|
boolean |
supportsTimestamps() Deprecated. replaced by supportsTimestamps(String) |
|
boolean |
supportsTimestamps(java.lang.String objectType) Returns true if this provider supports object timestamping for the given object type. |
|
void |
suspendTimestampQueries(java.lang.String key) Limits the call to get the external timestamp for a given object to once until resumeTimestampQueries() is called. |
|
protected void |
uncacheObject(SystemObject object) Removes an object from the cache. |
|
void |
updateObject(SystemObject oldObject, SystemObject newObject) Updates the definition of an object. |
|
void |
updateObjects(SystemObject[] oldObjects, SystemObject[] newObjects) Updates the definition of a set of objects. |
|
void |
updateSchema(Schema oldSchema, Schema newSchema) Updates the definition of a Schema. |
|
void |
validateName(java.lang.String name) Deprecated. - use validateName( String type, String name ) |
|
void |
validateName(java.lang.String type, java.lang.String name) Checks to see whether a name is valid. |
|
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 |
validateObject(DBObject original, DBObject update, java.lang.String property) Deprecated. |
|
void |
validateObject(DBObject object, java.lang.String property) Deprecated. |
|
void |
validateObjectProperty(DBObject original, DBObject updated, java.lang.Object property) Deprecated. |
|
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.Object property) Deprecated. |
|
void |
validateObjectProperty(DBObject object, java.lang.String property) Checks to see if the children of a given object are valid. |
|
void |
validateSchema(Schema schema) Deprecated. - use validateObject( DBObject object ) |
|
void |
validateSchema(Schema original, Schema update) Deprecated. use validateObject( DBObject original, DBObject update ) |
|
void |
validateUniqueName(java.lang.String type, DBObject contextObject, java.lang.String name) Validates that a name is not used within the context DBObject, and throws NameInUseException if it is. |
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, createObjects, deleteObjects, getDefaultSchema, getDescriptor, getName, getProviderIdentifier, getProviderType, undeleteObject, undeleteObjects, updateObjects |
Field Detail |
---|
public static final int MIXED_CASE_NAME_POLICY
public static final int LOWER_CASE_NAME_POLICY
public static final int UPPER_CASE_NAME_POLICY
public static final int CASE_SENSITIVE_NAME_POLICY
public static final java.lang.String TIMESTAMP_PROPERTY
public static final java.lang.String NEW_FROM_TEMPLATE_TYPE
protected static final java.lang.String[] EMPTY_LIST
Constructor Detail |
---|
protected AbstractDBObjectProvider()
protected AbstractDBObjectProvider(boolean weakCaching)
Method Detail |
---|
public final void removeProviderListener(DBObjectProviderListener list)
DBObjectProvider
removeProviderListener
in interface DBObjectProvider
DBObjectProviderListener
@Deprecated
public final void removeProviderListener(DBObjectProviderListener list)
removeProviderListener(DBObjectProviderListener)
removeProviderListener
in interface DBObjectProvider
public final void addProviderListener(DBObjectProviderListener list)
DBObjectProvider
addProviderListener
in interface DBObjectProvider
DBObjectProviderListener
@Deprecated
public final void addProviderListener(DBObjectProviderListener list)
addProviderListener(DBObjectProviderListener)
addProviderListener
in interface DBObjectProvider
public final void addObjectListener(DBObjectListener list, DBObjectCriteria crit)
DBObjectProvider
addObjectListener
in interface DBObjectProvider
list
- the listener to registercrit
- a criteria object to use to match objects that update messages are published forpublic final void addObjectListener(DBObjectListener list, SystemObject obj)
DBObjectProvider
SystemObject.addObjectListener(DBObjectListener)
because that listens to a specific object instance. Registering the listener with the provider through this method ensures that events will be received for the lifetime of the provider (as the particular object instance could be lost - e.g. gc'd).addObjectListener
in interface DBObjectProvider
list
- the listener to registerobj
- the object to receive update events forDBObjectProvider.addObjectListener(DBObjectListener,DBObjectCriteria)
public final void removeObjectListener(DBObjectListener list)
DBObjectProvider
DBObjectProvider.addObjectListener(DBObjectListener,SystemObject)
or DBObjectProvider.addObjectListener(DBObjectListener,DBObjectCriteria)
.removeObjectListener
in interface DBObjectProvider
list
- the registered listener to removeprotected final void fireProviderClosed()
@Deprecated
public final void fireProviderDeleted()
protected final void fireProviderOpened()
protected final void fireProviderReloaded()
@Deprecated
protected final void fireSchemaAdded(Schema schema)
protected final void fireObjectsAdded(java.util.Collection<? extends SystemObject> sysObjs)
@Deprecated
protected final void fireSchemaUpdated(DBObjectChange change)
@Deprecated
protected final void fireSchemaObjectUpdated(DBObjectChange change)
protected final void fireObjectUpdated(DBObjectChange change)
@Deprecated
protected final void fireSchemaRemoved(Schema schema)
protected final void fireObjectsRemoved(java.util.Collection<? extends SystemObject> sysObjs)
@Deprecated
public final void fireObjectsAdded(Schema schema,
SchemaObject[] objs)
@Deprecated
protected final void fireObjectsRemoved(Schema schema,
SchemaObject[] objs)
protected final void registerType(java.lang.String type, DBObjectBuilder builder, DBObjectValidator validator)
type
- a string containing the object typebuilder
- the Builder instance to use for the specified typevalidator
- the Validator instance to use for the specified typeDBObject.getType()
protected final void registerBuilder(java.lang.String type, DBObjectBuilder builder)
type
- a string containing the object typebuilder
- the Builder instance to use for the specified typeDBObject.getType()
protected DBObjectBuilder getBuilderForType(java.lang.String type)
type
- a string containing the object typenull
if no builder is registeredprotected final void registerValidator(java.lang.String type, DBObjectValidator validator)
type
- a string containing the object typevalidator
- the Validator instance to use for the specified typeDBObject.getType()
protected final DBObjectValidator getValidatorForType(java.lang.String type)
type
- a string containing the object typenull
if no validator is registeredprotected SystemObject findObject(java.lang.String type, Schema schema, java.lang.String name)
type
- a string containing the type of objectschema
- the schema owning the objectname
- a string containing the name of the objectSchemaObject
representing the specified object, or null>/code> if the object does not exist in the cache
findObject
protected final SystemObject findObject(DBObjectID id)
Looks for the specified object id in the cache.
Parameters:
id
- the id of the object
SystemObject
representing the specified object, or null
if the object does not exist in the cacheprotected void destroyCache()
protected final void clearAllCaches()
public SchemaObjectManager getCascadeManager()
getCascadeManager
in interface DBObjectProvider
@Deprecated
public final SchemaObjectManager getObjectManager()
getObjectManager
in interface DBObjectProvider
protected SchemaObjectManager createObjectManager()
protected void cacheObject(SystemObject object, boolean loadOperation)
object
- the SchemaObject needing to be cachedloadOperation
- this is a load of the object, not a create or update.protected final void uncacheObject(SystemObject object)
object
- the SchemaObject needing to be removed from the cacheprotected java.lang.String[] listObjectsImpl(java.lang.String type, Schema schema, java.lang.String ref) throws DBException
type
- a string containg the type of object to listschema
- the schemaref
- a string containing a pattern to match object names againstDBException
protected java.util.Collection<SystemObject> listObjectsImpl(java.lang.String[] objectTypes, Schema schema, java.lang.String ref) throws DBException
listObjectsImpl(DBObjectCriteria)
and shouldn't be overridden.DBException
protected abstract <T extends SystemObject> java.util.Collection<T> listObjectsImpl(DBObjectCriteria<T> criteria) throws DBException
DBException
protected final <T extends SystemObject> java.util.Collection<T> listObjectsFromCache(DBObjectCriteria<T> criteria)
protected <T extends SystemObject> T getObjectImpl(DBObjectCriteria<T> criteria) throws DBException
DBException
protected final java.lang.Long getExistingTimestamp(SystemObject object)
protected <T extends SystemObject> T checkCachedObject(T object) throws DBException
object
- the cached object to checkschema
-DBException
public Schema[] listSchemas() throws DBException
DBObjectProvider
listSchemas
in interface DBObjectProvider
DBException
DBObjectProvider.listSchemas(boolean)
public Schema[] listSchemas(boolean showAll) throws DBException
DBObjectProvider
listSchemas
in interface DBObjectProvider
showAll
- if false, only schemas containing objects belonging to (or visible to) the user are returnedDBException
- if an error is encountered listing the schemas.public Schema getSchema(java.lang.String name) throws DBException
DBObjectProvider
getSchema
in interface DBObjectProvider
name
- a string containing the name of the schemaDBException
- if an error is encountered getting the schemaprotected Schema findSchema(java.lang.String name) throws DBException
DBException
public final void resumeTimestampQueries(java.lang.String key)
public final void suspendTimestampQueries(java.lang.String key)
protected final java.lang.Object getCachedTimestamp(java.lang.Object obj)
the
- key in the timestamp cache to lookupprotected final java.lang.Object putCachedTimestampKey(java.lang.Object obj, java.lang.Object value)
obj
- the key for the timstamp cachevalue
- the value to put against the given keypublic boolean supportsTimestamps(java.lang.String objectType)
getProperties()
) under the TIMESTAMP_PROPERTY
key.
Returns false by default.
@Deprecated
public boolean supportsTimestamps()
supportsTimestamps(String)
public final java.lang.Long getTimestamp(java.lang.String type, Schema schema, java.lang.String objectName) throws DBException
DBObjectProvider
null
value should be returned.getTimestamp
in interface DBObjectProvider
type
- a String containing the type of the objectschema
- the Schema containing the objectobjectName
- a String containing the name of the objectDBException
- if an error is encountered getting the timestamppublic final java.lang.Long getTimestamp(DBObjectID id) throws DBException
DBObjectProvider
getTimestamp
in interface DBObjectProvider
id
- the ID for the objectDBException
- if an error is encountered getting the timestampDBObjectProvider.getTimestamp(String,Schema,String)
protected DBObject findByID(DBObjectID id) throws DBException
DBException
protected void resetObject(SystemObject object, SystemObject listed, java.lang.Long timestamp)
object
- the object we want to have cached and resetlisted
- an object returned by a list/find which is potentially in the cache, and potentially has a different id.timestamp
- the timestamp for the new object (can be null)protected void resetObject(SystemObject object, SystemObject listed, java.lang.Long timestamp, boolean updated)
object
- the object we want to have cached and resetlisted
- an object returned by a list/find which is potentially in the cache, and potentially has a different id.timestamp
- the timestamp for the new object (can be null)updated
- whether is the reset of an existing object (true)protected SystemObject createObjectImpl(java.lang.String type, Schema schema, java.lang.String name) throws DBException
DBException
protected boolean isRequestedObject(SystemObject object, java.lang.String type, Schema schema, java.lang.String name)
object
- the object to be matchedtype
- the type of the requested objectschema
- the owner of the requested objectname
- the name of the requested objectprotected SystemObject createByIDImpl(DBObjectID id) throws DBException
DBException
protected java.lang.Long getExternalTimestampImpl(SystemObject object) throws DBException
object
-DBException
protected final java.lang.Long getExternalTimestamp(SystemObject object) throws DBException
DBException
protected final void markForLazyInit(AbstractBuildableObject object)
protected final void markForLazyInit(AbstractBuildableObject object, DBObjectBuilder builder)
public static java.lang.String convertObject(DBObject obj)
obj
- the DBObjectnull
, an empty String is returned.public java.lang.String getIdentifierQuoteString()
DBObjectProvider
null
.getIdentifierQuoteString
in interface DBObjectProvider
public java.lang.String[] listObjectTypes()
listObjectTypes
in interface DBObjectProvider
DBObjectProvider.listObjects(oracle.javatools.db.DBObjectCriteria<T>)
public boolean supportsObjectType(java.lang.String type)
DBObjectProvider
supportsObjectType
in interface DBObjectProvider
DBObjectProvider.listObjectTypes()
public final java.lang.String[] listObjects(java.lang.String objectType, Schema schema) throws DBException
DBObjectProvider
listObjects
in interface DBObjectProvider
objectType
- the type of objects to listschema
- the schema to list fromDBException
public final java.lang.String[] listObjects(java.lang.String objectType, Schema schema, java.lang.String ref) throws DBException
DBObjectProvider
listObjects
in interface DBObjectProvider
objectType
- the type of objects to listschema
- the schema to list fromref
- a pattern to match against.DBException
public final SchemaObject[] listObjects(java.lang.String[] objectTypes, Schema schema) throws DBException
DBObjectProvider
listObjects
in interface DBObjectProvider
objectTypes
- an array of Strings representing the desired typesschema
- the Schema to list fromDBException
- if an error is encountered listing the objectspublic final SchemaObject[] listObjects(java.lang.String[] objectTypes, Schema schema, java.lang.String ref) throws DBException
DBObjectProvider
listObjects
in interface DBObjectProvider
objectTypes
- an array of Strings representing the desired typesschema
- the Schema to list fromref
- a pattern to match against.DBException
- if an error is encountered listing the objectspublic final <T extends SystemObject> java.util.Collection<T> listObjects(DBObjectCriteria<T> criteria) throws DBException
DBObjectProvider
Examples:
// list Tables beginning with E in a given schema DBObjectProvider pro = ... Schema schema = ... SystemObject obj = pro.listObjects( DBObjectCriteria.createCriteria( Table.TYPE, schema, "E%" ) ); // list all objects that have columns and constraints in schema HR DBObjectCriteria<Relation> c = new DBObjectCriteria<Relation>(Relation.class); c.setSchemaName( "HR" ); Collection<Relation> rels = pro.listObjects( c ); // list all the schemas in this provider Collection<Schema> schemas = pro.listObjects( new DBObjectCriteria<Schema>(Schema.class) );
listObjects
in interface DBObjectProvider
criteria
- the filter to use for listing objects (cannot be null)DBException
- if an error is encountered listing the objectspublic final <T extends SystemObject> T getObject(DBObjectCriteria<T> criteria) throws DBException
DBObjectProvider
Examples:
// find EMP in a given provider and schema DBObjectProvider pro = ... Schema schema = ... SystemObject obj = pro.getObject( DBObjectCriteria.createCriteria( Table.TYPE, schema, "EMP" ) ); // find Table HR.EMPLOYEES DBObjectCriteriac = new DBObjectCriteria(Table.class); c.setNameLike( "EMPLOYEES" ); c.setSchemaName( "HR" ); Table employees = pro.getObject( c );
getObject
in interface DBObjectProvider
DBException
- if an error is encountered retrieving the objectpublic final SchemaObject getObject(java.lang.String objectType, Schema schema, java.lang.String name) throws DBException
DBObjectProvider
getObject
in interface DBObjectProvider
objectType
- the type of object desired.schema
- the name of the schema containing the objectname
- the name of the objectDBException
- if an error is encountered retrieving the objectDBObject.getType()
@Deprecated
public boolean hasPriviledge(java.lang.String type,
Schema schema,
java.lang.String priv)
hasSystemPrivilege(java.lang.String, oracle.javatools.db.Schema, java.lang.String)
hasPriviledge
in interface DBObjectProvider
public boolean hasSystemPrivilege(java.lang.String type, Schema schema, java.lang.String priv)
hasSystemPrivilege
in interface DBObjectProvider
type
- the object type on which the operation is being performed.schema
- the schema to check. A value of null
checks for the current schema.priv
- a pre-defined operation.public boolean hasObjectPrivilege(SystemObject object, java.lang.String priv)
hasObjectPrivilege
in interface DBObjectProvider
object
- the object on which the operation is being performed.priv
- a pre-defined operation.public final void createObject(SystemObject obj, boolean replace) throws DBException
DBObjectProvider
createObject
in interface DBObjectProvider
obj
- the SystemObject 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.public final void deleteObject(SystemObject obj, boolean cascade) throws DBException
DBObjectProvider
deleteObject
in interface DBObjectProvider
obj
- the object to deletecascade
- whether to delete dependent objectsDBException
- if an error is encountered performing the deletepublic final void updateObject(SystemObject oldObject, SystemObject newObject) throws DBException
DBObjectProvider
updateObject
in interface DBObjectProvider
oldObject
- the old version of the objectnewObject
- the new version of the objectDBException
- if the update failspublic final void updateObjects(SystemObject[] oldObjects, SystemObject[] newObjects) throws DBException
DBObjectProvider
updateObjects
in interface DBObjectProvider
DBException
- if the update failspublic void createSchema(Schema schema, boolean replace) throws DBException
DBObjectProvider
createSchema
in interface DBObjectProvider
schema
- the schema being createdreplace
- whether to replace an existing schemaDBException
- if an error is encountered creating the schemapublic void deleteSchema(Schema schema, boolean cascade) throws DBException
DBObjectProvider
deleteSchema
in interface DBObjectProvider
schema
- the schema to deletecascade
- whether to delete dependent objects (i.e. all SchemaObjects contained in the Schema).DBException
- if an error is encountered performing the deletepublic void updateSchema(Schema oldSchema, Schema newSchema) throws DBException
DBObjectProvider
updateSchema
in interface DBObjectProvider
oldSchema
- the old version of the schemanewSchema
- the new version of the schemaDBException
- if the update failspublic PropertyManager getPropertyManager()
DBObjectProvider
getPropertyManager
in interface DBObjectProvider
public final DDLGenerator getDDLGenerator()
getDDLGenerator
in interface DBObjectProvider
protected final int getCasePolicy()
LOWER_CASE_NAME_POLICY
, MIXED_CASE_NAME_POLICY
, UPPER_CASE_NAME_POLICY
, CASE_SENSITIVE_NAME_POLICY
protected final int getQuotedNameCasePolicy()
LOWER_CASE_NAME_POLICY
, MIXED_CASE_NAME_POLICY
, UPPER_CASE_NAME_POLICY
, CASE_SENSITIVE_NAME_POLICY
@Deprecated
public final boolean isValidName(java.lang.String name)
isValidName
in interface DBObjectProvider
name
- the name to checkDBObjectProvider.isValidName(java.lang.String, java.lang.String)
public final boolean isValidName(java.lang.String type, java.lang.String name)
isValidName
in interface DBObjectProvider
name
- the name to checktype
- the type of object the name is intended for
@Deprecated
public final void validateName(java.lang.String name)
throws InvalidNameException
validateName
in interface DBObjectProvider
name
- the name to checkInvalidNameException
- with appropriate message if the name is invalid.DBObjectProvider.validateName(java.lang.String, java.lang.String)
public final void validateName(java.lang.String type, java.lang.String name) throws InvalidNameException
validateName
in interface DBObjectProvider
type
- the type of object the name is itended forname
- the name to checkInvalidNameException
- with appropriate message if the name is invalid.public final java.lang.String quoteIdentifier(java.lang.String internalName, boolean force) throws DBException
quoteIdentifier
in interface DBObjectProvider
internalName
-force
- Always quote the nameDBException
public final java.lang.String getInternalName(java.lang.String name, java.lang.String objectType)
DBObjectProvider
getInternalName
in interface DBObjectProvider
name
- a String containing the name to convertobjectType
- a String containing the type of object being namedpublic final java.lang.String getInternalName(java.lang.String name)
DBObjectProvider
getInternalName
in interface DBObjectProvider
name
- a String containing the name to convertpublic final java.lang.String getExternalName(java.lang.String name, java.lang.String objectType)
DBObjectProvider
quoteIdentifier
, specifying false
for the force argument. Note, however, that exceptions are not thrown; rather, the original name will be returned.getExternalName
in interface DBObjectProvider
name
- a String containing the name to externalizeobjectType
- a String containing the type of object being namedpublic final java.lang.String getExternalName(java.lang.String name)
DBObjectProvider
quoteIdentifier
, specifying false
for the force argument. Note, however, that exceptions are not thrown; rather, the original name will be returned.getExternalName
in interface DBObjectProvider
name
- a String containing the name to externalizepublic DataType[] listSupportedDataTypes()
DBObjectProvider
listSupportedDataTypes
in interface DBObjectProvider
DataType
objects representing the supported datatypes.public DataType getDataType(java.lang.String typeName)
DBObjectProvider
getDataType
in interface DBObjectProvider
typeName
- a String containing the name of the datatype.public DataType getOrCreateDataType(java.lang.String typeName)
DBObjectProvider
getOrCreateDataType
in interface DBObjectProvider
typeName
- a String containing the name of the datatype.UserDataType
and registers this with the provider.public void validateObject(DBObject object) throws ValidationException
validateObject
in interface DBObjectProvider
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.
@Deprecated
public final void validateObject(DBObject object,
java.lang.String property)
throws ValidationException
validateObject
in interface DBObjectProvider
ValidationException
@Deprecated
public final void validateObjectProperty(DBObject object,
java.lang.Object property)
throws ValidationException
validateObjectProperty
in interface DBObjectProvider
ValidationException
public void validateObjectProperty(DBObject object, java.lang.String property) throws ValidationException
DBObjectProvider
DBObjectProvider.validateObject(DBObject)
is called.validateObjectProperty
in interface DBObjectProvider
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.
@Deprecated
public void validateSchema(Schema schema)
throws ValidationException
DBObjectProvider
validateSchema
in interface DBObjectProvider
schema
- The Schema to validateValidationException
- if the Schema is not valid. The exception will describe the validation failure.public void validateObject(DBObject original, DBObject update) throws ValidationException
validateObject
in interface DBObjectProvider
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.
@Deprecated
public final void validateObject(DBObject original,
DBObject update,
java.lang.String property)
throws ValidationException
validateObject
in interface DBObjectProvider
ValidationException
@Deprecated
public final void validateObjectProperty(DBObject original,
DBObject updated,
java.lang.Object property)
throws ValidationException
validateObjectProperty
in interface DBObjectProvider
ValidationException
public void validateObjectProperty(DBObject original, DBObject update, java.lang.String property) throws ValidationException
DBObjectProvider
DBObjectProvider.validateObject(DBObject,DBObject)
is called.validateObjectProperty
in interface DBObjectProvider
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.
@Deprecated
public void validateSchema(Schema original,
Schema update)
throws ValidationException
DBObjectProvider
validateSchema
in interface DBObjectProvider
ValidationException
- if the updated schema is not valid. The exception will describe the validation failure.public void validateUniqueName(java.lang.String type, DBObject contextObject, java.lang.String name) throws NameInUseException
validateUniqueName
in interface DBObjectProvider
type
- : the type of name being validatedcontextObject
- : the database object context to use when determining the uniqueness of the namename
- : the name to be checkedNameInUseException
public java.lang.String getUniqueName(java.lang.String type, DBObject contextObject, java.lang.String base)
contextObject
using base
name. This default implementation ensures that you cannot have two SchemaObjects of any type with the same name, two indexes with the same name or two constraints with the same name, within contextObject.getUniqueName
in interface DBObjectProvider
type
- is the type of object to get the name forcontextObject
- is the database object context to use when determining the uniqueness of the namebase
- is the base name to use. If base is null or zero length, the type name suffixed with 1 is used.protected java.lang.String normaliseType(java.lang.String type)
public DiffEngine getDiffEngine()
DBObjectProvider
Providers which do not support object updating should return null.
getDiffEngine
in interface DBObjectProvider
protected java.util.logging.Logger getLogger()
protected void logEvent(java.lang.String msg, java.lang.Object... params)
public boolean isEditable(DBObject object)
DBObjectProvider
isEditable
in interface DBObjectProvider
public DBObject getDefaultTemplateForType(java.lang.String type)
getDefaultTemplateForType
in interface DBObjectProvider
public void setDefaultTemplateForType(java.lang.String type, DBObject template)
setDefaultTemplateForType
in interface DBObjectProvider
public boolean isNewFromTemplateType(java.lang.String type)
DBObjectProvider
isNewFromTemplateType
in interface DBObjectProvider
type
- the type to testprotected abstract void registerExpanders()
protected void registerSchemaObjectExpander(SchemaObjectExpander expander)
public SchemaObjectExpander[] getSchemaObjectExpanders()
public DBObjectFactory getObjectFactory()
DBObjectProvider
getObjectFactory
in interface DBObjectProvider
|
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 |