|
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 |
public interface DBObjectProvider
The DBObjectProvider
interface provides clients with access to database objects. Depending on the implementation, these objects may be defined in an existing database or locally.
The services provided by DBObjectProvider
include:
A DBObjectProvider
can be retrieved through the DBObjectProviderFactory
if the identifier is known for that provider. For more information see @link{DBObjectProviderFactory}.
The api provides a listener mechanism for a DBObjectProvider
so that if objects are added, removed or updated through the DBObjectProvider
a registered DBObjectProviderListener
will be notified of those events.
oracle.javatools.db
, DBObjectProviderFactory
, Database
, DBObjectProviderListener
Field Summary | |
---|---|
static java.lang.String |
CREATE_PRIVILEDGE Permission to create an object. |
static java.lang.String |
DELETE_PRIVILEDGE Permission to delete an object. |
static java.lang.String |
MODIFY_PRIVILEDGE Permission to modify an object. |
static java.lang.String |
NEW_FROM_TEMPLATE_TYPE Deprecated. |
Method Summary | ||
---|---|---|
void |
addProviderListener(DBObjectProviderListener list) Adds the given listener to the list of registered listener for events on this provider. |
|
boolean |
canCreate(SystemObject object, boolean replace) Whether an attempt to create the specified object is likely to succeed. |
|
boolean |
canDelete(SystemObject object, boolean cascade) Checks to see whether a specific object can be deleted. |
|
void |
createObject(SystemObject object, boolean replace) Causes the creation of the object described by the specified meta data. |
|
void |
createObjects(SystemObject[] objects, boolean replace) Causes the creation of the objects described by the specified meta data. |
|
void |
createSchema(Schema schema, boolean replace) Causes the creation of a new Schema in the persistent storage. |
|
void |
deleteObject(SystemObject object, boolean cascade) Deletes the object. |
|
void |
deleteObjects(SystemObject[] objects, boolean cascade) Deletes the objects. |
|
void |
deleteSchema(Schema schema, boolean cascade) Deletes the schema. |
|
CascadeManager |
getCascadeManager() Gets the object for this provider that manages references between objects and how to cascade deletes between them. |
|
DataType |
getDataType(java.lang.String typeName) Retrieves the datatype represented by a specific name. |
|
Schema |
getDefaultSchema() Returns the default schema for the provider. |
|
DBObject |
getDefaultTemplateForType(java.lang.String type) Returns the default template object for the given type, or null if none defined |
|
DatabaseDescriptor |
getDescriptor() Returns the DatabaseDescriptor for this provider |
|
DiffEngine |
getDiffEngine() Returns a diff engine setup with the appropriate set of differs for object updating. |
|
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. |
|
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. |
|
|
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. |
|
SchemaObjectManager |
getObjectManager() Deprecated. use getCascadeManager() |
|
DataType |
getOrCreateDataType(java.lang.String typeName) Retrieves the datatype represented by a specific name. |
|
PropertyManager |
getPropertyManager() Gets the PropertyManager (if available) for this provider. |
|
Schema |
getSchema(java.lang.String name) Retrieves the Schema object associated with a specific name. |
|
java.lang.Long |
getTimestamp(DBObjectID id) Retrieves the timestamp for the object represented by the given ID. |
|
java.lang.Long |
getTimestamp(java.lang.String objectType, Schema schema, java.lang.String name) 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) Retrieves a unique name for an object of a specific type. |
|
boolean |
hasPriviledge(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. |
|
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> filter) 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. |
|
java.lang.String[] |
listObjectTypes() Lists the database object types supported by this DBObjectProvider. |
|
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. |
|
java.lang.String |
quoteIdentifier(java.lang.String name, boolean force) Quotes the specified identifier name, if needed. |
|
void |
removeProviderListener(DBObjectProviderListener list) Removes the given listener from the list of registered listener for events on this provider. |
|
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. |
|
void |
undeleteObject(SchemaObject object) Undeletes the object, i.e. |
|
void |
undeleteObjects(SchemaObject[] objects) Undeletes the objects, i.e. |
|
void |
updateObject(SystemObject oldObject, SystemObject newObject) Updates the definition of an object. |
|
void |
updateObjects(Difference rs, boolean replace, boolean cascade) Updates the definition of a set of objects. |
|
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 for a given type of object. |
|
void |
validateObject(DBObject object) Checks to see if the object is valid. |
|
void |
validateObject(DBObject original, DBObject updated) Checks to see if the object update is valid. |
|
void |
validateObject(DBObject original, DBObject updated, java.lang.String property) Deprecated. use validateObjectProperty(DBObject,DBObject,Object) |
|
void |
validateObject(DBObject object, java.lang.String property) Deprecated. use validateObjectProperty(DBObject,Object) |
|
void |
validateObjectProperty(DBObject original, DBObject updated, java.lang.Object property) Deprecated. use validateObjectProperty(DBObject,DBObject,String) |
|
void |
validateObjectProperty(DBObject original, DBObject updated, 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. use validateObjectProperty(DBObject,String) |
|
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 updated) Deprecated. use validateObject(DBObject original, DBObject updated) |
|
void |
validateUniqueName(java.lang.String type, DBObject contextObject, java.lang.String name) Validates that a name is not used within a context DBObject, and throws NameInUseException if it is. |
Field Detail |
---|
static final java.lang.String CREATE_PRIVILEDGE
hasPriviledge(java.lang.String, oracle.javatools.db.Schema, java.lang.String)
, Constant Field Valuesstatic final java.lang.String DELETE_PRIVILEDGE
hasPriviledge(java.lang.String, oracle.javatools.db.Schema, java.lang.String)
, Constant Field Valuesstatic final java.lang.String MODIFY_PRIVILEDGE
hasPriviledge(java.lang.String, oracle.javatools.db.Schema, java.lang.String)
, Constant Field Values
@Deprecated
static final java.lang.String NEW_FROM_TEMPLATE_TYPE
Method Detail |
---|
void addProviderListener(DBObjectProviderListener list)
DBObjectProviderListener
void removeProviderListener(DBObjectProviderListener list)
DBObjectProviderListener
boolean canCreate(SystemObject object, boolean replace)
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.void createObject(SystemObject object, boolean replace) throws DBException
object
- 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.void createObjects(SystemObject[] objects, boolean replace) throws DBException
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.boolean canDelete(SystemObject object, boolean cascade)
object
- the object to checkcascade
- whether to assume a cascading delete should be used.void deleteObject(SystemObject object, boolean cascade) throws DBException
object
- the object to deletecascade
- whether to delete dependent objectsDBException
- if an error is encountered performing the deletevoid deleteObjects(SystemObject[] objects, boolean cascade) throws DBException
objects
- the objects to deletecascade
- whether to delete dependent objectsDBException
- if an error is encountered performing the deletevoid undeleteObject(SchemaObject object) throws DBException
object
- the object to be undeletedDBException
- if an error is encountered performing the undeletevoid undeleteObjects(SchemaObject[] objects) throws DBException
objects
- the objects to be undeletedDBException
- if an error is encountered performing the undeleteboolean hasPriviledge(java.lang.String type, Schema schema, java.lang.String priv)
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.java.lang.String getUniqueName(java.lang.String type, DBObject contextObject, java.lang.String base)
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.void validateUniqueName(java.lang.String type, DBObject contextObject, java.lang.String name) throws NameInUseException
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
@Deprecated
boolean isValidName(java.lang.String name)
isValidName( String type, String name )
name
- the name to checkisValidName(java.lang.String, java.lang.String)
boolean isValidName(java.lang.String type, java.lang.String name)
name
- the name to checktype
- the type of object the name is intended for
@Deprecated
void validateName(java.lang.String name)
throws InvalidNameException
validateName( String type, String name )
name
- the name to checkInvalidNameException
- with appropriate message if the name is invalid.validateName(java.lang.String, java.lang.String)
void validateName(java.lang.String type, java.lang.String name) throws InvalidNameException
name
- the name to checktype
- the type of object that the name is intended for (e.g. Table.TYPE
)InvalidNameException
- with appropriate message if the name is invalid.java.lang.String quoteIdentifier(java.lang.String name, boolean force) throws DBException
name
- the name to quoteforce
- whether to quote even if the identifier is valid already.DBException
- if the name when quoted is still invalidjava.lang.String getInternalName(java.lang.String name)
name
- a String containing the name to convertjava.lang.String getInternalName(java.lang.String name, java.lang.String objectType)
name
- a String containing the name to convertobjectType
- a String containing the type of object being namedjava.lang.String getExternalName(java.lang.String name)
quoteIdentifier
, specifying false
for the force argument. Note, however, that exceptions are not thrown; rather, the original name will be returned.name
- a String containing the name to externalizejava.lang.String getExternalName(java.lang.String name, java.lang.String objectType)
quoteIdentifier
, specifying false
for the force argument. Note, however, that exceptions are not thrown; rather, the original name will be returned.name
- a String containing the name to externalizeobjectType
- a String containing the type of object being namedjava.lang.String getIdentifierQuoteString()
null
.DatabaseDescriptor getDescriptor()
void validateObject(DBObject object) throws ValidationException
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
void validateObject(DBObject object,
java.lang.String property)
throws ValidationException
ValidationException
void validateObjectProperty(DBObject object, java.lang.String property) throws ValidationException
validateObject(DBObject)
is called.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
void validateObjectProperty(DBObject object,
java.lang.Object property)
throws ValidationException
validateObjectProperty(DBObject,String)
ValidationException
void validateObject(DBObject original, DBObject updated) throws ValidationException
object
- The original objectobject
- The updated object to validateValidationException
- 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
void validateObject(DBObject original,
DBObject updated,
java.lang.String property)
throws ValidationException
ValidationException
void validateObjectProperty(DBObject original, DBObject updated, java.lang.String property) throws ValidationException
validateObject(DBObject,DBObject)
is called.original
- The original version of the edited objectupdated
- 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
void validateObjectProperty(DBObject original,
DBObject updated,
java.lang.Object property)
throws ValidationException
validateObjectProperty(DBObject,DBObject,String)
ValidationException
@Deprecated
void validateSchema(Schema schema)
throws ValidationException
schema
- The Schema to validateValidationException
- if the Schema is not valid. The exception will describe the validation failure.
@Deprecated
void validateSchema(Schema original,
Schema updated)
throws ValidationException
object
- The original schemaobject
- The updated schema to validateValidationException
- if the updated schema is not valid. The exception will describe the validation failure.<T extends SystemObject> T getObject(DBObjectCriteria<T> criteria) throws DBException
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 );
the
- criteria to match the object requiredDBException
- if an error is encountered retrieving the objectSchemaObject getObject(java.lang.String objectType, Schema schema, java.lang.String name) throws DBException
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
SchemaObjectManager getObjectManager()
getCascadeManager()
CascadeManager getCascadeManager()
DBObjectFactory getObjectFactory()
void updateObjects(Difference rs, boolean replace, boolean cascade) throws DBException
Difference
which must have been created using the DiffEngine
returned by getDiffEngine()
The 'change' maybe to create, alter, or delete objects.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
void updateObject(SystemObject oldObject, SystemObject newObject) throws DBException
oldObject
- the old version of the objectnewObject
- the new version of the objectDBException
- if the update failsvoid updateObjects(SystemObject[] oldObjects, SystemObject[] newObjects) throws DBException
oldObject
- the old version of the objectsnewObject
- the new version of the objectsDBException
- if the update fails<T extends SystemObject> java.util.Collection<T> listObjects(DBObjectCriteria<T> filter) throws DBException
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) );
filter
- the filter to use for listing objects (cannot be null)DBException
- if an error is encountered listing the objectsjava.lang.String[] listObjects(java.lang.String objectType, Schema schema) throws DBException
objectType
- the type of objects to listschema
- the schema to list fromDBException
java.lang.String[] listObjects(java.lang.String objectType, Schema schema, java.lang.String ref) throws DBException
objectType
- the type of objects to listschema
- the schema to list fromref
- a pattern to match against.DBException
SchemaObject[] listObjects(java.lang.String[] objectTypes, Schema schema) throws DBException
objectTypes
- an array of Strings representing the desired typesschema
- the Schema to list fromDBException
- if an error is encountered listing the objectsSchemaObject[] listObjects(java.lang.String[] objectTypes, Schema schema, java.lang.String ref) throws DBException
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 objectsjava.lang.Long getTimestamp(java.lang.String objectType, Schema schema, java.lang.String name) throws DBException
null
value should be returned.objectType
- a String containing the type of the objectschema
- the Schema containing the objectname
- a String containing the name of the objectDBException
- if an error is encountered getting the timestampjava.lang.Long getTimestamp(DBObjectID id) throws DBException
id
- the ID for the objectDBException
- if an error is encountered getting the timestampgetTimestamp(String,Schema,String)
java.lang.String[] listObjectTypes()
listObjects(oracle.javatools.db.DBObjectCriteria<T>)
boolean supportsObjectType(java.lang.String type)
listObjectTypes()
DataType[] listSupportedDataTypes()
DataType
objects representing the supported datatypes.DataType getDataType(java.lang.String typeName)
typeName
- a String containing the name of the datatype.DataType getOrCreateDataType(java.lang.String typeName)
typeName
- a String containing the name of the datatype.UserDataType
and registers this with the provider.Schema[] listSchemas() throws DBException
DBException
listSchemas(boolean)
Schema[] listSchemas(boolean showAll) throws DBException
showAll
- if false, only schemas containing objects belonging to (or visible to) the user are returnedDBException
- if an error is encountered listing the schemas.Schema getSchema(java.lang.String name) throws DBException
name
- a string containing the name of the schemaDBException
- if an error is encountered getting the schemaSchema getDefaultSchema() throws DBException
DBException
void createSchema(Schema schema, boolean replace) throws DBException
schema
- the schema being createdreplace
- whether to replace an existing schemaDBException
- if an error is encountered creating the schemavoid updateSchema(Schema oldSchema, Schema newSchema) throws DBException
oldSchema
- the old version of the schemanewSchema
- the new version of the schemaDBException
- if the update failsvoid deleteSchema(Schema schema, boolean cascade) throws DBException
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 deleteDiffEngine getDiffEngine()
Providers which do not support object updating should return null.
PropertyManager getPropertyManager()
boolean isEditable(DBObject object)
DBObject getDefaultTemplateForType(java.lang.String type)
void setDefaultTemplateForType(java.lang.String type, DBObject template)
boolean isNewFromTemplateType(java.lang.String type)
type
- the type to test
|
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 |