com.bea.dsp.management.beans
Class RDBDataSourceConfig

java.lang.Object
  extended by com.bea.dsp.management.beans.DataSourceConfig
      extended by com.bea.dsp.management.beans.HierarchicalDataSourceConfig
          extended by com.bea.dsp.management.beans.RDBDataSourceConfig
All Implemented Interfaces:
Validatable, java.io.Serializable

public final class RDBDataSourceConfig
extends HierarchicalDataSourceConfig

Data source configuration for relational data bases.

See Also:
Serialized Form

Constructor Summary
RDBDataSourceConfig(java.lang.String id)
           
 
Method Summary
static boolean areSqlEqual(java.lang.String sql1, java.lang.String sql2)
          Returns true if the two sql strings are equals after being normalized.
 java.util.Collection<SqlStatementSubstitutionRuleConfig> getAllSqlStatementSubstitutionRules()
          Returns a non-null collection of all the defined sql statement substitution rules.
 java.lang.String getNewCatalogName(java.lang.String originalCatalogName)
          Returns the new configured name for the passed original catalog name.
 java.lang.String getNewPackageName(java.lang.String originalCatalogName, java.lang.String originalSchemaName, java.lang.String originalPackageName)
          Return the new name configured for the passed original package name.
 java.lang.String getNewSchemaName(java.lang.String originalCatalogName, java.lang.String originalSchemaName)
          Returns the new configured name of the passed original schema name.
 java.util.Set<java.lang.String> getOriginalCatalogNames()
          Returns a non null set containing all the catalog names.
 java.util.Set<java.lang.String> getOriginalPackageNames(java.lang.String originalCatalogName, java.lang.String originalSchemaName)
          Returns a non null set of all the package names.
 java.util.Set<java.lang.String> getOriginalSchemaNames(java.lang.String originalCatalogName)
          Returns a non null set of all the schema names within the passed catalog.
 EndPointConfig getProceduralEndPoint(java.lang.String originalCatalogName, java.lang.String originalSchemaName, java.lang.String originalPackageName, EndPointName endPointName)
           
 java.util.Collection<EndPointConfig> getProceduralEndPoints(java.lang.String originalCatalogName, java.lang.String originalSchemaName, java.lang.String originalPackageName)
           
 SqlStatementSubstitutionRuleConfig getSqlStatementSubstitutionRuleByName(java.lang.String name)
          Returns the sql statement substitution rule having the passed name.
 SqlStatementSubstitutionRuleConfig getSqlStatementSubstitutionRuleBySql(java.lang.String sql)
          Returns the sql statement substitution rule for the passed sql.
 EndPointConfig getTabularEndPoint(java.lang.String originalCatalogName, java.lang.String originalSchemaName, EndPointName endPointName)
          Return a endpoint config object for the passed tabular endpoint name.
 java.util.Collection<EndPointConfig> getTabularEndPoints(java.lang.String originalCatalogName, java.lang.String originalSchemaName)
          Returns a non null collection of end points within this schema.
 boolean hasSqlStatementSubstitutionRule()
          Returns true if any sql statement substitution rule has been defined for this datasource.
 void setNewCatalogName(java.lang.String originalCatalogName, java.lang.String newCatalogName)
          Set a new name for a catalog.
 void setNewPackageName(java.lang.String originalCatalogName, java.lang.String originalSchemaName, java.lang.String originalPackageName, java.lang.String newPackageName)
          Set a new name for the passed package name.
 void setNewSchemaName(java.lang.String originalCatalogName, java.lang.String originalSchemaName, java.lang.String newSchemaName)
          Set the new name for the passed schema.
 void updateSqlStatementSubstitutionRules(java.util.Collection<SqlStatementSubstitutionRuleConfig> configs)
          Updates in the internal collection with the passed set of rules.
 
Methods inherited from class com.bea.dsp.management.beans.HierarchicalDataSourceConfig
getContainer, getContainers, getEndPoint, getEndPoints
 
Methods inherited from class com.bea.dsp.management.beans.DataSourceConfig
getDataSourceId, getDependents, getNewId, getServiceAccountName, setNewId, setServiceAccountName, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RDBDataSourceConfig

public RDBDataSourceConfig(java.lang.String id)
Method Detail

getOriginalCatalogNames

public java.util.Set<java.lang.String> getOriginalCatalogNames()
Returns a non null set containing all the catalog names. If the data source does not support catalog then set is empty.

Returns:
catalog names

getNewCatalogName

public java.lang.String getNewCatalogName(java.lang.String originalCatalogName)
Returns the new configured name for the passed original catalog name.

Parameters:
originalCatalogName -
Returns:
new catalog name

setNewCatalogName

public void setNewCatalogName(java.lang.String originalCatalogName,
                              java.lang.String newCatalogName)
                       throws ValidationException
Set a new name for a catalog.

Parameters:
originalCatalogName -
newCatalogName -
Throws:
ValidationException

getOriginalSchemaNames

public java.util.Set<java.lang.String> getOriginalSchemaNames(java.lang.String originalCatalogName)
Returns a non null set of all the schema names within the passed catalog. The passed catalog name can be null if the datasource does not support catalog. Similarly if the datasource does not contain schemas then the returned set is empty.

Parameters:
originalCatalogName -
Returns:
non null set of all the schema names

getNewSchemaName

public java.lang.String getNewSchemaName(java.lang.String originalCatalogName,
                                         java.lang.String originalSchemaName)
Returns the new configured name of the passed original schema name. originalCatalogName can be null.

Parameters:
originalCatalogName -
originalSchemaName -
Returns:
new schema name

setNewSchemaName

public void setNewSchemaName(java.lang.String originalCatalogName,
                             java.lang.String originalSchemaName,
                             java.lang.String newSchemaName)
                      throws ValidationException
Set the new name for the passed schema. Catalog name can be null but originalSchemaName cannot be null.

Parameters:
originalCatalogName -
originalSchemaName -
newSchemaName -
Throws:
ValidationException - if such a schema does not exist.

getTabularEndPoints

public java.util.Collection<EndPointConfig> getTabularEndPoints(java.lang.String originalCatalogName,
                                                                java.lang.String originalSchemaName)
Returns a non null collection of end points within this schema. It returns endpoints for tables and views. It does not returns the procedural endpoints like stored procedures etc. There is a separate method for that. Both the catalog and the schema name can be null. New name for end points can be set directly on the returned endpoints.

Parameters:
originalCatalogName -
originalSchemaName -
Returns:
end points

getTabularEndPoint

public EndPointConfig getTabularEndPoint(java.lang.String originalCatalogName,
                                         java.lang.String originalSchemaName,
                                         EndPointName endPointName)
Return a endpoint config object for the passed tabular endpoint name. Use this method to fetch endpoints for tables and views. Both the catalog and the schema name can be null.

Parameters:
originalCatalogName -
originalSchemaName -
endPointName -
Returns:
endpoint config for the passed tabular endpoint

getOriginalPackageNames

public java.util.Set<java.lang.String> getOriginalPackageNames(java.lang.String originalCatalogName,
                                                               java.lang.String originalSchemaName)
Returns a non null set of all the package names. Both the catalog name and the schema name can be null if they are not supported by the database. If packages are not supported by the database or procedures have been created outside of packages then this set is empty.

Parameters:
originalCatalogName -
originalSchemaName -
Returns:

getNewPackageName

public java.lang.String getNewPackageName(java.lang.String originalCatalogName,
                                          java.lang.String originalSchemaName,
                                          java.lang.String originalPackageName)
Return the new name configured for the passed original package name. The value returned could be null if the package does not exist or if no new name has been configured for that package. Both the catalog and the schema name can be null.

Parameters:
originalCatalogName -
originalSchemaName -
originalPackageName -
Returns:
new name for the package

setNewPackageName

public void setNewPackageName(java.lang.String originalCatalogName,
                              java.lang.String originalSchemaName,
                              java.lang.String originalPackageName,
                              java.lang.String newPackageName)
                       throws ValidationException
Set a new name for the passed package name. Both the catalog name and the schema name can be null if they are not supported by the database.

Parameters:
originalCatalogName -
originalSchemaName -
originalPackageName -
newPackageName -
Throws:
ValidationException

getProceduralEndPoints

public java.util.Collection<EndPointConfig> getProceduralEndPoints(java.lang.String originalCatalogName,
                                                                   java.lang.String originalSchemaName,
                                                                   java.lang.String originalPackageName)

getProceduralEndPoint

public EndPointConfig getProceduralEndPoint(java.lang.String originalCatalogName,
                                            java.lang.String originalSchemaName,
                                            java.lang.String originalPackageName,
                                            EndPointName endPointName)

hasSqlStatementSubstitutionRule

public boolean hasSqlStatementSubstitutionRule()
Returns true if any sql statement substitution rule has been defined for this datasource.

Returns:

getSqlStatementSubstitutionRuleBySql

public SqlStatementSubstitutionRuleConfig getSqlStatementSubstitutionRuleBySql(java.lang.String sql)
Returns the sql statement substitution rule for the passed sql. The passed sql is first normalized before comparison. This method may return null if no rule is defined for this sql.

Parameters:
sql -
Returns:
the sql statement substitution rule for the passed sql
See Also:
normalizeSQLStatement(String)

getAllSqlStatementSubstitutionRules

public java.util.Collection<SqlStatementSubstitutionRuleConfig> getAllSqlStatementSubstitutionRules()
Returns a non-null collection of all the defined sql statement substitution rules.


updateSqlStatementSubstitutionRules

public void updateSqlStatementSubstitutionRules(java.util.Collection<SqlStatementSubstitutionRuleConfig> configs)
Updates in the internal collection with the passed set of rules. If the passed collection is null then all the rules are cleared.

Parameters:
configs -

getSqlStatementSubstitutionRuleByName

public SqlStatementSubstitutionRuleConfig getSqlStatementSubstitutionRuleByName(java.lang.String name)
Returns the sql statement substitution rule having the passed name. Returned value can be null incase no rule with this name is defined.

Parameters:
name -
Returns:
the sql statement substitution rule having the passed name

areSqlEqual

public static boolean areSqlEqual(java.lang.String sql1,
                                  java.lang.String sql2)
Returns true if the two sql strings are equals after being normalized.

Parameters:
sql1 -
sql2 -


Copyright © 2007 BEA Systems Inc. All Rights Reserved.