Prepare the Adapter Package

In this step, you locate and configure the Generic DB adapter package.

  1. Locate the db-adapter.zip package in the C:\UCMDB\UCMDBServer\content\adapters folder.

  2. Extract the package to a local temporary directory.

  3. Edit the adapter XML file:

    • Open the discoveryPatterns\db_adapter.xml file in a text editor.

    • Locate the adapter id attribute and replace the name:

      <pattern id="MyAdapter" displayLabel="My Adapter" xsi:noNamespaceSchemaLocation="../../Patterns.xsd" description="Discovery Pattern Description"
               schemaVersion="9.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" displayName="UCMDB API Population">

      If the adapter supports population, the following capability should be added to the <adapter-capabilities> element:

               <support-replicatioin-data>
                   <source>
                       <changes-source>
                   </source>
               </support-replicatioin-data> 
      

      The display label or ID appears in the list of adapters in the Integration Point pane in Universal CMDB.

      When creating a Generic DB Adapter it is not necessary to edit the changes-source tag in the support-replicatioin-data tag. If the FcmdbPluginForSyncGetChangesTopology plug-in is implemented, the changed topology from the last run will be returned. If the plug-in is not implemented, the full topology will be returned and the auto-delete will be performed according to the returned CIs.

      For details about populating the CMDB with data, see Integration Studio Page.

    • If the adapter is using the mapping engine from version 8.x (meaning that it is not using the new reconciliation mapping engine), replace the following element:

      <default-mapping-engine>
      

      with:

      <default-mapping-engine>com.hp.ucmdb.federation.
      mappingEngine.AdapterMappingEngine</default-mapping-engine>

      To revert to the new mapping engine, return the element to the following value:

      <default-mapping-engine>
      
    • Locate the category definition:

      <category>Generic</category>
      

      Change the Generic category name to the category of your choice.

      Note Adapters whose categories are specified as Generic are not listed in the Integration Studio when you create a new integration point.

    • The connection to the database can be described using a user name (schema), password, database type, database host machine name, and database name or SID.

      For this type of connection, parameters have the following elements in the parameter section of the adapter's XML file:

      <parameters>
          <!--The description attribute may be written in simple text or HTML.-->
          <!--The host attribute is treated as a special case by UCMDB-->
          <!--and will automatically select the probe name (if possible)-->
          <!--according to this attribute's value.-->
          <!--Display name and description may be overwritten by I18N values-->
              <parameter name="host" display-name="Hostname/IP" type="string" description="The host name or IP address of the remote machine" mandatory="false" order-index="10" />
              <parameter name="port" display-name="Port" type="integer" description="The remote machine's connection port" mandatory="false" order-index="11" />
              <parameter name="dbtype" display-name="DB Type" type="string" description="The type of database" valid-values="Oracle;SQLServer;MySQL;BO" mandatory="false" order-index="13">Oracle</parameter>
              <parameter name="dbname" display-name="DB Name/SID" type="string" description="The name of the database or its SID (in case of Oracle)"  mandatory="false" order-index="13" />
              <parameter name="credentialsId" display-name="Credentials ID" type="integer" description="The credentials to be used" mandatory="true" order-index="12" />
      </parameters>
      
    • Note This is the default configuration. Therefore, the db_adapter.xml file already contains this definition.

      There are situations in which the connection to the database cannot be configured in this way. For example, connecting to Oracle RAC or connecting using a database driver other than the one supplied with the CMDB.

      For these situations, you can describe the connection using user name (schema), password, and a connection URL string.

      To define this, edit the adapter's XML parameters section as follows:

      <parameters>
          <!--The description attribute may be written in simple text or HTML.-->
          <!--The host attribute is treated as a special case by CMDBRTSM-->
          <!--and will automatically select the probe name (if possible)-->
          <!--according to this attribute's value.-->
          <!--Display name and description may be overwritten by I18N values-->
              <parameter name="url" display-name="Connection String" type="string" description="The connection string to connect to the database" mandatory="true" order-index="10" />
              <parameter name="credentialsId" display-name="Credentials ID" type="integer" description="The credentials to be used" mandatory="true" order-index="12" />
      </parameters>
      

      An example of a URL that connects to an Oracle RAC using the out-of-the- box Data Direct driver is: jdbc:mercury:oracle://labm3amdb17:1521;ServiceName=RACQA;AlternateServers=(labm3amdb18:1521);LoadBalancing=true.

  4. In the temporary directory, open the adapterCode folder and rename GenericDBAdapter to the value of adapter id that was used in the previous step.

    This folder contains the adapter's configuration, for example, the adapter name, the queries and classes in the CMDB, and the fields in the RDBMS that the adapter supports.

  5. Configure the adapter as required. For details, see Configure the Adapter – Minimal Method.

  6. Create a *.zip file with the same name as you gave to the adapter id attribute, as described in the step Edit the adapter XML file:.

    Note The descriptor.xml file is a default file that exists in every package.

  7. Save the new package that you created in the previous step. The default directory for adapters is: C:\UCMDB\UCMDBServer\content\adapters.