VMware {code} Community
coldwater1
Contributor
Contributor

Setting Data using vSphere web client sdk

Hello,

In most use cases or samples provided in the sdk docs , there are examples of data query using either  PropertyProviderAdapter (getProperties) or DataProviderAdapter (getData) .Is there an API do setData or setProperties without implementing our own Custom Service Class ?

Right now all my set's are using my own custom Java Service class and I don't want to mix my adapters i.e getProperties & getData with my custom service class.

Or if I chose a Dataprovider can I implement my own set to plug it in DataProviderAdapter ? ( Without using my Service and DataProviderAdapter interfaces on the same class ofcourse Smiley Happy )

Thanks!

Tags (3)
0 Kudos
4 Replies
laurentsd
VMware Employee
VMware Employee

There is no similar API to update data at the moment so you have to use a Java service the way globalview-service does it for instance with setSettings().  There is no restriction on which class implements your service interface, it can be the same one that implements DataProviderAdapter, see the chassis-service sample.  If your update API is not trivial it is usually better to implement it in a different class for clarity.

coldwater1
Contributor
Contributor

So I had 2 different classes both at Flex & Service layer , one which uses PropertyAdapter to get a property and Service class (Custom Service )via a proxy implementation to do set a property  .

Is there any thing special that we need for this logic to work ? Especially with regards to dispatching requests

1. PropertyAdapter/DataProvider Adapter doesn't use web.xml for configuring DispatcherServelet

2. We need web.xml  for Custom Java Service implemtation to work ,specifically to route the DispatcherServlet  via amf channel.

Appreciate the quick reply earlier!

Thanks

0 Kudos
laurentsd
VMware Employee
VMware Employee

I am not sure what you question was but here is a quick recap:

1)  Getting data through the Data Access Manager (DAM) API doesn't require to setup any custom message broker because DAM is using the internal one from VWC.

2) Calling a Java service does require to setup your own message broker as the SDK samples show.  In that case you are not dispatching requests, you are calling your service methods through com.vmware.flexutil.proxies.BaseProxy

0 Kudos
coldwater1
Contributor
Contributor

Thanks laurentsd . I have looked closely at the code I think now I understand how to integrate using DAM and custom service layer in the same plug-in.

0 Kudos