VMware {code} Community
coldwater1
Contributor
Contributor

Passing in Additional parameters in DataProvider Adapter not supported ?

I want to send the _contextObject of a vsphere object (HostSystem) in DataProvider Adapter as an parameter in the dispatch request for which I'm doing the following:

Flex layer:

var requestInfo:DataRequestInfo =
            new DataRequestInfo(DataUpdateSpec.newImplicitInstance());
var testDBMR:DataByModelRequest = DataByModelRequest.newInstance(_contextObject,ChassisSummaryDetails,requestInfo);
var ctxObj:Object=Object(_contextObject);
testDBMR.addPropertyParameter("myContextUID",ctxObj);
      // Dispatch an event to fetch _contextObject data from the server
      // along the specified model.
      dispatchEvent(testDBMR);
How can I retreive this additional parameter in my getData-method in service layer? Any insight into this would be highly appreciated .
Thanks!
The documentation mentions :
Method Detail
addPropertyParameter()method
public function addPropertyParameter(property:String, parameter:Object):void

Adds a parameter to be passed to Data Service when retrieving a certain property.

Parameters


property:String — The property name in form of relationship.relationship.property.

parameter:Object — The parameter value to pass; a single parameter can be passed for a particular property.
Tags (1)
0 Kudos
9 Replies
laurentsd
VMware Employee
VMware Employee

You don't need to pass your HostSystem object as parameter in that case, it's already part of the query since it is the object from which you want to retrieve some properties (if you are using a DataProviderAdapter you can find a reference to it in the QuerySpec.constraint which will be an ObjectIdendityConstraint and the object in question is the "target" field.  If you are using a PropertyProviderAdapter the object is in the PropertyRequestSpec.objects array)

When you do need to pass 1 or more parameters you can retrieve them in the propertySpec.parameters array on the java side.

coldwater1
Contributor
Contributor

Looking at the chassis-ui & chassis-service example

in validateConstraint method being called by validateQuerySpec-> 

if (constraint instanceof ObjectIdentityConstraint) {
         Object source = ((ObjectIdentityConstraint)constraint).target;       
         return (source != null &&
               CHASSIS_TYPE.equals(_objectRefService.getResourceObjectType(source)));
      }

Isn't the source of custom type ? which would not provide me information on which Host System I'm using it on. So in my current use case

I have a data provider Adapter which needs to get network information for a a specific host. Without using the relationship constraint I want to pass in the HostSystem(_contextObject or it _contextObject.uid )  as one of the parameters

For which I used

      var requestInfo:DataRequestInfo =

            new DataRequestInfo(DataUpdateSpec.newImplicitInstance());

var testDBMR:DataByModelRequest = DataByModelRequest.newInstance(_contextObject,NetworkConfigInfo,requestInfo);

var ctxObj:Object=Object(_contextObject);

testDBMR.addPropertyParameter("ContextUID",ctxObj);

      // Dispatch an event to fetch _contextObject data from the server

      // along the specified model.

      dispatchEvent(testDBMR);

I don't see the addition paramter passed in the service layer . Is there something that I'm doing incorectly?

Service Layer:

But the ParameterSpec in the QueryRequest show up as zero and the property itself is null .

2012-12-20 13:52:11.548] INFO  [INFO ] http-bio-9443-exec-8          System.out                                                       

[2012-12-20 13:52:11.548] DEBUG [DEBUG] http-bio-9443-exec-8          com.vmware.vise.data.query.impl.DataServiceImpl                   QuerySpecs to execute:

Query[0]:

QuerySpec

   QueryName: dam-auto-generated: ListViewMediator:dr-39

   ResourceSpec

      Constraint: Constraint

         TargetType: samples:Chassis

      PropertySpec[1]

         ProviderType: samples:Chassis

         Relationship: null

         Properties[2]

            PropertyName: name

            PropertyName: serverType

   ResultSpec:

      Offset: 0

      MaxResultCount: 70

      OrderingCriteria: null


[2012-12-20 13:52:11.549] INFO  [INFO ] http-bio-9443-exec-8          System.out                                                        DEBUG-pSpec0

[2012-12-20 13:52:11.549] DEBUG [DEBUG] data-service-pool-173         com.vmware.vise.util.session.SessionUtil                          Client id is - c80c761d-4c4b-46b5-a711-f9fcd3cb6222, associated with http session id 9F09C4A58CE6CCF0CB4E1C8C38F550EE with context path /vsphere-client-endpoints

[2012-12-20 13:52:11.549] DEBUG [DEBUG] data-service-pool-173         com.vmware.vise.util.session.SessionUtil                          Client id is - c80c761d-4c4b-46b5-a711-f9fcd3cb6222, associated with http session id 9F09C4A58CE6CCF0CB4E1C8C38F550EE with context path /vsphere-client-endpoints

[2012-12-20 13:52:11.549] INFO  [INFO ] http-bio-9443-exec-8          System.out                                                        DEBUG params length is zero

[2012-12-20 13:52:11.549] DEBUG [DEBUG] data-service-pool-173         com.vmware.vise.util.session.SessionUtil                          Client id is - c80c761d-4c4b-46b5-a711-f9fcd3cb6222, associated with http session id 9F09C4A58CE6CCF0CB4E1C8C38F550EE with context path /vsphere-client-endpoints

[2012-12-20 13:52:11.549] DEBUG [DEBUG] data-service-pool-173         com.vmware.vise.util.session.SessionUtil                          Client id is - c80c761d-4c4b-46b5-a711-f9fcd3cb6222, associated with http session id 9F09C4A58CE6CCF0CB4E1C8C38F550EE with context path /vsphere-client-endpoints

[2012-

0 Kudos
laurentsd
VMware Employee
VMware Employee

I based my earlier reply on the code you provided:

   var testDBMR:DataByModelRequest =

          DataByModelRequest.newInstance(_contextObject,ChassisSummaryDetails,requestInfo);

This request doesn't need the context object to be added as parameter, it will be in the "target" of the ObjectIdentityConstraint in your DPA.

But now I am confused... are you trying to get the ChassisSummaryDetails when a HostSystem is selected?

_contextObject here represents whatever object is selected in the inventory for that view.

The query you show later is for the samples:Chassis object, so it's normal that the parameter added for a host query doesn't show up.

0 Kudos
coldwater1
Contributor
Contributor

Sorry for the confusion, I wanted to pass in the HostSystem - contextObject information to the DAP  for my custom object , for which I have posed this question . My plugin in is an extended point of vsphere.core.host.manage.storageViews.

The DAP which needs to get network information for a a specific host. Without using the relationship constraint I want to pass in the HostSystem(_contextObject or it _contextObject.uid )  as one of the parameters in the request .

To verify/experiment if the above functionality works I built a  modified example similar to the Chassis-ui example and with the following additions.

So my question still remains is the addPropertyParameter in DataByModelRequest class work ? Is this the right way to pass down additional parameters ?

Here is a modified version of the Chassis-ui Example :with the emphasis on testDBMR.addPropertyParameter("ContextUID",ctxObject);

var requestInfo:DataRequestInfo = new DataRequestInfo(DataUpdateSpec.newImplicitInstance());

var testDBMR:DataByModelRequest = DataByModelRequest.newInstance(_contextObject,ChassisSummaryDetails,requestInfo);

var ctxObj:Object=Object(_contextObject);

testDBMR.addPropertyParameter("ContextUID",ctxObj);

      // Dispatch an event to fetch _contextObject data from the server

      // along the specified model.

      dispatchEvent(testDBMR);

However the response doesn't show up the Parameter Spec :

Modified version of code in service layer

  private String[] convertPropertySpec(PropertySpec[] pSpecs) {
      Set<String> properties = new HashSet<String>();    
      if (pSpecs != null) {
         for (PropertySpec pSpec : pSpecs) {
             System.out.println("SRI-DEBUG-pSpec" + pSpec.parameters.length);
             if(pSpec.parameters.length != 0) {
             for(ParameterSpec param : pSpec.parameters){       
                  System.out.println("SRI-DEBUG-ParameterSpec - propertyName-" + param.propertyName + "Parameterspec-parameter" + param.parameter.toString());       
             }   
             }
             else {
      
                  System.out.println("SRI-DEBUG params length is zero");
             }
            for (String property : pSpec.propertyNames) {
          
               properties.add(property);
            }
         }
      }
      return properties.toArray(new String[]{});
   }

Service Layer:

But the ParameterSpec in the QueryRequest show up as zero and the property itself is null .

2012-12-20 13:52:11.548] INFO  [INFO ] http-bio-9443-exec-8          System.out                                                      

[2012-12-20 13:52:11.548] DEBUG [DEBUG] http-bio-9443-exec-8          com.vmware.vise.data.query.impl.DataServiceImpl                   QuerySpecs to execute:

Query[0]:

QuerySpec

   QueryName: dam-auto-generated: ListViewMediator:dr-39

   ResourceSpec

      Constraint: Constraint

         TargetType: samples:Chassis

      PropertySpec[1]

         ProviderType: samples:Chassis

         Relationship: null

         Properties[2]

            PropertyName: name

            PropertyName: serverType

   ResultSpec:

      Offset: 0

      MaxResultCount: 70

      OrderingCriteria: null

[2012-12-20 13:52:11.549] INFO  [INFO ] http-bio-9443-exec-8          System.out                                                        DEBUG-pSpec0

[2012-12-20 13:52:11.549] DEBUG [DEBUG] data-service-pool-173         com.vmware.vise.util.session.SessionUtil                          Client id is - c80c761d-4c4b-46b5-a711-f9fcd3cb6222, associated with http session id 9F09C4A58CE6CCF0CB4E1C8C38F550EE with context path /vsphere-client-endpoints

[2012-12-20 13:52:11.549] DEBUG [DEBUG] data-service-pool-173         com.vmware.vise.util.session.SessionUtil                          Client id is - c80c761d-4c4b-46b5-a711-f9fcd3cb6222, associated with http session id 9F09C4A58CE6CCF0CB4E1C8C38F550EE with context path /vsphere-client-endpoints

[2012-12-20 13:52:11.549] INFO  [INFO ] http-bio-9443-exec-8          System.out                                                        DEBUG params length is zero

[2012-12-20 13:52:11.549] DEBUG [DEBUG] data-service-pool-173         com.vmware.vise.util.session.SessionUtil                          Client id is - c80c761d-4c4b-46b5-a711-f9fcd3cb6222, associated with http session id 9F09C4A58CE6CCF0CB4E1C8C38F550EE with context path /vsphere-client-endpoints

[2012-12-20 13:52:11.549] DEBUG [DEBUG] data-service-pool-173         com.vmware.vise.util.session.SessionUtil                          Client id is - c80c761d-4c4b-46b5-a711-f9fcd3cb6222, associated with http session id 9F09C4A58CE6CCF0CB4E1C8C38F550EE with context path /vsphere-client-endpoints

[2012-

0 Kudos
laurentsd
VMware Employee
VMware Employee

OK, I looked more closely at the code and the property name used in addPropertyParameter must be an existing property in your model, i.e. you are only adding parameters for properties you defined elsewhere. I agree that the doc is confusing.  If you are using the ChassisSummaryDetails you can try adding a parameter for the "serverType" property and see that it works.

coldwater1
Contributor
Contributor

Thanks for pointing me to the right direction . I have modified the Chassis -ui code in Flex layer as follows :

ChassisSummaryDetails has property :

   [Model(property="serverType")]

   /**

* Chassis location.

*/

   public var serverType:String;

var testDBMR:DataByModelRequest = DataByModelRequest.newInstance(_contextObject,ChassisSummaryDetails,requestInfo);
var ctxObj:Object=Object(_contextObject);
testDBMR.addPropertyParameter("serverType","TEST_ALPHA_BETA_");
      // Dispatch an event to fetch _contextObject data from the server
      // along the specified model.
      dispatchEvent(testDBMR);
Looks like I'm getting the same response as earlier.
Here is the output from the logs :
[2013-01-02 17:06:49.868] DEBUG [DEBUG] http-bio-9443-exec-17         org.springframework.web.servlet.handler.SimpleUrlHandlerMapping   Mapping [/amfsecure] to HandlerExecutionChain with handler [flex.messaging.MessageBroker@1f4b652] and 1 interceptor
[2013-01-02 17:06:49.869] TRACE [TRACE] http-bio-9443-exec-17         org.springframework.web.servlet.DispatcherServlet                 Testing handler adapter [org.springframework.flex.servlet.MessageBrokerHandlerAdapter@edf5c9]
[2013-01-02 17:06:49.869] INFO  [INFO ] http-bio-9443-exec-17         org.springframework.flex.servlet.MessageBrokerHandlerAdapter      Channel endpoint secure-amf received request.
[2013-01-02 17:06:49.870] INFO  [INFO ] http-bio-9443-exec-17         System.out                                                        [BlazeDS]01/02/2013 17:06:49.870 [DEBUG] [Endpoint.AMF] Deserializing AMF/HTTP request
[2013-01-02 17:06:49.870] INFO  [INFO ] http-bio-9443-exec-17         System.out                                                        Version: 3
[2013-01-02 17:06:49.870] INFO  [INFO ] http-bio-9443-exec-17         System.out                                                          (Message #0 targetURI=null, responseURI=/18)
[2013-01-02 17:06:49.870] INFO  [INFO ] http-bio-9443-exec-17         System.out                                                            (Array #0)
[2013-01-02 17:06:49.870] INFO  [INFO ] http-bio-9443-exec-17         System.out                                                              [0] = (Typed Object #0 'flex.messaging.messages.RemotingMessage')
[2013-01-02 17:06:49.870] INFO  [INFO ] http-bio-9443-exec-17         System.out                                                                operation = "getData"
[2013-01-02 17:06:49.870] INFO  [INFO ] http-bio-9443-exec-17         System.out                                                                source = null
[2013-01-02 17:06:49.870] INFO  [INFO ] http-bio-9443-exec-17         System.out                                                                body = (Array #1)
[2013-01-02 17:06:49.870] INFO  [INFO ] http-bio-9443-exec-17         System.out                                                                  [0] = (Typed Object #2 'com.vmware.vise.data.query.RequestSpec')
[2013-01-02 17:06:49.870] INFO  [INFO ] http-bio-9443-exec-17         System.out                                                                    querySpec = (Array #3)
[2013-01-02 17:06:49.870] INFO  [INFO ] http-bio-9443-exec-17         System.out                                                                      [0] = (Typed Object #4 'com.vmware.vise.data.query.QuerySpec')
[2013-01-02 17:06:49.870] INFO  [INFO ] http-bio-9443-exec-17         System.out                                                                        name = "dam-auto-generated: ListViewMediator:dr-67"
[2013-01-02 17:06:49.870] INFO  [INFO ] http-bio-9443-exec-17         System.out                                                                        resourceSpec = (Typed Object #5 'com.vmware.vise.data.ResourceSpec')
[2013-01-02 17:06:49.870] INFO  [INFO ] http-bio-9443-exec-17         System.out                                                                          constraint = (Typed Object #6 'com.vmware.vise.data.Constraint')
[2013-01-02 17:06:49.870] INFO  [INFO ] http-bio-9443-exec-17         System.out                                                                            targetType = "samples:Chassis"
[2013-01-02 17:06:49.871] INFO  [INFO ] http-bio-9443-exec-17         System.out                                                                          propertySpecs = (Array #7)
[2013-01-02 17:06:49.871] INFO  [INFO ] http-bio-9443-exec-17         System.out                                                                            [0] = (Typed Object #8 'com.vmware.vise.data.PropertySpec')
[2013-01-02 17:06:49.871] INFO  [INFO ] http-bio-9443-exec-17         System.out                                                                              relation = null
[2013-01-02 17:06:49.871] INFO  [INFO ] http-bio-9443-exec-17         System.out                                                                              propertyNames = (Array #9)
[2013-01-02 17:06:49.871] INFO  [INFO ] http-bio-9443-exec-17         System.out                                                                                [0] = "name"
[2013-01-02 17:06:49.871] INFO  [INFO ] http-bio-9443-exec-17         System.out                                                                                [1] = "serverType"
[2013-01-02 17:06:49.871] INFO  [INFO ] http-bio-9443-exec-17         System.out                                                                              parameters = (Array #10)
[2013-01-02 17:06:49.871] INFO  [INFO ] http-bio-9443-exec-17         System.out                                                                              type = "samples:Chassis"
[2013-01-02 17:06:49.871] INFO  [INFO ] http-bio-9443-exec-17         System.out                                                                        resultSpec = (Typed Object #11 'com.vmware.vise.data.query.ResultSpec')
[2013-01-02 17:06:49.871] INFO  [INFO ] http-bio-9443-exec-17         System.out                                                                          offset = 0
[2013-01-02 17:06:49.871] INFO  [INFO ] http-bio-9443-exec-17         System.out                                                                          maxResultCount = 70
[2013-01-02 17:06:49.871] INFO  [INFO ] http-bio-9443-exec-17         System.out                                                                          order = null
[2013-01-02 17:06:49.871] INFO  [INFO ] http-bio-9443-exec-17         System.out                                                                        options = null
[2013-01-02 17:06:49.871] INFO  [INFO ] http-bio-9443-exec-17         System.out                                                                clientId = "7562B95E-3709-5280-4660-B62FBF74B075"
[2013-01-02 17:06:49.871] INFO  [INFO ] http-bio-9443-exec-17         System.out                                                                messageId = "EB720429-EF4A-57D1-13AA-FD4D73F18765"
[2013-01-02 17:06:49.871] INFO  [INFO ] http-bio-9443-exec-17         System.out                                                                timeToLive = 0
[2013-01-02 17:06:49.872] INFO  [INFO ] http-bio-9443-exec-17         System.out                                                                destination = "dataService"
[2013-01-02 17:06:49.872] INFO  [INFO ] http-bio-9443-exec-17         System.out                                                                headers = (Object #12)
[2013-01-02 17:06:49.872] INFO  [INFO ] http-bio-9443-exec-17         System.out                                                                  DSId = "7562A28B-EE08-DA58-217A-6C71B5A53BF4"
[2013-01-02 17:06:49.872] INFO  [INFO ] http-bio-9443-exec-17         System.out                                                                  DSEndpoint = "anyName"
[2013-01-02 17:06:49.872] INFO  [INFO ] http-bio-9443-exec-17         System.out                                                                  webClientSessionId = "e1e9747d-ff00-47aa-8d1f-51a5fc9ba67f"
[2013-01-02 17:06:49.872] INFO  [INFO ] http-bio-9443-exec-17         System.out                                                                timestamp = 0
[2013-01-02 17:06:49.872] INFO  [INFO ] http-bio-9443-exec-17         System.out                                                       
[2013-01-02 17:06:49.873] DEBUG [DEBUG] http-bio-9443-exec-17         com.vmware.vise.data.query.impl.DataServiceImpl                   QuerySpecs to execute:
Query[0]:

QuerySpec
   QueryName: dam-auto-generated: ListViewMediator:dr-67
   ResourceSpec
      Constraint: Constraint
         TargetType: samples:Chassis
      PropertySpec[1]
         ProviderType: samples:Chassis
         Relationship: null
         Properties[2]
            PropertyName: name
            PropertyName: serverType
   ResultSpec:
      Offset: 0
      MaxResultCount: 70
      OrderingCriteria: null
[2013-01-02 17:06:49.873] DEBUG [DEBUG] http-bio-9443-exec-17         com.vmware.vise.util.session.SessionUtil                          Client id is - e1e9747d-ff00-47aa-8d1f-51a5fc9ba67f, associated with http session id FEAB28DE52C144B5D1A0CDB37C552AD2 with context path /vsphere-client-endpoints
[2013-01-02 17:06:49.873] DEBUG [DEBUG] http-bio-9443-exec-17         com.vmware.vise.util.session.SessionUtil                          Client id is - e1e9747d-ff00-47aa-8d1f-51a5fc9ba67f, associated with http session id FEAB28DE52C144B5D1A0CDB37C552AD2 with context path /vsphere-client-endpoints
[2013-01-02 17:06:49.873] DEBUG [DEBUG] http-bio-9443-exec-17         com.vmware.vise.util.session.SessionUtil                          Client id is - e1e9747d-ff00-47aa-8d1f-51a5fc9ba67f, associated with http session id FEAB28DE52C144B5D1A0CDB37C552AD2 with context path /vsphere-client-endpoints
[2013-01-02 17:06:49.873] DEBUG [DEBUG] http-bio-9443-exec-17         com.vmware.vise.util.session.SessionUtil                          Client id is - e1e9747d-ff00-47aa-8d1f-51a5fc9ba67f, associated with http session id FEAB28DE52C144B5D1A0CDB37C552AD2 with context path /vsphere-client-endpoints
[2013-01-02 17:06:49.873] INFO  [INFO ] data-service-pool-82          System.out                                                        SRI-DEBUG-pSpec0
[2013-01-02 17:06:49.873] DEBUG [DEBUG] http-bio-9443-exec-17         com.vmware.vise.util.session.SessionUtil                          Client id is - e1e9747d-ff00-47aa-8d1f-51a5fc9ba67f, associated with http session id FEAB28DE52C144B5D1A0CDB37C552AD2 with context path /vsphere-client-endpoints
[2013-01-02 17:06:49.873] INFO  [INFO ] data-service-pool-82          System.out                                                        SRI-DEBUG params length is zero
[2013-01-02 17:06:49.874] DEBUG [DEBUG] http-bio-9443-exec-17         com.vmware.vise.util.session.SessionUtil                          Client id is - e1e9747d-ff00-47aa-8d1f-51a5fc9ba67f, associated with http session id FEAB28DE52C144B5D1A0CDB37C552AD2 with context path /vsphere-client-endpoints
[2013-01-02 17:06:49.874] INFO  [INFO ] data-service-pool-82          System.out                                                        SRI-DEBUG chassisRef-urn:vri:samples:Chassis:chassis-1
[2013-01-02 17:06:49.874] DEBUG [DEBUG] http-bio-9443-exec-17         com.vmware.vise.util.session.SessionUtil                          Client id is - e1e9747d-ff00-47aa-8d1f-
0 Kudos
coldwater1
Contributor
Contributor

Hello Laurentsd,

Could you please confirm if this a bug in VMware API ?

If this is a bug , do you think this would be resolved in vSphere Web Client 6.0 .As a VMware Partner we just got Early access to the beta drop. Please let us know .

Thanks

0 Kudos
laurentsd
VMware Employee
VMware Employee

I don't see any bug on my end because I have the sample working the way I described it earlier.

0 Kudos
coldwater1
Contributor
Contributor

Hello Laurent,

So I tried the following , but have no luck passing a parameter for a propertyName in ParameterSpec. Coud you please confirm that this is correct mechansim for sending down a parameter to a propertyName or a bug in the API.

I have NetworkSummaryDetails -Data model define in the flex layer

public class NetworkSummaryDetails extends DataObject {
   // Maps a model property to the class field.
   // Note: Property and field names don't need to match.
   // Also, properties within your own type don't require a namespace.
   [Model(property="name")]
   public var name:String;
   [Model(property="vmkernel")]
   public var vmkernel:String;
  
   [Model(property="testprop")]
  public var testprop:String; 
  
}
Here is my requestData :
   private function requestData():void {
      // Add code to initialize your UI data, for instance dispatch a data request event
      // to fetch data from the server.
  // Default data request option allowing implicit updates of the view
  var requestInfo:DataRequestInfo =
  new DataRequestInfo(DataUpdateSpec.newImplicitInstance());
  var datareq: DataByModelRequest = DataByModelRequest.newInstance( _contextObject,
  NetworkSummaryDetails,
  requestInfo);
  var str:String = "MESSAGE FROM OUTER SPACE";       
   datareq.addPropertyParameter("testprop",str);
 
  // Dispatch an event to fetch _contextObject data from the server
  // along the specified model.
  dispatchEvent(datareq);
   }
In the Service Layer I'm inspecting the query spec , but I cant find the PropertyParameter that I have set .
In Service Layer code :
   private ResultSet processQuery(QuerySpec qs) {
      ResultSet rs = new ResultSet();
      _logger.debug("DEBUG-processQuery -Enter");
      if (!validateQuerySpec(qs)) {
         Exception ex = new IllegalArgumentException(
               "NetworkInfoDataAdapter.invalidQuerySpec");
         rs.error = ex;
         return rs;
      }
     
      printQuerySpec(qs.resourceSpec.propertySpecs);
      initializeObjectStore();
      // Process the constraint.
      List<ResultItem> items = processConstraint(
            qs.resourceSpec.constraint,
            qs.resourceSpec.propertySpecs);
      // Prepare the ResultSet to return.
      // Note that totalMatchedObjectCount is only relevant when the query is
      // for discovering new objects.
      rs.totalMatchedObjectCount = (items != null) ? items.size() : 0;
      rs.items = adjustResultItems(items, qs.resultSpec);
      rs.queryName = qs.name;
      printResultSet(rs);
      return rs;
   }
   private void printQuerySpec(PropertySpec[] pSpecs) {
  
   if(pSpecs != null ) {            
   for(PropertySpec pSpec : pSpecs) {
   _logger.debug("SRI_DEBUG- printQuerySpec - PropertySpec-relation: " + pSpec.relation);
   _logger.debug("SRI_DEBUG- printQuerySpec - PropertySpec-type: " + pSpec.type);
   _logger.debug("SRI_DEBUG- printQuerySpec - Iterating through PropertySpec-propertyNames -length: " + pSpec.propertyNames.length);
   for(String pname : pSpec.propertyNames) {
   _logger.debug("SRI_DEBUG- printQuerySpec - propertySpec-propertyName" + pname);  
  
   }
   if(pSpec.parameters != null )
   {
   _logger.debug("SRI_DEBUG- printQuerySpec - Iterating through PropertySpec-parameters.length : " + pSpec.parameters.length);
   for(ParameterSpec param : pSpec.parameters) {
   _logger.debug("SRI_DEBUG- printQuerySpec - pSpec.paramter[i].propertyName" + param.propertyName);
   _logger.debug("SRI_DEBUG- printQuerySpec - pSpec.paramter[i].parameter is an instance of string" + (param.parameter instanceof String));
   _logger.debug("SRI_DEBUG- printQuerySpec - pSpec.paramter[i].parameter " + param.parameter );
   _logger.debug("SRI_DEBUG- printQuerySpec - pSpec.paramter[i].parameter.toString()" + param.parameter.toString() );
}                      
   } else  {
  
   _logger.debug("SRI_DEBUG- printQuerySpec - PropertySpec-parameters is null cannot get properties from it   : " );
   }
  
   }            
   }
  
   }
And logs from the above function are as follows :
[2013-01-10 11:02:13.457] DEBUG [DEBUG] data-service-pool-108         com.demo.dell.relationDemoservice.RelationDemoserviceImpl         SRI_DEBUG- printQuerySpec - PropertySpec-relation: null
associated with http session id 396E2A00991CB15C370398C1729223DA with context path /vsphere-client-endpoints
[2013-01-10 11:02:13.457] DEBUG [DEBUG] data-service-pool-108         com.demo.dell.relationDemoservice.RelationDemoserviceImpl         SRI_DEBUG- printQuerySpec - PropertySpec-type: null
6E2A00991CB15C370398C1729223DA with context path /vsphere-client-endpoints
[2013-01-10 11:02:13.457] DEBUG [DEBUG] data-service-pool-108         com.demo.dell.relationDemoservice.RelationDemoserviceImpl         SRI_DEBUG- printQuerySpec - Iterating through PropertySpec-propertyNames -length: 1
[2013-01-10 11:02:13.457] DEBUG [DEBUG] data-service-pool-108         com.demo.dell.relationDemoservice.RelationDemoserviceImpl         SRI_DEBUG- printQuerySpec - propertySpec-propertyNamename
[2013-01-10 11:02:13.457] DEBUG [DEBUG] data-service-pool-105         com.vmware.vise.util.session.SessionUtil                          Client id is - 380ab2e2-1efa-4704-8d61-8238e23dcdae, associated with http session id 396E2A00991CB15C370398C1729223DA with context path /vsphere-client-endpoints
[2013-01-10 11:02:13.458] DEBUG [DEBUG] data-service-pool-108         com.demo.dell.relationDemoservice.RelationDemoserviceImpl         SRI_DEBUG- printQuerySpec - PropertySpec-parameters is null cannot get properties from it   :

0 Kudos