Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

DB Change Manager gathers results when it collects all of the properties and values for display purposes or to store in an archive. The extraction method is called when a data source is indicated in a standard, or when an archive or comparison job is run.

public Set<IConfigurationPropertyResult> extract(Set<IConfigurationProperty> properties, IDatasourceIdentifier dataSourceIdentifier)

A set of IConfigurationPropertyResult instances that correspond to the properties must be returned, and values need to be added for the properties returned from the data source, as follows:

public Set<IConfigurationPropertyResult> extract (Set<IConfigurationProperty> properties, IDatasourceIdentifier dataSourceIdentifier)
{
     try
     {
          Set<IConfigurationPropertyResult> results = new HashSet<IConfigurationPropertyResult> ();
          Connection connection = getConnection (dataSourceIdentifier);
          for (IConfigurationProperty configProp : properties)
          {
               EVersionProperties prop = EVersionProperties.getProperty (configProp.getPropertyIdentifier());
               String value = prop.getValue (connection);
               results.add (createConfigurationPropertyResult (configProp, true, value)
               );
          }
     return results;
     }
catch (SQLException sql)
{
     throw new RuntimeException (sql);
     }
}

In the above implementation, the code creates an empty set to hold the results and then retrieves the JDBC connection to the data source. For each retrieval, the enum constant EVersionProperties on which getValue is called to retrieve each property value from JDBC metadata. Finally, createConfigurationPropertyResult is called to create the result instance.

Synchronize the job

The synchronization method returns an empty array because users cannot synchronize version information.

public List<IPropertyResultsSynchronization> sync (IDatasourceIdentifier dataSourceIdentifier,
     List<IConfigurationPropertyResult> sourcePropertyValues, List<IConfigurationPropertyResult>
     targetPropertyValues)
{
     return new ArrayList<IPropertyResultsSynchronization>();
}

Register extensions

Once you have completed coding the plugin, register it with DB Change Manager by implementing an Eclipse extension. When the plugin is added to DB Change Manager, the extensions are registered and DB Change Manager understands that the plugin adds a new type of notification to the module.

To register extensions

  1. Open the Manifest.MF file and navigate to the Extensions tab.
  2. Click Add to register an extension.
    The New Extension dialog appears.
  3. Choose com.idera.change.config.propertysource.contribution.
  4. Click Finish, and then close the dialog.
    The extension is added to the All Extensions list.
  5. Select the (source) entry on the right-hand side of the screen, and then enter the following details:
    • display-name: JDBC Metadata version information
    • source-identifier: org.acme.jdbc.versioninformation.source
    • class: org.acme.jdbcversioninformation.JDBCVersionInformation

      Info

      The class name is used to enable DB Change Manager to instantiate the new class, while the display-name is the group under which the four JDBC metadata version properties appear.

  6. Save the file by pressing CTRL-S or by choosing File>Save from the menu.
    The class notification is complete, and DB Change Manager and Eclipse are informed about the property source. When the plugin is added to DB Change Manager, it will add your properties to configuration comparison and standard jobs.

Deploy the custom configuration plugin

To deploy the custom plugin

  1. Shut down DB Change Manager if it is running.
  2. Click File>Export.
    The Export dialog appears.
  3. Select Deployable Plugins and Fragments from the Plugin Development group, and click then Next.
  4. Select org.acme.jdbcversioninformation and ensure the target directory is the same as the DB Change Manager installation folder.
  5. Click Finish.
    The new plugin is deployed.
  6. Start DB Change Manager and create a new configuration archive job. When you select an Oracle, Sybase, or SQL Server data source, the Refinements and the Results tabs contain the four version properties you defined in the new plugin.


Scroll Ignore
scroll-pdftrue
scroll-officetrue
scroll-chmtrue
scroll-docbooktrue
scroll-eclipsehelptrue
scroll-epubtrue
scroll-htmltrue
Newtabfooter
aliasIDERA
urlhttp://www.idera.com
 | 
Newtabfooter
aliasProducts
urlhttps://www.idera.com/productssolutions/sqlserver
 
Newtabfooter
aliasPurchase
urlhttps://www.idera.com/buynow/onlinestore
 | 
Newtabfooter
aliasSupport
urlhttps://idera.secure.force.com/
 | 
Newtabfooter
aliasCommunity
urlhttp://community.idera.com
 
|
 
Newtabfooter
aliasResources
urlhttp://www.idera.com/resourcecentral
 | 
Newtabfooter
aliasAbout Us
urlhttp://www.idera.com/about/aboutus
 
Newtabfooter
aliasLegal
urlhttps://www.idera.com/legal/termsofuse