[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.technology.cosmos] Developing a Custom MDR - Posting on behalf of "Pathuri, Hanu"

Hi Hanu,

a) IItemConstraintHandler is a generic interface used for all constraints 
associated with item templates (e.g. instance id handler, record type 
handler, and etc...). If you look at 
org.eclipse.cosmos.samples.cmdbf.services.query.ItemInstanceIdHandler, 
you'll notice that it extends AbstractItemConstraintHandler, which 
implements IItemConstraintHandler.

b) That depends on the type of constraints your MDR will support.

To support item templates you need to implement: IItemTemplateHandler (or 
optionally extend AbstractItemTemplateHandler)

For each item constraints (i.e. Instance id, record type, property value, 
and XPath), you need to implement IItemConstraintHandler (or optionally 
extend AbstractItemConstraintHandler)

To support relationship templates you need to implement: 
IRelationshipTemplateHandler

For each relationship constraint (i.e. Instance id, record type, property 
value, and XPath), you need to implement IRelationshipConstraintHandler (or 
optionally extend AbstractRelationshipConstraintHandler)

c) The default implementation of the CMDBf query engine, invokes 
IRelationshipTemplateHandler.execute(...) for each item in the source and 
target item template. If there are multiple relationships, then you're 
template handlers will be invoked multiple times based on the entries of the 
source and target item templates.

> Is there any way to extend the example to cover most traversed paths to 
> help newbies like myself?

In most cases, yes.

> Based on my assessment, we can reuse

> org.eclipse.cosmos.dc.cmdbf.services.query.service.impl and the following 
> classes in org.eclipse.cosmos.samples.cmdbf.services.query

> a) We need to write classes similar to the classes mentioned in this 
> package

> b) We need to add another class ItemConstraintHandler.java

Ideally you want to reuse as much code as possible under the plug-in: 
org.eclipse.cosmos.dc.cmdbf.services and make your MDR based on a revision 
of org.eclipse.cosmos.samples.cmdbf.services.

I'm posting this e-mail thread to the newsgroup so it can benefit others.

To learn how to access COSMOS newsgroup, click on the 'newsgroup' link from 
COSMOS main web page. We can continue the discussion from there.

Thanks and good luck,

==================================================================



Hi Ali,

Overall, we are very impressed with COSMOS initiative and commitment of this 
group.

Thanks for the prompt and detailed response.

I have the following questions:

a) There seem to be no sample code for implementing IItemConstraintHandler 
in the Sample Query Service. Is there sample code that we can look at?

b) What are the generic interfaces that all our Domain Objects must 
implement?

By looking at the code, it appears that if Our Domain Objects implement 
IItemConvertible, IXMLWritable, would the framework automatically take care 
of conversions?

c) It is unclear how to implement RelationShipTemplate in a generic way? For 
instance, if we have to support multiple relationships, how does the code 
look like?

Is there any way to extend the example to cover most traversed paths to help 
newbies like myself?

I am beginning to figure out exposing our proprietary data in such a way 
that it can be adopted easily into COSMOS framework.

Based on my assessment, we can reuse

org.eclipse.cosmos.dc.cmdbf.services.query.service.impl and the following 
classes in org.eclipse.cosmos.samples.cmdbf.services.query

a) We need to write classes similar to the classes mentioned in this package

b) We need to add another class ItemConstraintHandler.java

We would greatly appreciate any guidance on this regard.

Thanks in advance,

Hanu

==================================================================



Hi Hanu,

Here are a few recommendations:

1) If you're not already familiar with CMDBf, you can read the standard 
here:  http://cmdbf.org/schema/1-0-0/CMDBf_v1.0b.pdf

2) Even though the following document is a bit outdated, it still will gives 
you a good overview of the CMDBf framework: 
http://wiki.eclipse.org/Providing_a_CMDBf_Query_and_Registration_Service. 
This document will describe how you can use COSMOS' APIs to provide CMDBf 
services (i.e. query/registration).

3) In i10 we transitioned from the OSGi platform to web services.  An MDR in 
i10 is a web service running on the Axis2 engine.  The student/teacher 
sample is your best point of reference to determine how all pieces of COSMOS 
works.  The sample is composed of two parts:

a) The CMDBf implementation of the services

b) Wrapping to package the sample as an MDR (i.e. a web service)

The code for the first part can be retrieved from COSMOS CVS under:

org.eclipse.cosmos/examples/org.eclipse.cosmos.samples.cmdbf.services

The second part can be retrieved from:

org.eclipse.cosmos/examples/org.eclipse.cosmos.example.mdr.ws

org.eclipse.cosmos.samples.cmdbf.services contains an implementation of a 
record type constraint:

org.eclipse.cosmos.samples.cmdbf.services/src/org.eclipse.cosmos.samples.cmdbf.services.query/ItemRecordTypeHandler.java

For the overall flow of the query operation, see 
CMDBfQueryOperation.execute(Object) under 
org.eclipse.cosmos.dc.cmdbf.services/src-query-service/org.eclipse.cosmos.dc.cmdbf.services.query.service.impl. 
The plug-in can be retrieved under the following CVS module: 
org.eclipse.cosmos/data-collection.  Notice the result is suppressed in the 
last step (i.e. step 4:  processContentSelectors (queryResult, cmdbfQuery);)

We are working towards solidifying our documentation and sample set.

Let us know if you have any other questions.

Thanks,

Ali Mehregani

Phone Number: (905) 413-3712

Service Modeling Language - COSMOS

http://www.eclipse.org/cosmos/



=====================================================



Ali,

I am beginning to develop an MDR for exposing Qualcomm properitary 
provisioning system based on COSMOS framework. I am looking at the code 
written by you in Samples project.

While I understand overall flow, I am not quite clear on how to implement 
record constraints and how the filtering happens based on 'SuppressResult' 
etc.

Is there a generic example which would cover all features of Graph Query 
Language?

I have internally championed that COSMOS framework is the Best Approach and 
got approval to build a MDR. I need all the guidance that I can get to move 
forward on this.

I am looking to get direction and help.

I would greatly appreciate it if you can give me guidance and necessary 
pointers in this respect.

BTW, Are there any training sessions going to be held for Developers Like to 
adopt COSMOS framework? If so, when and where?

Thanks in advance,

Hanu