realtimenetprots/sipfw/ClientResolver/Resolver/src/CSipRequestStrategy.cpp
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Name          : CSipRequestStrategy.cpp
       
    15 // Part of       : SIP Client Resolver
       
    16 // Version       : 1.0
       
    17 //
       
    18 
       
    19 
       
    20 
       
    21 #include "CSipRequestStrategy.h"
       
    22 #include "MSipClients.h"
       
    23 #include "siprequest.h"
       
    24 #include "CSIPClientResolver2.h"
       
    25 #include "SIPCRLogs.h"
       
    26 
       
    27 // ----------------------------------------------------------------------------
       
    28 // CSipRequestStrategy::NewL
       
    29 // ----------------------------------------------------------------------------
       
    30 //
       
    31 CSipRequestStrategy* CSipRequestStrategy::NewL(
       
    32     MSipClients& aSipClients,
       
    33     CSipHeaderStrategyBase* aNextStrategy,
       
    34     CSipHeaderStrategyBase* aNextStrategy2)
       
    35 	{
       
    36 	CSipRequestStrategy* self = 
       
    37 		CSipRequestStrategy::NewLC(aSipClients,aNextStrategy,
       
    38     								aNextStrategy2);
       
    39 	CleanupStack::Pop(self);
       
    40 	return self;
       
    41 	}
       
    42 
       
    43 // ----------------------------------------------------------------------------
       
    44 // CSipRequestStrategy::NewLC
       
    45 // ----------------------------------------------------------------------------
       
    46 //
       
    47 CSipRequestStrategy* CSipRequestStrategy::NewLC(
       
    48     MSipClients& aSipClients,
       
    49     CSipHeaderStrategyBase* aNextStrategy,
       
    50     CSipHeaderStrategyBase* aNextStrategy2)
       
    51 	{
       
    52 	CSipRequestStrategy* self = 
       
    53 		new(ELeave)CSipRequestStrategy(aSipClients,aNextStrategy,
       
    54     									aNextStrategy2);
       
    55 	CleanupStack::PushL(self);
       
    56 	return self;
       
    57 	}
       
    58 
       
    59 // ----------------------------------------------------------------------------
       
    60 // CSipRequestStrategy::CSipRequestStrategy
       
    61 // ----------------------------------------------------------------------------
       
    62 //
       
    63 CSipRequestStrategy::CSipRequestStrategy(
       
    64     MSipClients& aSipClients,
       
    65     CSipHeaderStrategyBase* aNextStrategy,
       
    66     CSipHeaderStrategyBase* aNextStrategy2) 
       
    67  : CSipHeaderStrategyBase(aSipClients,aNextStrategy,
       
    68     						aNextStrategy2)
       
    69 	{
       
    70 	}
       
    71 
       
    72 // ----------------------------------------------------------------------------
       
    73 // CSipRequestStrategy::~CSipRequestStrategy
       
    74 // ----------------------------------------------------------------------------
       
    75 //
       
    76 CSipRequestStrategy::~CSipRequestStrategy()
       
    77 	{
       
    78 	}
       
    79 
       
    80 // ----------------------------------------------------------------------------
       
    81 // CSipRequestStrategy::ApplyL
       
    82 // ----------------------------------------------------------------------------
       
    83 //
       
    84 CSIPResponse* 
       
    85 	CSipRequestStrategy::ApplyL( CSIPRequest& aRequest, 
       
    86     							 RArray<TUid>& aUids,
       
    87     							 TBool& aContinueSearch,
       
    88     							 CSIPClientResolver2& aClientResolver2 )
       
    89 	{
       
    90 	SIP_CR_LOG("CSipRequestStrategy::ApplyL")
       
    91     return MatchClients2L( aRequest,aUids,aContinueSearch,aClientResolver2 );
       
    92 	}
       
    93 	
       
    94 // ----------------------------------------------------------------------------
       
    95 // CSipRequestStrategy::MoreThanOneMatchL
       
    96 // ----------------------------------------------------------------------------
       
    97 //
       
    98 CSIPResponse* CSipRequestStrategy::MoreThanOneMatchL( CSIPRequest& /*aRequest*/, 
       
    99     								RArray<TUid>& /*aUids*/,
       
   100     								TBool& /*aContinueSearch*/,
       
   101     								CSIPClientResolver2& /*aClientResolver2*/ )
       
   102 	{
       
   103 	return NULL;
       
   104 	}	
       
   105 
       
   106 // ----------------------------------------------------------------------------
       
   107 // CSipRequestStrategy::MatchResolvedClientsL
       
   108 // ----------------------------------------------------------------------------
       
   109 //
       
   110 TBool CSipRequestStrategy::MatchResolvedClientL( CSIPResolvedClient2& aClient,
       
   111 										CSIPRequest& aRequest,
       
   112     									TUid& aClientUid,
       
   113     									const CUri8& aUri8 )
       
   114 	{
       
   115 	SIP_CR_LOG("CSipRequestStrategy::MatchResolvedClientL")
       
   116 	return aClient.MatchRequestL( aRequest.Method(),
       
   117           						  aUri8,
       
   118           						  aRequest.AllHeadersL(),
       
   119           						  aRequest.Content(), 
       
   120           						  ContentType(aRequest), 
       
   121           						  aClientUid );
       
   122 	}
       
   123