locationtriggering/ltserver/ltserverlogic/src/lbtserverlogic.cpp
branchRCL_3
changeset 44 2b4ea9893b66
parent 13 19bff11d6c18
child 45 6b6920c56e2f
equal deleted inserted replaced
42:02ba3f1733c6 44:2b4ea9893b66
   226 						CLbtCreateTriggerAOOperation::NewL(*this, 
   226 						CLbtCreateTriggerAOOperation::NewL(*this, 
   227 														   aMessage, 
   227 														   aMessage, 
   228 														   *iContainer, 
   228 														   *iContainer, 
   229 														   aType,
   229 														   aType,
   230 														   *iSettingsManager);
   230 														   *iSettingsManager);
   231 			iAOOArray.Append(operation);
   231 			CleanupStack::PushL( operation );
       
   232 			iAOOArray.AppendL(operation);
       
   233 			CleanupStack::Pop( operation );
   232 			operation->StartOperationL();
   234 			operation->StartOperationL();
   233 			break;
   235 			break;
   234 			}
   236 			}
   235 		case ELbtGetTriggers:
   237 		case ELbtGetTriggers:
   236 		case ELbtGetFiredTriggers:
   238 		case ELbtGetFiredTriggers:
   276 				LbtGlobal::RequestComplete(aMessage, retValue);				
   278 				LbtGlobal::RequestComplete(aMessage, retValue);				
   277 				break;
   279 				break;
   278 				}
   280 				}
   279 			CLbtListAOOperation* operation = 
   281 			CLbtListAOOperation* operation = 
   280 						CLbtListAOOperation::NewL(*this, aMessage, *iContainer, aType);
   282 						CLbtListAOOperation::NewL(*this, aMessage, *iContainer, aType);
   281 		    iAOOArray.Append(operation);
   283 			CleanupStack::PushL( operation );
       
   284 		    iAOOArray.AppendL(operation);
       
   285 		    CleanupStack::Pop( operation );
   282 			operation->StartOperationL();
   286 			operation->StartOperationL();
   283 			break;
   287 			break;
   284 			}
   288 			}
   285 		case ELbtUpdateTrigger:
   289 		case ELbtUpdateTrigger:
   286 		case ELbtSetTriggerState:
   290 		case ELbtSetTriggerState:
   297 				break;
   301 				break;
   298 				}
   302 				}
   299 			
   303 			
   300 			CLbtTriggerModifyAOOperation* operation = 
   304 			CLbtTriggerModifyAOOperation* operation = 
   301 						CLbtTriggerModifyAOOperation::NewL(*this, aMessage, *iContainer, aType,*iSettingsManager);
   305 						CLbtTriggerModifyAOOperation::NewL(*this, aMessage, *iContainer, aType,*iSettingsManager);
   302 		    iAOOArray.Append(operation);
   306 			CleanupStack::PushL( operation );
       
   307 		    iAOOArray.AppendL(operation);
       
   308 		    CleanupStack::Pop( operation );
   303 			operation->StartOperationL();
   309 			operation->StartOperationL();
   304 			break;
   310 			break;
   305 			}
   311 			}
   306 		case ELbtGetTriggeringSysSetting:
   312 		case ELbtGetTriggeringSysSetting:
   307 			{
   313 			{
   676 							CLbtContainerUpdateFilter::NewL(filterByAttribute, filter);
   682 							CLbtContainerUpdateFilter::NewL(filterByAttribute, filter);
   677 	CleanupStack::PushL(containerFilter);
   683 	CleanupStack::PushL(containerFilter);
   678 	
   684 	
   679 	CLbtDeleteSessionTriggers* deleteSessionTriggers=
   685 	CLbtDeleteSessionTriggers* deleteSessionTriggers=
   680 							CLbtDeleteSessionTriggers::NewL(*this,*iContainer,*iNotificationMap);
   686 							CLbtDeleteSessionTriggers::NewL(*this,*iContainer,*iNotificationMap);
   681 	iDeleteSessionTriggersArray.Append(deleteSessionTriggers);
   687 	CleanupStack::PushL( deleteSessionTriggers );
       
   688 	iDeleteSessionTriggersArray.AppendL(deleteSessionTriggers);
       
   689 	CleanupStack::Pop( deleteSessionTriggers );
   682 							
   690 							
   683 	deleteSessionTriggers->DeleteSessionTriggers(containerFilter);
   691 	deleteSessionTriggers->DeleteSessionTriggers(containerFilter);
   684 	iNotificationMap->RemoveAllClientMessages(aSecureId);
   692 	iNotificationMap->RemoveAllClientMessages(aSecureId);
   685 	CleanupStack::Pop(containerFilter);
   693 	CleanupStack::Pop(containerFilter);
   686 	CleanupStack::Pop(filterByAttribute);
   694 	CleanupStack::Pop(filterByAttribute);
  1106 	    {
  1114 	    {
  1107 	    TSecureId secureId(managerUidArray[i]);
  1115 	    TSecureId secureId(managerUidArray[i]);
  1108     	// Retrieve all client session notification messages.
  1116     	// Retrieve all client session notification messages.
  1109     	while(!iNotificationMap->Retreive(message, secureId, aServiceId) )
  1117     	while(!iNotificationMap->Retreive(message, secureId, aServiceId) )
  1110     		{
  1118     		{
  1111     		array.Append(message);
  1119     		array.AppendL(message);
  1112     		}
  1120     		}
  1113 		}
  1121 		}
  1114 
  1122 
  1115     // Retrieve all management notification messages.
  1123     // Retrieve all management notification messages.
  1116 	while(!iNotificationMap->Retreive(message, 
  1124 	while(!iNotificationMap->Retreive(message, 
  1117 	                                  aServiceId,
  1125 	                                  aServiceId,
  1118 	                                  CLbtServerLogicBase::TLbtManagementLibrary))
  1126 	                                  CLbtServerLogicBase::TLbtManagementLibrary))
  1119 		{
  1127 		{
  1120 		array.Append(message);
  1128 		array.AppendL(message);
  1121 		}
  1129 		}
  1122 
  1130 
  1123 	if(array.Count() == 0)
  1131 	if(array.Count() == 0)
  1124 		{
  1132 		{
  1125 		array.Close();
  1133 		array.Close();
  1234     	    // So reply back on the notification now.
  1242     	    // So reply back on the notification now.
  1235         	// retrieve all notification messages of this client.
  1243         	// retrieve all notification messages of this client.
  1236         	
  1244         	
  1237         	while( !iNotificationMap->Retreive(message, sid, aServiceId) )
  1245         	while( !iNotificationMap->Retreive(message, sid, aServiceId) )
  1238         		{
  1246         		{
  1239         		array.Append(message);
  1247         		array.AppendL(message);
  1240         		}
  1248         		}
  1241 
  1249 
  1242             SetNotificationEventType(aOperation, event);
  1250             SetNotificationEventType(aOperation, event);
  1243             
  1251             
  1244             if ( multipleOps )
  1252             if ( multipleOps )
  1499 	if((aSettingsMask & ETriggeringMechanismState))
  1507 	if((aSettingsMask & ETriggeringMechanismState))
  1500 		{
  1508 		{
  1501 		while( !iNotificationMap->Retreive(message,ELbtNotifyTriggeringSysSettingChange,
  1509 		while( !iNotificationMap->Retreive(message,ELbtNotifyTriggeringSysSettingChange,
  1502 										CLbtServerLogicBase::TLbtClientLibrary))
  1510 										CLbtServerLogicBase::TLbtClientLibrary))
  1503 			{
  1511 			{
  1504 			messageArray.Append( message );
  1512 			TInt error = messageArray.Append( message );
       
  1513 			if( error != KErrNone )
       
  1514 			    {
       
  1515                 LOG1("Failed to append message to the array:%d",error);
       
  1516                 break;
       
  1517 			    }
  1505 			}
  1518 			}
  1506 		if(messageArray.Count())
  1519 		if(messageArray.Count())
  1507 			{
  1520 			{
  1508 			TLbtTriggeringSystemSettings triggeringSystemSettings;
  1521 			TLbtTriggeringSystemSettings triggeringSystemSettings;
  1509 			if(iSettingsManager->GetTriggeringMechanismState()==1)	
  1522 			if(iSettingsManager->GetTriggeringMechanismState()==1)	
  1569 	RMessage2 message;
  1582 	RMessage2 message;
  1570 	
  1583 	
  1571 	while( !iNotificationMap->Retreive(message,ELbtNotifyTriggeringSysStatusChange,
  1584 	while( !iNotificationMap->Retreive(message,ELbtNotifyTriggeringSysStatusChange,
  1572 										CLbtServerLogicBase::TLbtClientLibrary))
  1585 										CLbtServerLogicBase::TLbtClientLibrary))
  1573 			{
  1586 			{
  1574 			messageArray.Append( message );
  1587 			TInt error = messageArray.Append( message );
       
  1588 			if( error != KErrNone )
       
  1589 			    {
       
  1590                 LOG1("Failed to append to the array:%d",error);
       
  1591                 break;
       
  1592 			    }
  1575 			}
  1593 			}
  1576 	if( messageArray.Count() )		
  1594 	if( messageArray.Count() )		
  1577 	    {
  1595 	    {
  1578 	    for(TInt i=messageArray.Count();i>0;i--)
  1596 	    for(TInt i=messageArray.Count();i>0;i--)
  1579 			{
  1597 			{
  1583 	    }
  1601 	    }
  1584 	
  1602 	
  1585 	while( !iNotificationMap->Retreive(message,ELbtNotifyTriggeringSysStatusChange,
  1603 	while( !iNotificationMap->Retreive(message,ELbtNotifyTriggeringSysStatusChange,
  1586 										CLbtServerLogicBase::TLbtManagementLibrary))
  1604 										CLbtServerLogicBase::TLbtManagementLibrary))
  1587 			{
  1605 			{
  1588 			messageArray.Append( message );
  1606 			TInt error = messageArray.Append( message );
       
  1607 			if( error != KErrNone )
       
  1608                 {
       
  1609                 LOG1("Failed to append to the array:%d",error);
       
  1610                 break;
       
  1611                 }
  1589 			}    
  1612 			}    
  1590     if( messageArray.Count() )
  1613     if( messageArray.Count() )
  1591         {
  1614         {
  1592         for(TInt i=messageArray.Count();i>0;i--)
  1615         for(TInt i=messageArray.Count();i>0;i--)
  1593 			{
  1616 			{