realtimenetprots/sipfw/SIP/Refreshes/inc/MSipRefreshMgr.h
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 /*
       
     2 * Copyright (c) 2006-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          : MSipRefreshMgr.h
       
    16 * Part of       : SIPRefreshes
       
    17 * Version       : SIP/5.0 
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 /**
       
    25  @internalComponent
       
    26 */
       
    27 
       
    28 
       
    29 #ifndef MSIPREFRESHMGR_H
       
    30 #define MSIPREFRESHMGR_H
       
    31 
       
    32 #include "SipStackServerDefs.h"
       
    33 
       
    34 class TSIPTransportParams;
       
    35 class MRefreshOwner;
       
    36 class MSIPSecUser;
       
    37 class CSIPRequest;
       
    38 class CURIContainer;
       
    39 class CSIPHeaderBase;
       
    40 class CSIPRouteHeader;
       
    41 class MTransactionHeaders;
       
    42 
       
    43 
       
    44 /**
       
    45  * @brief An interface for adding, updating and
       
    46  * removing refresh requests.
       
    47  *
       
    48  * @see MRefreshOwner
       
    49  */
       
    50 
       
    51 class MSipRefreshMgr
       
    52     {
       
    53 public:
       
    54 
       
    55     virtual ~MSipRefreshMgr () { }
       
    56 
       
    57 	/**
       
    58 	 * Add a refresh for a given CSIPRequest.
       
    59 	 *
       
    60 	 * @pre aRequest!=0
       
    61      * @pre aOwner!=0
       
    62      *
       
    63 	 * @param aTransactionId; an empty transaction id that will be filled by TU
       
    64 	 *
       
    65 	 * @param aRefreshId; on return contains the id of the created refresh
       
    66 	 *
       
    67 	 * @param aRegistrationId a registration id with which a possible outbound
       
    68 	 *        proxy is used in TU.
       
    69      *
       
    70 	 * @param aRequest SIP request to be refreshed. The ownership is 
       
    71 	 *        transferred if parameter aDeleteRequest is ETrue, otherwise not.
       
    72      *
       
    73      * @param aOwner a call back implemented by the caller
       
    74      *
       
    75      * @param aSIPSecUser a user for SIPSec
       
    76      *
       
    77      * @param aRemoteTarget. The remote target to be used.
       
    78 	 *
       
    79 	 * @param aDeleteRequest. If it is ETrue, refresh will keep 
       
    80 	 *        the ownership of the request, otherwise not.	 
       
    81 	 *
       
    82 	 * @param aPassAllResponsesToOwner. If ETrue all the responses
       
    83 	 *        are passed to the owner. 
       
    84 	 *        If EFalse only the first final response is passed.
       
    85 	 */
       
    86 	virtual void RefreshL (TTransactionId& aTransactionId,
       
    87 	                       TRefreshId& aRefreshId,
       
    88 	                       TRegistrationId aRegistrationId,
       
    89 				           CSIPRequest* aRequest,
       
    90 				           MRefreshOwner* aOwner,
       
    91 				           MSIPSecUser& aSIPSecUser,
       
    92 						   CURIContainer& aRemoteTarget,
       
    93 						   TBool aDeleteRequest,
       
    94 						   TBool aPassAllResponsesToOwner) = 0;
       
    95 
       
    96 
       
    97 	/**
       
    98 	 * Add a refresh for a given CSIPRequest and return the transaction 
       
    99 	 * related SIP headers.
       
   100 	 *
       
   101 	 * @pre aRequest!=0
       
   102      * @pre aOwner!=0
       
   103      *
       
   104 	 * @param aTransactionId; an empty transaction id 
       
   105 	 * that will be filled by TU
       
   106 	 *
       
   107 	 * @param aRefreshId; on return contains the id of the created refresh
       
   108      *
       
   109 	 * @param aRegistrationId a registration id with which 
       
   110 	 *        a possible outbound proxy is used in TU.
       
   111      *
       
   112 	 * @param aRequest SIP request to be refreshed. The ownership is 
       
   113      *        transferred to MSipRefreshMgr.
       
   114      *
       
   115      * @param aOwner a callback interface implemented by the caller
       
   116      *
       
   117      * @param aSIPSecUser a user for SIPSec
       
   118 	 *
       
   119      * @param aRemoteTarget. The remote target to be used.
       
   120      *
       
   121 	 * @returns the transaction related headers @see MTransactionHeaders
       
   122 	 *          The ownership is transferred.
       
   123 	 */
       
   124 	virtual MTransactionHeaders* RefreshAndGetHeadersL (
       
   125 	                TTransactionId& aTransactionId,
       
   126 	                TRefreshId& aRefreshId,
       
   127 					TRegistrationId aRegistrationId,
       
   128 					CSIPRequest* aRequest,
       
   129 					MRefreshOwner* aOwner,
       
   130 					MSIPSecUser& aSIPSecUser,
       
   131 					CURIContainer& aRemoteTarget) = 0;
       
   132 
       
   133 	/**
       
   134 	 * Update a refresh for a given id. Leaves with
       
   135 	 * CSIPClient::ENonExistingRefreshId if no refresh for the given id was
       
   136      * found.
       
   137 	 *
       
   138 	 * @pre aRequest!=0
       
   139 	 * @pre aRefreshId!=KEmptyRefreshId
       
   140      *
       
   141 	 * @param aTransactionId; an empty transaction id that will 
       
   142 	 *                        be filled by TU
       
   143 	 *
       
   144 	 * @param aRefreshId a refresh id of an existing refresh 
       
   145      *
       
   146 	 * @param aRequest an updated SIP request to be refreshed.
       
   147 	 *        The ownership is transferred if parameter aDeleteRequest 
       
   148 	 *        is ETrue, otherwise not.
       
   149 	 *
       
   150 	 * @param aOwner a callback interface implemented by the caller
       
   151 	 *
       
   152 	 * @param aDeleteRequest. If it is ETrue, refresh will keep the 
       
   153 	 *        ownership of the request, otherwise not.
       
   154 	 */
       
   155 	virtual void UpdateRefreshL (TTransactionId& aTransactionId,
       
   156 		                         const TRefreshId& aRefreshId,
       
   157 				                 CSIPRequest* aRequest,
       
   158 				                 const MRefreshOwner* aOwner,
       
   159 								 TBool aDeleteRequest) = 0;
       
   160 
       
   161 	/**
       
   162 	 * Ends a refresh with a given id. Leaves with
       
   163 	 * CSIPClient::ENonExistingRefreshId if no refresh for the given id was
       
   164      * found.
       
   165 	 * Sends the given request and receives a response for it
       
   166 	 * before removing the refresh.
       
   167 	 *
       
   168 	 * @pre aRequest!=0
       
   169 	 * @pre aRefreshId!=KEmptyRefreshId
       
   170      *
       
   171 	 * @param aTransactionId; an empty transaction id 
       
   172 	 *        that will be filled by TU
       
   173 	 *
       
   174 	 * @param aRefreshId a refresh id of an existing refresh 
       
   175      *
       
   176 	 * @param aRequest a SIP request to be sent before ending the refresh.
       
   177 	 *        The ownership is transferred if parammeter aDeleteRequest 
       
   178 	 *        is ETrue otherwise not.
       
   179 	 *
       
   180 	 * @param aOwner a callback interface implemented by the caller
       
   181 	 * 
       
   182 	 * @param aDeleteRequest. If it is ETrue, refresh will keep the 
       
   183 	 *        ownership of the request, otherwise not.
       
   184 	 */
       
   185 	virtual void TerminateRefreshL (TTransactionId& aTransactionId,
       
   186 		                            const TRefreshId& aRefreshId,
       
   187 				                    CSIPRequest* aRequest,
       
   188 				                    const MRefreshOwner* aOwner,
       
   189 									TBool aDeleteRequest) = 0;
       
   190 
       
   191 	/**
       
   192 	 * Terminates a refresh with a given id abnormally. Deletes the
       
   193 	 * refresh immediately no matter what is the state of the refresh.
       
   194      *
       
   195 	 * @param aRefreshId a refresh id of an existing refresh 
       
   196      *
       
   197      * @param aOwner a callback interface implemented by the caller
       
   198      *
       
   199 	 * @returns CSIPClient::ENonExistingRefreshId if no refresh with 
       
   200 	 *          the given id was found, otherwise KErrNone.
       
   201 	 */
       
   202 	virtual TInt TerminateRefresh (const TRefreshId& aRefreshId,
       
   203 	                               const MRefreshOwner* aOwner) = 0;
       
   204 
       
   205 	/**
       
   206 	 * Stops all the refreshs for the given refresh owner.
       
   207      * Using this function the user detaches itself from 
       
   208 	 * the refresh subsystem and the object implementing 
       
   209 	 * the call back can be deleted.
       
   210 	 *
       
   211 	 * @pre aOwner!=0
       
   212      *
       
   213      * @param aOwner a callback interface implemented by the caller
       
   214      *
       
   215 	 * @returns CSIPClient::ENonExistingRefreshId if no refresh for 
       
   216 	 *          the given owner were found, otherwise KErrNone.
       
   217 	 */
       
   218     virtual TInt RemoveRefreshesFor (const MRefreshOwner* aOwner) = 0;
       
   219 
       
   220 	/**
       
   221 	 * Returns a refreshing request.
       
   222 	 * The request ownership is not transferred.
       
   223 	 *
       
   224 	 * @param aRefreshId the id for the refresh whose request is returned
       
   225 	 *
       
   226 	 * @returns Request of the refresh. 0 if not found.
       
   227      */
       
   228 	virtual CSIPRequest* Request (const TRefreshId& aRefreshId) = 0;
       
   229 
       
   230     /**
       
   231 	 * Update the remote target.
       
   232 	 * 
       
   233 	 * @pre aOwner!=0
       
   234      *
       
   235      * @param aOwner. The ownership is not transferred.
       
   236 	 * @param aRemoteTarget the new remote target.
       
   237 	 *
       
   238      */
       
   239 	virtual void UpdateRemoteTargetL (const MRefreshOwner* aOwner, 
       
   240 		                              CURIContainer& aRemoteTarget) = 0;
       
   241 
       
   242 	/**
       
   243 	 * Update header to a request of given refreshid. Leaves with
       
   244 	 * CSIPClient::ENonExistingRefreshId if no refresh for 
       
   245 	 * the given id was found.
       
   246 	 *
       
   247 	 * @pre aRefreshId!=KEmptyRefreshId
       
   248 	 * 
       
   249 	 * @param aRefreshId a refresh id of an existing refresh
       
   250 	 *
       
   251 	 * @param aOwner a callback interface implemented by the caller 
       
   252 	 *
       
   253 	 * @param aSIPHeader a SIP header to updated, 
       
   254 	 *        the ownership is transferred.
       
   255 	 */
       
   256 	virtual void UpdateHeaderL (const TRefreshId& aRefreshId,
       
   257 	                            const MRefreshOwner* aOwner,
       
   258 								CSIPHeaderBase* aSIPHeader) = 0;
       
   259 
       
   260 	/**
       
   261 	 * Update the Route-sets for all the refreshes of a given owner. 
       
   262 	 * @param aOwner. The ownership is not transferred.
       
   263      * @param aRouteSet. An array of CSIPRouteHeader-objects.
       
   264 	 *        The ownership is not transfered.
       
   265 	 */
       
   266 	virtual void UpdateRouteSetsL (const MRefreshOwner* aOwner, 
       
   267 				                   const RPointerArray<CSIPRouteHeader>& aRouteSet) = 0;
       
   268 
       
   269 	/**
       
   270 	 * Removes the Route-sets for all the refreshes of a given owner.
       
   271 	 * @param aOwner. The ownership is not transferred.
       
   272 	 */
       
   273 	virtual void RemoveRouteSets (const MRefreshOwner* aOwner) = 0;
       
   274 
       
   275 	/**
       
   276 	 * Set all the registration ids empty for the given refresh owner.
       
   277 	 *
       
   278 	 * @param aOwner. The ownership is not transferred.
       
   279 	 */
       
   280 	virtual void SetRegistrationIdsEmpty (const MRefreshOwner* aOwner) = 0;
       
   281 	
       
   282 	/**
       
   283 	 * Set the refresh interval for the request. 
       
   284 	 * If no request is pending adjusts the timer immediately.
       
   285 	 * If a request is pending, the new interval will be taken into use
       
   286 	 * after the final response for the pending request has been received. 
       
   287 	 *
       
   288 	 * @param aRefreshId identifies the refresh
       
   289 	 *
       
   290 	 * @param aInterval the interval with which the request is refreshed
       
   291 	 */	
       
   292 	virtual void SetIntervalL  (const TRefreshId& aRefreshId,
       
   293 	                            TInt aInterval) = 0;
       
   294 	
       
   295 	/**
       
   296 	 * Gets the refresh interval for the request.
       
   297 	 *
       
   298 	 * @param aRefreshId identifies the refresh
       
   299 	 *
       
   300 	 * @return refresh interval
       
   301 	 */		
       
   302 	virtual TInt IntervalL (const TRefreshId& aRefreshId) = 0;
       
   303 	
       
   304 	/**
       
   305 	 * Gets the current transaction id for a refresh.
       
   306 	 *
       
   307 	 * @param aRefreshId identifies the refresh
       
   308 	 *
       
   309 	 * @return current transaction id, if found, otherwise KEmptyTransactionId
       
   310 	 */	
       
   311 	virtual TTransactionId CurrentTransactionId(
       
   312 	    const TRefreshId& aRefreshId) const = 0;
       
   313         
       
   314 	/**
       
   315 	 * Gets a MSIPSecUser related to a refresh.
       
   316      *
       
   317      * @param aRefreshId the refresh id
       
   318      *
       
   319      * @return MSIPSecUser related to the given refresh id, if found,
       
   320      *         otherwise NULL.
       
   321 	 */    
       
   322     virtual const MSIPSecUser* SIPSecUser(
       
   323         const TRefreshId& aRefreshId) const = 0;    
       
   324     };
       
   325 
       
   326 #endif // MSIPREFRESHMGR_H
       
   327 
       
   328 // End of File