|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1) E13403-04 |
|||||||||
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 objects
DBException
- if an error is encountered performing the deletevoid deleteObjects(SystemObject[] objects, boolean cascade) throws DBException
objects
- the objects to deletecascade
- whether to delete dependent objects
DBException
- if an error is encountered performing the deletevoid undeleteObject(SchemaObject object) throws DBException
object
- the object to be undeleted
DBException
- if an error is encountered performing the undeletevoid undeleteObjects(SchemaObject[] objects) throws DBException
objects
- the objects to be undeleted
DBException
- 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 checked
NameInUseException
@Deprecated boolean isValidName(java.lang.String name)
isValidName( String type, String name )
name
- the name to check
isValidName(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 check
InvalidNameException
- 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 convert
java.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 named
java.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 externalize
java.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 named
java.lang.String getIdentifierQuoteString()
null
.
DatabaseDescriptor getDescriptor()
void validateObject(DBObject object) throws ValidationException
object
- The object to validate
ValidationException
- if the object is not valid. The exception will
describe the validation failure. A MissingValidatorException is thrown if
the provider has no validator for the given object type.@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 validate
ValidationException
- if the object is not valid. The exception will
describe the validation failure. A MissingValidatorException is thrown if
the provider has no validator for the given object type, or property.@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 validate
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 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 validate
ValidationException
- if the object is not valid. The exception will
describe the validation failure. A MissingValidatorException
is
thrown if the provider has no validator for the given object type, or
property.@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 validate
ValidationException
- 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 validate
ValidationException
- 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 DBObjectCriteria
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1) E13403-04 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |