realtimenetprots/sipfw/SIP/ServerResolver/inc/CSIPHostResolver.h
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 /*
       
     2 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 * Name          : CSIPHostResolver.h
       
    16 * Part of       : ServerResolver
       
    17 * Version       : SIP/4.0 
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 /**
       
    25  @internalComponent
       
    26 */
       
    27 #ifndef CSIPHOSTRESOLVER_H
       
    28 #define CSIPHOSTRESOLVER_H
       
    29 
       
    30 //INCLUDES
       
    31 #include <e32base.h>
       
    32 #include <in_sock.h>
       
    33 #include "MSIPHostResolver.h"
       
    34 #include "_sipcodecdefs.h"
       
    35 
       
    36 // FORWARD DECLARATIONS
       
    37 class CRequestQueue;
       
    38 class CServerQuery;
       
    39 class MSIPServerResolverObserver;
       
    40 
       
    41 // CLASS DEFINITION
       
    42 /**
       
    43  * CSIPHostResolver implements a
       
    44  */
       
    45 class CSIPHostResolver : public CActive, public MSIPHostResolver
       
    46 	{
       
    47 	public:// Constructors and destructor
       
    48 
       
    49 		/**
       
    50 	 	* Creates a new CSIPHostResolver instance
       
    51 	 	* @param aServer for server session
       
    52 	 	* @param aConnection for connection
       
    53 	 	* @returns a new instance of CSIPHostResolver
       
    54 	 	*/
       
    55 		static CSIPHostResolver* NewL( RSocketServ& aServer, 
       
    56                                    	   RConnection& aConnection );
       
    57 	    /**
       
    58 	 	* Creates a new CSIPHostResolver instance 
       
    59 	 	* and pushes it to CleanupStack
       
    60 	 	* @param aServer for server session
       
    61 	 	* @param aConnection for connection
       
    62 	 	* @returns a new instance of CSIPHostResolver
       
    63 	 	*/
       
    64 		static CSIPHostResolver* NewLC( RSocketServ& aServer, 
       
    65                                     	RConnection& aConnection );
       
    66                                     	
       
    67 		/**
       
    68 	 	* Destructor.
       
    69 	 	*/
       
    70 		~CSIPHostResolver();
       
    71 		
       
    72 	public:// From MSIPHostResolver
       
    73 	
       
    74 		RHostResolver& Resolver();
       
    75 		
       
    76 		TRequestStatus& RequestStatus();
       
    77 		
       
    78 		void SetIPListFailed( TBool aFailed );
       
    79 
       
    80 	public:
       
    81 	
       
    82 		void GetByQueryL( CServerQuery* aQuery );	
       
    83 
       
    84 		void CancelGetByURI( MSIPServerResolverObserver* aObserver );
       
    85 
       
    86 		void RunL(); 
       
    87 
       
    88 		TInt RunError( TInt aError );
       
    89 
       
    90 		void DoCancel();
       
    91 
       
    92 	private:// Constructors and destructor
       
    93 
       
    94 		void ConstructL( RSocketServ& aServer, RConnection& aConnection );
       
    95 
       
    96 		CSIPHostResolver();
       
    97 		
       
    98 	private:
       
    99 
       
   100 		void ResolveNext();
       
   101 
       
   102 	private:// Data
       
   103 		
       
   104 		CRequestQueue* iRequestQueue;
       
   105 
       
   106 		CServerQuery* iQuery;
       
   107 
       
   108 		RHostResolver iResolver;
       
   109 		
       
   110 		TBool iObserverCancel;
       
   111 		
       
   112 		TBool iFailed;
       
   113 		
       
   114 	private: // For testing purposes
       
   115 
       
   116 		UNIT_TEST(CSIPHostResolverTest)
       
   117 		UNIT_TEST(CSIPServerResolverTest)
       
   118 	};
       
   119 
       
   120 #endif // end of CSIPHOSTRESOLVER_H
       
   121 
       
   122 // End of File