B Generated Skeleton Service Cartridge Source Files

This appendix describes generated service cartridge source files.

About the Generated Skeleton Service Cartridge Source Files

The file SDK_home\samples\serviceCartridge\ciscoBanner\skeleton.properties is fully populated and can be used to construct the skeleton source files for the sample ciscoBanner service cartridge. You can use these files for reference, or as a starting point for your own service cartridge. The generated source files do not contain all the necessary modifications to complete the service. See the provided sample source files for the changes needed.

To generate the ciscoBanner sample service cartridge source files using the data from the skeleton properties file:

  1. In the SDK_home directory, do one of the following:

    • Run the cartridge generator script using the included batch file:

      gensc samples\serviceCartridge\ciscoBanner\skeleton.properties
      

      or

    • Type in the command to run the cartridge generator script:

      ant -DtemplateType=serviceCartridge -DpropFile=SDK_home\samples\serviceCartridge\ciscoBanner\skeleton.properties
      

Note:

To use the batch file, you must first add SDK_home\bin to your PATH variable where SDK_home is the SDK directory.

This results in the following directory structure, which is a skeleton ciscoBanner service cartridge:

  SDK_home
    logs
      generator.log
    serviceCartridges
      <sdk_global_cartridgeName>
        build.xml
        src
          synonyms.xml
          <sdk_global_package>(com)
            <sdk_global_package>(.metasolv)
              <sdk_global_package>(..serviceactivator)
                <sdk_global_package>(...cartridges)
                  <sdk_global_package>(....ciscobanner)
                    audit
                      auditTemplate.xml
                    capabilities
                      empty_caps.xml
                    messages
                      errorMessages.xml
                      successMessages.xml
                      warningMessages.xml
                    options
                      options.xsd
                    schema
                      devicemodel.xsd
                    test
                      models
                        upgradeFrom
                          sampleDeviceModel.xml
                        sampleServiceModel.xml
                      DmUpgradeTests.java
                      TransformUnitTests.java
                    transforms
                      annotated-dm2cli.xq
                      dm2cli-postcheck.xq
                      dm2cli-precheck.xq
                      dm-validation.xq
                      sm2dm.xq
                    xquerylib
                      dm-migration.xq
                      DmUpgrade.xq
                      dm-validation.xq
                      dm-version.xq
                    Customization.xml
                    Extension.xml

Table B-1 describes the functionality of the component files of the skeleton service cartridge.

Table B-1 Generated Skeleton Service Cartridge Source Files Details

Component File Description

synonyms.xml

This file can be used to specify audit synonyms for commands delivered by this service cartridge. Audit synonyms can improve the success rate of a device audit, for devices that display some commands differently than how Oracle Communications IP Service Activator sent them.

auditTemplate.xml

This file is an audit template. Audit templates define filter patterns to be applied to commands to identify configuration of interest, to affect their inclusion in the audit report, and to set attributes on the command results, which, when viewed using a style sheet will affect how they are displayed to the IP Service Activator user.

Extension.xml

This file is the service cartridge registry file. The service cartridge registry is defined by the schema cartridge.xsd. The service cartridge registry file is the first service cartridge file read by the Network Processor. It defines all of the important entry points for the service cartridge.

The parameters controlled by the service cartridge registry are:

  • name: defines the name of the service cartridge. This must be unique across all service cartridges.

  • smToDmQuery: defines the service model to device model transform XQuery

  • dmValidation: defines the device model validation XQuery

  • dmToCliQuery: defines the device model to CLI transform XQuery

  • dmMigration: defines the device model migration XQuery. This is used for device model migration.

  • success: defines success messages sent by a device

  • warning: defines warning messages sent by a device

  • error: defines error messages sent by a device

  • auditTemplateFile: used by the audit process for devices provisioned using a CLI. Different audit template files can be specified for different device types and OS versions.

  • subscriptions: specifies the parts of the service model that the service cartridge is interested in.

  • auditQueryFile: used by the audit process for devices provisioned using an XML interface. Different audit template files can be specified for different device types and OS versions.

  • optionsEntry: specifies the options file that is passed to both the SM2DM and DM2CLI XQuery transforms. Different option files can be specified for different device types and OS versions.

  • capsEntry: specifies the capabilities that are supported by the service cartridge. Different capability files can be specified for different device types and OS versions.

Customization.xml

This file is used to customize the registry file. When packaged in the zip file, it will be named sdk_global_cartridgeName.xml.

empty_caps.xml

This file is a sample capabilities file. Capabilities provide privileges to the device and its subordinate interfaces to support various policies. The sample, being empty, will provide no capabilities to the device and it subordinate interfaces. The user needs to provide capability entries in order to provide privileges to the device during the IP Service Activator device discovery process.

errorMessages.xml

This file contains error patterns for commands generated by the service cartridge. If the response from the device matches one of the known error patterns, then a fault (Error) is raised against the device itself, all the concretes affected by that transaction are rejected and the partially implemented configuration is rolled back.

warningMessages.xml

This file contains warning patterns (blocking or non-blocking) for commands generated by the service cartridge. If the response from the device matches a non-blocking warning pattern, a fault (Warning) is raised. If the response from the device matches a blocking warning pattern, a fault is raised, and all concretes affected by that transaction are rejected and the partially implemented configuration is rolled back.

successMessages.xml

This file contains success patterns for commands generated by the service cartridge. If the device response (to sending a command) matches a success pattern, or there is no response at all (only a prompt), then the command is considered successful.

options.xml

This file is an XML schema file containing the configuration options that are required to define the cartridge jar file.

deviceModel.xsd

This file is used to validate the device model created during the service model to device model transformation. The base_devicemodel is owned by the network processor framework. The deviceModel is owned by the cartridge and can be extended as needed to support various polices and commands.

sampleDeviceModel.xml

This file is a sample device model used by DMUpgradeTests.java.

sampleServiceModel.xml

This file is a sample service model used for JUnit testing by TransformUnitTesting.java.

TransformUnitTests.java

  • method testBasicServiceModelToDeviceModelTransform: tests the ability to transform the sampleServiceModel to a proper deviceModel

  • method testBasicDeviceModelToCommandDocumentAddTransform: tests the ability to transform the deviceModel to a proper cliDocument which is adding cmds to the device

  • method testBasicDeviceModelToCommandDocumentDeleteTransform: tests the ability to transform the deviceModel to a proper cliDocument which is deleting cmds from the device

DMUpgradeTests.java

This file is used for testing cartridge upgrade scenarios.

sm2dm.xq

This file contains the XQuery source code that transforms a service model to a device model.

annotated-dm2cli.xq

This file contains the XQuery source code that transforms a device model to a CLI document.

dm2cli-postcheck.xq

This file contains the XQuery source code that performs the post-check functionality which is used by the annotatedDM2Cli.xq.

dm2cli-precheck.xq

This file contains the XQuery source code that performs pre-check functionality, which is used by the annotatedDM2Cli.xq.

dm-validation.xq

This file contains the XQuery source code providing the ability to raise fault to the system console.

dm-migration.xq

This file contains the XQuery source code used to support device model upgrades.

DmUpgrade.xq

This file contains the XQuery source code used to support executing a DM upgrade if cartridge DM has been enhanced.

dm-version.xq

This file contains the XQuery source code used to identify which cartridge version is in use.

dm-validation.xq

This file contains the XQuery source code used for additional validation of the device model.