COSMOS Design 215123

From Eclipsepedia

Jump to: navigation, search

Contents

Complete CMDBf 1.0 Service Metadata implementation

This is the design for Bugzilla 215123.

Change History

Name: Date: Revised Sections:
Bill Muldoon 1/28/2008
  • Initial version
Bill Muldoon 2/01/2008
  • Updated

Workload Estimation

Rough workload estimate in person weeks
Process Sizing Names of people doing the work
Design 0.2 week Bill Muldoon
Code 1 week Joel/Bill
Test 0 Bill/QA team
Documentation 0 N/A
Build and infrastructure 0 N/A
Code review, etc.* 0 N/A
TOTAL 1.2 weeks

* - includes other committer work (e.g. check-in, contribution tracking)

Terminologies/Acronyms

The terminologies/acronyms below are commonly used throughout this document. The list below defines each term regarding how it is used in this document:


Term Definition
MDR management data repository
CMDBf specification for a CMDB that federates between multiple MDRs [1]
federating CMDB the CMDB that federates between MDRs, offering a common access point to clients and correlating identifying record data
CMDB configuration management database

Purpose

CMDBf 1.0 introduced metadata to describe MDR query and registration metadata. This metadata is exposed as WS-Policy elements in WSDL. The purpose of this enhancement is to enable COSMOS MDRs to expose their metadata in WSDL.


External Implementation

How does a COSMOS MDR expose its metadata?

A COSMOS Data Manager exposes its metadata by implementing the getPolicyAssertions method of AbstractDataManager:

/**
 * Get the policy assertions of the Data Manager. 
 *   
 * Override this method to add your policy assertions (ie: for MDR metadata) to your WSDL
 *  
 * @return Collection<PolicyAssertion>
 */
@Override
public Collection<PolicyAssertion> getPolicyAssertions() {

    ArrayList<PolicyAssertion> policyAssertionList = new ArrayList<PolicyAssertion>();

    // create a DataManagerPolicyAssertion containing CMDBf metadata
    PolicyAssertion metadataPolicyAssertion = new DataManagerPolicyAssertion( EXAMPLE_POLICY_ID, 
                                                                              EXAMPLE_POLICY_METADATA, null);

    // add it to the array of policy assertions
    policyAssertionList.add(metadataPolicyAssertion);
	
    return policyAssertionList;
}


The getPolicyAssertions method returns an array of DataManagerPolicyAssertions, defined with this interface:

public interface PolicyAssertion {
    String getPolicyId();
    Element toXml();
    String toXmlString();
}

The getPolicyId() operation returns the policy identification. The toXml() and toXmlString() operations return the actual metadata.

Refer to the Example MDR for a sample implementation.


How does the client application obtain the MDR metadata?

First the client application must obtain the WSDL. The mechanism to obtain the WSDL is dependent on the container.

  • In Axis2, the "?WSDL" operation can be used.
  • In MUWS, Metadata Exchange (MEX) can be used.

The Data Manager Client provides a convenient method for using MEX:

public Element getWSDL()

The client application can extract the metadata from the WSDL. It may use the COSMOS CMDBf metadata transformations to convert the metadata into POJOs. Refer the COSMOS Client application below for an example.


Internal Implementation

When the WSDL is requested from a COSMOS Data Manager, the COSMOS Contribution Manager searches for the PolicyAssertionProvider interface in the annotations of the Data Manager. If found, it invokes the getPolicyAssertions() method to retrieve the policy data and then includes it when generating the WSDL.


Test Coverage

The COSMOS Client application can be used to test the metadata with the Example MDR. Refer to COSMOS_DEMO_i8 to setup the COSMOS Client application and then enter the "examplemdr getWSDL" command as shown below:

COSMOS> examplemdr getWSDL
EPR of SML Repository MDR (terminate by an empty line):
<wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
    <wsa:Address>http://130.200.149.222:9090/cosmos/services/org.eclipse.cosmos.example.mdr.ExampleMdr</wsa:Address>
    <wsa:ReferenceParameters>
        <muse-wsa:ResourceId xmlns:muse-wsa="http://ws.apache.org/muse/addressing">Example</muse-wsa:ResourceId>
    </wsa:ReferenceParameters>
</wsa:EndpointReference>

WSDL result: C:\workspace_i9\org.eclipse.cosmos.example.end2endTestClient\examplemdr.wsdl
MdrId:       ExampleMDR1
Description: null
 RecordType: R_ComputerSystem
 RecordType: CIM_CommonDatabase
COSMOS> exit

The COSMOS Client application will display the record types from the metadata using the CMDBf metadata services transformations. It will save the complete WSDL in the result file.

Also the COSMOS UI will be able to display the metadata from an MDR. Refer to related Bugzilla 215521


Open Issues

How does the client obtain the WSDL in the JAX-WS environment?

All reviewer feedback should go in the Talk page for 215123.