accessoryservices/remotecontrolfw/server/inc/bulkbearerinterface.h
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 // Copyright (c) 2008-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 //
       
    15 
       
    16 
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalComponent
       
    21 */
       
    22 
       
    23 #ifndef BULKBEARERINTERFACE_H
       
    24 #define BULKBEARERINTERFACE_H
       
    25 
       
    26 #include <e32base.h>
       
    27 #include <e32hashtab.h>
       
    28 #include <remcon/remconbearerbulkobserver.h>
       
    29 #include "bearermanager.h"
       
    30 
       
    31 class CRemConBulkServer;
       
    32 class CRemConMessage;
       
    33 class TBearerSecurity;
       
    34 class MRemConBearerBulkInterface;
       
    35 class TClientInfo;
       
    36 
       
    37 NONSHARABLE_CLASS(CBulkBearerInterface) : public CBase, public MRemConBearerBulkObserver
       
    38 	{
       
    39 public:
       
    40 	/** 
       
    41 	Bearer manager construction.
       
    42 	@return Ownership of a new CBulkBearerInterface object
       
    43 	*/
       
    44 	static CBulkBearerInterface* NewL(CRemConBulkServer& aServer, CBearerManager& aBearerManager);
       
    45 
       
    46 	~CBulkBearerInterface();
       
    47 
       
    48 public:
       
    49 	void BulkClientAvailable(const TRemConClientId& aClient);
       
    50 	void BulkClientRemoved(const TRemConClientId& aClient);
       
    51 	
       
    52 	/** Send a message over a specific connection and return the result 
       
    53 	immediately. */
       
    54 	TInt Send(CRemConMessage& aMsg);
       
    55 	
       
    56 	/**
       
    57 	@param aBearerUid The bearer with which to check the security policy with.
       
    58 	@param aMessage The message to check the policy against.
       
    59 	@return non-zero if the security check passes, zero otherwise.
       
    60 	*/
       
    61 	TBool CheckPolicy(TUid aBearerUid, const TClientInfo& aClientInfo);
       
    62 
       
    63 private:
       
    64 	CBulkBearerInterface(CRemConBulkServer& aServer, CBearerManager& aBearerManager);
       
    65 	void ConstructL(CBearerManager& aBearerManager);
       
    66 	void StopBearers();
       
    67 
       
    68 private: // from MRemConBearerBulkObserver
       
    69 	TInt MrcbboDoNewCommand(const TRemConAddress& aAddr);
       
    70 	TInt MrcbboDoNewCommand(const TRemConAddress& aAddr, const TRemConClientId& aClient);
       
    71 	TUint MrcbboDoNewTransactionId();
       
    72 	void MrcbboDoCommandExpired(TUint aTransactionId);
       
    73 	TInt MrcbboDoSetAddressedClient(const TRemConAddress& aAddr, const TRemConClientId& aClient);
       
    74 	TInt MrcbboDoRemoveAddressing(const TRemConAddress& aAddr);
       
    75 	
       
    76 private: // utility
       
    77 #ifdef __FLOG_ACTIVE
       
    78 	void LogBearers() const;
       
    79 #endif
       
    80 	
       
    81 	void NewCommandL(const TRemConAddress& aAddr, const TRemConClientId& aClient);
       
    82 
       
    83 	MRemConBearerBulkInterface* BearerIf(TUid aUid) const;
       
    84 
       
    85 private: // unowned	
       
    86 	RArray<CBearerManager::TBulkInterfaceInfo> iBearerIfs;
       
    87 	RHashMap<TRemConAddress, TRemConClientId> iAddressedClients; // Stores client id by RemCon addr
       
    88 
       
    89 private: // owned
       
    90 	TUint iRunningTransactionId;
       
    91 	TSglQueIter<TBearerSecurity> iSecurityPoliciesIter;
       
    92 
       
    93 private: // unowned
       
    94 	CRemConBulkServer& iServer;
       
    95 	};
       
    96 
       
    97 #endif // BULKBEARERINTERFACE_H