RE: Indication with OperationContext Object failed (in Pegasus 2.9.1)

Venkateswara R Puvvada <[email protected]>
Newsgroups gmane.network.open-pegasus.general
Message-ID <OFB67866FC.8BB59A70-ON6525772D.002B2B3A-6525772D.002D1DE7@in.ibm.com>
Swapna,

CIMServer passes the subscriptionName to the provider when 
createSubscription() function of the provider is called. As Roger 
suggested, you can save the subscriptionName instead of rebuilding the 
subscriptionName on your own. Saved subscriptionName can be used to create 
the SubscriptionInstanceNamesContainer.

One advantage of using the CIMServer provided subscriptionName is that, 
provider don't have to care whether the subscriptionName was fully 
populated or not by client. For example, client may omit the namespace in 
the filter and handler names if the subscription being created is in the 
same namespace of the filter and handler. If provider sets namespace in 
the filter and handler names while creating the subscription name and 
client didn't, subscription names do not match which causes the indication 
not to be sent.

Venkat




"Swapna Priya Bhaskara" <[email protected]> 
24/05/2010 13:07

To
"Kumpf, Roger" <[email protected]>, Venkateswara R 
Puvvada/India/IBM@IBMIN
cc
"Manjunath Marlabeeti" <[email protected]>, 
<[email protected]>
Subject
RE: Indication with OperationContext Object failed  (in Pegasus 2.9.1)






Hi Roger,
 
We are not explicitly setting any value for subscriptionName parameter in 
createSubscription(). I guess the CIM Server’s default value is taken.
Any clue, how to verify this?
 
Thanks,
Swapna.
 
 
From: Kumpf, Roger [mailto:[email protected]] 
Sent: Friday, May 21, 2010 8:32 PM
To: Venkateswara R Puvvada; Swapna Priya Bhaskara
Cc: Manjunath Marlabeeti; [email protected]
Subject: RE: Indication with OperationContext Object failed (in Pegasus 
2.9.1)
 
The provider is given the subscription name in the createSubscription 
interface (subscriptionName parameter).  Use the one the CIM Server 
provides.
 
-Roger
 
From: Venkateswara R Puvvada [mailto:[email protected]] 
Sent: Friday, May 21, 2010 6:05 AM
To: Swapna Priya Bhaskara
Cc: Manjunath Marlabeeti; [email protected]
Subject: RE: Indication with OperationContext Object failed (in Pegasus 
2.9.1)
 

Swapna, 

I can't tell the problem with the given information. You may try 
enumerating the instance names of filter, handler and subscription and 
verify if the identical to the provider created instance names. 

Venkat


"Swapna Priya Bhaskara" <[email protected]> 
21/05/2010 17:48 


To
Venkateswara R Puvvada/India/IBM@IBMIN, "Manjunath Marlabeeti" 
<[email protected]> 
cc
<[email protected]> 
Subject
RE: Indication with OperationContext Object failed  (in Pegasus 2.9.1)
 








Hi Venkat, 
  
I have tried removing namespace from filter and handler construction and 
tried generating the events. But, the events are still not consumed by 
listener. 
If we send without context (  ptrObjHandler->deliver (objBackInd);  ) the 
events are being consumed by listener. 
  
Thanks, 
Swapna. 
  
From: Venkateswara R Puvvada [mailto:[email protected]] 
Sent: Friday, May 21, 2010 5:17 PM
To: Manjunath Marlabeeti
Cc: [email protected]
Subject: RE: Indication with OperationContext Object failed (in Pegasus 
2.9.1) 
  

Manjunath, 

When subscription is created, Pegasus normalizes the subscription name by 
removing the namespace from the handler and filter names if they are 
created in the same namespace of the subscription being created. It seems 
Pegasus is comparing the normalized subscription name with provider set 
subscription name. 

Remove Namespace from filter and handler construction (root/PG_Interop in 
the example give below) from your provider code and verify if listener can 
receive the indications. If that works, i will file a bug against Pegasus. 


Venkat

"Manjunath Marlabeeti" <[email protected]> 
21/05/2010 12:36 
 


To
Venkateswara R Puvvada/India/IBM@IBMIN 
cc
<[email protected]> 
Subject
RE: Indication with OperationContext Object failed  (in Pegasus 2.9.1)

 
 









Hi Venkat, 
 
Thanks for the reply. 
Based on your suggestion I checked handler and filter values from 
Genrateindication and which are registerd with the cimserver. Below are 
the values. 
 
(I have changed hardcoded the IP from 1.1.1.1 to 192.168.111.6) 
 
Below 1 and 2 are the values of printf in Generateindication function 
after Handler and filter constructions.( printf("\nHandlerString 
%s\n",temp.c_str());) 
 
1) filterString   
root/PG_InterOp:CIM_IndicationFilter.CreationClassName="CIM_IndicationFilter",Name="Filter20192.168.111.61192.168.111.6|1|1@",SystemCreationClassName= 

"CIM_ComputerSystem",SystemName="CR-IN-MANJU" 
 
2) HandlerString 
root/PG_InterOp:CIM_IndicationHandlerCIMXML.CreationClassName="CIM_IndicationHandlerCIMXML",Name="Handler20192.168.111.61192.168.111.6|1|1@",Syst 

emCreationClassName="CIM_ComputerSystem",SystemName="CR-IN-MANJU" 
 
3) after execution of Java client 
values from command : cimsub -l s 
NAMESPACE      root/PG_InterOp   
FILTER     root/PG_InterOp:Filter20192.168.111.61192.168.111.6|1|1@   
HANDLER  
root/PG_InterOp:CIM_IndicationHandlerCIMXML.Handler20192.168.111.61192.168.111.6|1|1@ 
  
STATE    Enabled 
 
with the above values I could not find the exact problem because 
corresponding handler and filter values are same. 
please could you suggest me a solution based on the above values. 
 
Thanks, 
Manjunath.M 
 
From: Venkateswara R Puvvada [mailto:[email protected]] 
Sent: Friday, May 21, 2010 11:54 AM
To: Manjunath Marlabeeti
Cc: [email protected]
Subject: Re: Indication with OperationContext Object failed (in Pegasus 
2.9.1) 
 

Manjunath, 

If the indication provider sets SubscriptionInstanceNamesContainer in the 
operation context, the subset of subscriptions  specified by the 
indication provider should be part of the actual matched subscriptions for 
the indication. Any subscription included by the provider but not 
containing in the matched subscriptions list is ignored. In your case, the 
subscription name you have specified in the provider does not seem to be 
in the actual subscriptions matched for the indication. 

Venkat 

"Manjunath Marlabeeti" <[email protected]> 
19/05/2010 18:07 
 
 


To
<[email protected]> 
cc

Subject
Indication with OperationContext Object failed  (in Pegasus 2.9.1)


 
 
 









Hi, 

I have written a simple indication provider it sends the indications to 
java client. 
While execution I observed one thing that in the below function if I 
deliver the indication without context object then the indications are 
received by the java client. 
If I deliver with OperationContext object then indications are not 
received by the Java client. But my requirement is indications needs to 
send with OperationContext object. 
Here I am copying the function 

Here is the function call 
GenerateIndication(_handler,CIMName("CRM_Indication"
),objBackInd,strObject,"1.1.1.1","1","1.1.1.1|1|1@"); 
//objBackInd is an indication object 

void GenerateIndication(IndicationResponseHandler *ptrObjHandler, const 
CIMName objMethodName,CIMInstance objBackInd,string &strObject,string 
IP,string ID,string operationID) 
{ 
    char buffer[32]; 
    sprintf(buffer, "%d", G_ui32NextUid++); 
    objBackInd.addProperty(CIMProperty ("IndicationIdentifier"
,String(buffer))); 
    char stringTime[MAX_CHARS]; 
    time_t currentTime=time(NULL); 
    sprintf(stringTime,"%ld",currentTime); 
    AddProperty("IndicationTime",stringTime,CMC_STRING,strObject); 
    CIMIndication cimIndication (objBackInd); 
    String filterString; 
    string temp; 

    Array <CIMObjectPath> subscriptionInstanceNames; 
    Array <CIMKeyBinding> subscriptionKeyBindings; 
    string filterConstruction=
"root/PG_InterOp:CIM_IndicationFilter.CreationClassName=\"CIM_IndicationFilter\",Name=\"Filter20"
; 
    filterConstruction=filterConstruction+IP+ID+operationID+
"\",SystemCreationClassName=\""; 
    filterString.append(filterConstruction.c_str()); 
    filterString.append (System::getSystemCreationClassName ()); 
    filterString.append ("\",SystemName=\""); 
    filterString.append (System::getFullyQualifiedHostName ()); 
    filterString.append ("\""); 
    subscriptionKeyBindings.append (CIMKeyBinding ("Filter",filterString, 
CIMKeyBinding::REFERENCE)); 
    temp = filterString.getCString(); 
    printf("\nfilterString  %s\n",temp.c_str()); 

    string HandlerConstruction=
"root/PG_InterOp:CIM_IndicationHandlerCIMXML.CreationClassName=\"CIM_IndicationHandlerCIMXML\",Name=\"Handler20"
; 

    HandlerConstruction     =     HandlerConstruction     + IP 
+ID+operationID+"\",SystemCreationClassName=\""; 
                String handlerString; 
                handlerString.append(HandlerConstruction.c_str()); 
                handlerString.append (System::getSystemCreationClassName 
()); 
                handlerString.append ("\",SystemName=\""); 
                handlerString.append (System::getFullyQualifiedHostName 
()); 
                handlerString.append ("\""); 
                subscriptionKeyBindings.append (CIMKeyBinding ("Handler", 
handlerString, CIMKeyBinding::REFERENCE)); 
                temp=handlerString.getCString(); 
           printf("\nHandlerString  %s\n",temp.c_str()); 
              CIMObjectPath subscriptionPath ("", 
                    CIMNamespaceName ("root/PG_InterOp"), 
                    CIMName ("CIM_IndicationSubscription"), 
                    subscriptionKeyBindings); 
                            subscriptionInstanceNames.append 
(subscriptionPath); 

          OperationContext context; 
                context.insert (SubscriptionInstanceNamesContainer 
                    (subscriptionInstanceNames)); 
                    objBackInd.addProperty 
                                        (CIMProperty ("IpAddress"
,String(IP.c_str()))); 
                                        objBackInd.addProperty 
                                        (CIMProperty ("OperationId"
,String(operationID.c_str()))); 
                                        objBackInd.addProperty 
                                        (CIMProperty ("Uid"
,String(ID.c_str()))); 
//with Context object indications are not getting received by JAVA clien 
without Context java client is reciving indication 

    //ptrObjHandler->deliver (objBackInd);     
    ptrObjHandler->deliver (context, objBackInd); 
} 

Please can anyone correct me where exactly I am doing wrong. 

Thanks, 
Manjunath.M
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.