|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.1.0) E13403-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
|
Method Summary | |
---|---|
void |
addProviderListener(DBObjectProviderListener list)
Adds the given listener to the list of registered listener for events on this provider. |
boolean |
canCreate(Schema schema,
boolean replace)
Whether an attempt to create the specified schema is likely to succeed. |
boolean |
canCreate(SchemaObject object,
boolean replace)
Whether an attempt to create the specified object is likely to succeed. |
boolean |
canDelete(Schema schema,
boolean cascade)
Checks to see whether a specific schema can be deleted. |
boolean |
canDelete(SchemaObject object,
boolean cascade)
Checks to see whether a specific object can be deleted. |
void |
createObject(SchemaObject object,
boolean replace)
Causes the creation of the object described by the specified meta data. |
void |
createObjects(SchemaObject[] 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(SchemaObject object,
boolean cascade)
Deletes the object. |
void |
deleteObjects(SchemaObject[] objects,
boolean cascade)
Deletes the objects. |
void |
deleteSchema(Schema schema,
boolean cascade)
Deletes the schema. |
DataType |
getDataType(java.lang.String typeName)
Retrieves the datatype represented by a specific name. |
Schema |
getDefaultSchema()
Returns the default schema for the provider. |
SchemaObject |
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. |
SchemaObject |
getObject(java.lang.String objectType,
Schema schema,
java.lang.String name)
Retrieves the SchemaObject representing a specific database object. |
SchemaObjectManager |
getObjectManager()
DO NOT USE this method until Mark has reviewed its inclusion in the API. |
DataType |
getOrCreateDataType(java.lang.String typeName)
Retrieves the datatype represented by a specific name. |
Schema |
getSchema(java.lang.String name)
Retrieves the Schema object associated with a specific name. |
java.lang.Long |
getTimestamp(DBObjectID 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)
|
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. |
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,
SchemaObject 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(SchemaObject oldObject,
SchemaObject newObject)
Updates the definition of an object. |
void |
updateObjects(ResultSet rs,
boolean replace,
boolean cascade)
Updates the definition of a set of objects. |
void |
updateObjects(SchemaObject[] oldObjects,
SchemaObject[] 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)
Checks to see if the updated children of a given object are valid. |
void |
validateObjectProperty(DBObject object,
java.lang.Object 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 Valuesstatic final java.lang.String NEW_FROM_TEMPLATE_TYPE
Method Detail |
---|
void addProviderListener(DBObjectProviderListener list)
DBObjectProviderListener
void removeProviderListener(DBObjectProviderListener list)
DBObjectProviderListener
boolean canCreate(SchemaObject object, boolean replace)
object
- the SchemaObject 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(SchemaObject object, boolean replace) throws DBException
object
- the SchemaObject 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(SchemaObject[] objects, boolean replace) throws DBException
objects
- the SchemaObject[] 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.void deleteObject(SchemaObject 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(SchemaObject[] 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()
boolean canDelete(SchemaObject object, boolean cascade)
object
- the object to checkcascade
- whether to assume a cascading delete should be used.
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.Object 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.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.Object 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 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.SchemaObject 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 object
DBException
- if an error is encountered retrieving the objectDBObject.getType()
SchemaObjectManager getObjectManager()
void updateObjects(ResultSet rs, boolean replace, boolean cascade) throws DBException
ResultSet
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 ResultSet
- this should be a
LIST ResultSet 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(SchemaObject oldObject, SchemaObject newObject) throws DBException
oldObject
- the old version of the objectnewObject
- the new version of the object
DBException
- if the update failsvoid updateObjects(SchemaObject[] oldObjects, SchemaObject[] newObjects) throws DBException
oldObject
- the old version of the objectsnewObject
- the new version of the objects
DBException
- if the update failsjava.lang.String[] listObjects(java.lang.String objectType, Schema schema) throws DBException
objectType
- the type of objects to listschema
- the schema to list from
DBException
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 from
DBException
- 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 object
DBException
- if an error is encountered listing the objectsjava.lang.Long getTimestamp(DBObjectID id) throws DBException
DBException
java.lang.String[] listObjectTypes()
listObjects(java.lang.String, oracle.javatools.db.Schema)
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 returned
DBException
- if an error is encountered listing the schemas.Schema getSchema(java.lang.String name) throws DBException
name
- a string containing the name of the schema
DBException
- if an error is encountered getting the schemaSchema getDefaultSchema() throws DBException
DBException
boolean canCreate(Schema schema, boolean replace)
schema
- the Schema describing the object to createreplace
- whether to replace an existing schema. If
replace
is false and the schema exists, canCreate must
return false.
void createSchema(Schema schema, boolean replace) throws DBException
schema
- the schema being createdreplace
- whether to replace an existing schema
DBException
- 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 schema
DBException
- if the update failsboolean canDelete(Schema schema, boolean cascade)
schema
- the object to checkcascade
- whether to assume a cascading delete should be used.
void 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.
boolean isEditable(DBObject object)
SchemaObject getDefaultTemplateForType(java.lang.String type)
void setDefaultTemplateForType(java.lang.String type, SchemaObject template)
boolean isNewFromTemplateType(java.lang.String type)
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.1.0) E13403-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |