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