Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "COSMOS DG Providing CMDBf Query and Registration Services"
(→COSMOS Development Guide Providing CMDBf Query and Registration Services) |
(→Content) |
||
Line 32: | Line 32: | ||
+ | = Providing CMDBf Query Support = | ||
+ | As described in the previous section, the [http://www.cmdbf.org CMDBf specification] defines a query and a registration service. COSMOS provides a set of reusable, extensible classes and interfaces that can be utilized in implementing such services. This section will cover how COSMOS APIs can be used in providing a CMDBf query implementation for the Student-Teacher example. | ||
+ | == 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 individual part of the CMDBf request. A consumer needs to only 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's the order in which the handlers are invoked: | ||
+ | # Item/Relationship template handler | ||
+ | # Instance id constraint handler | ||
+ | # Record type constraint handler | ||
+ | # Property value constraint handler | ||
+ | OR | ||
+ | # Item/Relationship template handler | ||
+ | # 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. | ||
+ | |||
+ | == Creating Query Handlers == | ||
+ | |||
+ | This sample | ||
[[Category:COSMOS_Development_Guide]] | [[Category:COSMOS_Development_Guide]] |
Revision as of 16:42, 30 May 2008
COSMOS Wiki > COSMOS Document Plan > COSMOS Manual Guide
Contents
COSMOS Development Guide Providing CMDBf Query and Registration Services
Category: Development Guide
Owner | Ali Mehregani |
Bug # | 219142 |
Due dates | Schedule |
Outline
Content
Providing CMDBf Query Support
As described in the previous section, the CMDBf specification defines a query and a registration service. COSMOS provides a set of reusable, extensible classes and interfaces that can be utilized in implementing such services. This section will cover how COSMOS APIs can be used in providing a CMDBf query implementation for the Student-Teacher example.
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 individual part of the CMDBf request. A consumer needs to only 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's the order in which the handlers are invoked:
- Item/Relationship template handler
- Instance id constraint handler
- Record type constraint handler
- Property value constraint handler
OR
- Item/Relationship template handler
- 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.
Creating Query Handlers
This sample