|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.1.0) E17493-02 |
|||||||||
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 |
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) |
|
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. |
|
DDLGenerator |
getDDLGenerator()
Gets the DDLGenerator for this DBObjectProvider. |
|
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. |
|
java.lang.String |
getName()
The name of a provider is a displayable string that can be shown to the user to identify the 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. |
|
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. |
|
java.lang.Object |
getProviderIdentifier()
Gets the String that identifies this DBObjectProvider uniquely (within providers of the same type). |
|
java.lang.String |
getProviderType()
Gets the String that identifies the type of DBObjectProvider this is an instance of. |
|
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 |
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. |
|
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 |
removeObjectListener(DBObjectListener list)
Removes the given object listener that had been added using addObjectListener(DBObjectListener,SystemObject) or
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) |
|
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
hasSystemPrivilege(java.lang.String, oracle.javatools.db.Schema, java.lang.String)
,
Constant Field Valuesstatic final java.lang.String DELETE_PRIVILEDGE
hasSystemPrivilege(java.lang.String, oracle.javatools.db.Schema, java.lang.String)
,
Constant Field Valuesstatic final java.lang.String MODIFY_PRIVILEDGE
hasSystemPrivilege(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 |
---|
java.lang.String getProviderType()
getProviderIdentifier()
,
DBObjectProviderFactory.findOrCreateProvider(String,Object)
java.lang.Object getProviderIdentifier()
getName()
for a displayable String).
getProviderType()
,
DBObjectProviderFactory.findOrCreateProvider(String,Object)
,
getName()
java.lang.String getName()
getProviderIdentifier()
.
getProviderIdentifier()
void addProviderListener(DBObjectProviderListener list)
DBObjectProviderListener
@Deprecated void addProviderListener(DBObjectProviderListener list)
addProviderListener(DBObjectProviderListener)
void removeProviderListener(DBObjectProviderListener list)
DBObjectProviderListener
@Deprecated void removeProviderListener(DBObjectProviderListener list)
removeProviderListener(DBObjectProviderListener)
void addObjectListener(DBObjectListener list, DBObjectCriteria crit)
list
- the listener to registercrit
- a criteria object to use to match objects that update messages
are published forvoid addObjectListener(DBObjectListener list, SystemObject obj)
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).
list
- the listener to registerobj
- the object to receive update events foraddObjectListener(DBObjectListener,DBObjectCriteria)
void removeObjectListener(DBObjectListener list)
addObjectListener(DBObjectListener,SystemObject)
or
addObjectListener(DBObjectListener,DBObjectCriteria)
.
list
- the registered listener to removeboolean 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)
hasSystemPrivilege(java.lang.String, oracle.javatools.db.Schema, java.lang.String)
boolean hasSystemPrivilege(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.
boolean hasObjectPrivilege(SystemObject object, java.lang.String priv)
object
- the object on which the operation is being performed.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 11g Release 2 (11.1.2.1.0) E17493-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |