# COSMOS Developer's Guide

### Architecture

The process of handling a CMDBf query involves traversing a structure representing the request, processing each individual part, and generating a structure representing the result. COSMOS has already defined structures representing the request and response. There is also generic code in place for traversing the request and invoking handlers for the individual part of the CMDBf request. A consumer only needs to provide implementation of such handlers as part of implementing the query service.

A handler is required to process each CMDBf query constraint that an implementation supports. In addition to constraint handlers, the framework also requires two handlers for item templates and relationship templates. Here is the order in which the handlers are invoked:

1. Item/Relationship template handler
2. Instance id constraint handler
3. Record type constraint handler
4. Property value constraint handler

OR

1. Item/Relationship template handler
2. XPath constraint handler

It is the responsibility of the handler factory class to create instances of each handler above. The MDR toolkit automatically generates a handler factory. See src/org.eclipse.cosmos.example.mdr.handlers.QueryHandlerFactory.java for the class generated.

[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]