org.apache.derby.impl.sql.catalog
Class DDdependableFinder

java.lang.Object
  extended byorg.apache.derby.impl.sql.catalog.DDdependableFinder
All Implemented Interfaces:
DependableFinder, java.io.Externalizable, Formatable, java.io.Serializable, TypedFormat
Direct Known Subclasses:
DDColumnDependableFinder

public class DDdependableFinder
extends java.lang.Object
implements DependableFinder, Formatable

Class for all DependableFinders in the core DataDictionary

Author:
Rick
See Also:
Serialized Form

Field Summary
private  DataDictionary dataDictionary
           
private  int formatId
           
private  UUIDFactory uuidFactory
           
 
Constructor Summary
DDdependableFinder(int formatId)
          Public constructor for Formatable hoo-hah.
 
Method Summary
private  DataDictionary getDataDictionary()
          Gets the datadictionary for this connection.
protected  Dependable getDependable(DataDictionary dd, UUID dependableObjectID)
          Get the dependable for the given UUID
 Dependable getDependable(java.lang.String dependableObjectID)
          Gets the in-memory object associated with the passed-in object ID.
 Dependable getDependable(UUID dependableObjectID)
          Gets the AliasDescriptor associated with the passed-in object ID.
protected  java.lang.String getSQLObjectName(DataDictionary dd, UUID dependableObjectID)
          Get the SQL object name for the given UUID
 java.lang.String getSQLObjectName(java.lang.String idString)
          Get the name of the SQL Object that corresponds to the specified UUID String.
 java.lang.String getSQLObjectType()
          The name of the class of Dependables as a "SQL Object" which this Finder can find.
 int getTypeFormatId()
          Get the formatID which corresponds to this class.
 void readExternal(java.io.ObjectInput in)
          Read this object from a stream of stored objects.
private  UUID recreateUUID(java.lang.String idString)
          Get the UUID for the given string
 java.lang.String toString()
           
 void writeExternal(java.io.ObjectOutput out)
          Write this object to a stream of stored objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dataDictionary

private transient DataDictionary dataDictionary

uuidFactory

private transient UUIDFactory uuidFactory

formatId

private final int formatId
Constructor Detail

DDdependableFinder

public DDdependableFinder(int formatId)
Public constructor for Formatable hoo-hah.

Method Detail

toString

public java.lang.String toString()

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Read this object from a stream of stored objects. Nothing to do. Our persistent representation is just a 2-byte format id.

Specified by:
readExternal in interface java.io.Externalizable
Parameters:
in - read this.
Throws:
java.io.IOException
java.lang.ClassNotFoundException

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Write this object to a stream of stored objects. Again, nothing to do. We just stamp the output stream with our Format id.

Specified by:
writeExternal in interface java.io.Externalizable
Parameters:
out - write bytes here.
Throws:
java.io.IOException

getTypeFormatId

public final int getTypeFormatId()
Get the formatID which corresponds to this class.

Specified by:
getTypeFormatId in interface TypedFormat
Returns:
the formatID of this class

getDependable

public final Dependable getDependable(java.lang.String dependableObjectID)
                               throws java.sql.SQLException
Gets the in-memory object associated with the passed-in object ID.

Specified by:
getDependable in interface DependableFinder
Parameters:
dependableObjectID - the UUID of the Dependable as a String. Used to locate that Dependable
Returns:
the associated Dependable
Throws:
java.sql.SQLException - thrown on error

getDependable

public final Dependable getDependable(UUID dependableObjectID)
                               throws java.sql.SQLException
Gets the AliasDescriptor associated with the passed-in object ID.

Specified by:
getDependable in interface DependableFinder
Parameters:
dependableObjectID - the ID of a Dependable. Used to locate that Dependable.
Returns:
the associated AliasDescriptor
Throws:
java.sql.SQLException - thrown on error

getSQLObjectName

public final java.lang.String getSQLObjectName(java.lang.String idString)
                                        throws java.sql.SQLException
Description copied from interface: DependableFinder
Get the name of the SQL Object that corresponds to the specified UUID String. For example, if getSQLObjectType() returns "Table", this will return the table name.

Specified by:
getSQLObjectName in interface DependableFinder
Parameters:
idString - the UUID String of a Dependable. Used to locate that Dependable.
Returns:
String Name of the associated Dependable
Throws:
java.sql.SQLException - thrown on error
See Also:
DependableFinder.getSQLObjectName(java.lang.String)

getSQLObjectType

public java.lang.String getSQLObjectType()
Description copied from interface: DependableFinder
The name of the class of Dependables as a "SQL Object" which this Finder can find. This is a value like "Table", "View", or "Publication". Every DependableFinder can find some class of Dependables.

Specified by:
getSQLObjectType in interface DependableFinder
Returns:
String type of the "SQL Object" which this Finder can find.
See Also:
DependableFinder.getSQLObjectType()

getDataDictionary

private DataDictionary getDataDictionary()
                                  throws StandardException
Gets the datadictionary for this connection.

Returns:
the data dictionary for this connection
Throws:
StandardException - Thrown on failure

recreateUUID

private UUID recreateUUID(java.lang.String idString)
Get the UUID for the given string

Returns:
the UUID

getDependable

protected Dependable getDependable(DataDictionary dd,
                                   UUID dependableObjectID)
                            throws StandardException
Get the dependable for the given UUID

Throws:
StandardException - thrown on error

getSQLObjectName

protected java.lang.String getSQLObjectName(DataDictionary dd,
                                            UUID dependableObjectID)
                                     throws StandardException
Get the SQL object name for the given UUID

Throws:
StandardException - thrown on error

Built on Mon 2007-06-04 09:58:47+0400, from revision ???

Apache Derby V10.1 Engine Documentation - Copyright © 1997,2005 The Apache Software Foundation or its licensors, as applicable.