sysstatemgmt/systemstatemgr/test/tssm/src/tclesessionproxy.cpp
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 // clesessionproxy.cpp
       
    15 // 
       
    16 //
       
    17 
       
    18 #include "clesessionproxy.h"
       
    19 #include "ssmserverpanic.h"
       
    20 #include <ssm/ssmcmd.hrh>
       
    21 
       
    22 CCleSessionProxy* CCleSessionProxy::NewL()
       
    23 	{
       
    24 	CCleSessionProxy* self = new (ELeave) CCleSessionProxy;
       
    25 	return self;
       
    26 	}
       
    27 
       
    28 void CCleSessionProxy::ExecuteCommandList(const CSsmCommandList& aCmdList, TRequestStatus& aStatus, TCmdErrorSeverity& aSeverity)
       
    29 	{
       
    30 	iCleSession.ExecuteCommandList(aCmdList, aStatus, aSeverity);
       
    31 	}
       
    32 
       
    33 void CCleSessionProxy::ExecuteCommandListCancel()
       
    34 	{
       
    35 	iCleSession.ExecuteCommandListCancel();
       
    36 	}
       
    37 
       
    38 _LIT(KCleTestServerName, "TestSsmCleServer");
       
    39 
       
    40 void CCleSessionProxy::ConnectL()
       
    41 	{
       
    42 	__ASSERT_DEBUG(!iConnected, PanicNow(KPanicSysStateMgr, ESsmCCleSessionProxy1));
       
    43 	iCleSession.ConnectL(KCleTestServerName);
       
    44 	iConnected = ETrue;
       
    45 	}
       
    46 
       
    47 void CCleSessionProxy::ReleaseCle()
       
    48 	{
       
    49 	delete this;
       
    50 	}
       
    51 
       
    52 void CCleSessionProxy::Close()
       
    53 	{
       
    54 	iCleSession.Close();
       
    55 	iConnected = EFalse;
       
    56 	}
       
    57 
       
    58 TBool CCleSessionProxy::IsConnected()
       
    59 	{
       
    60 	return iConnected;
       
    61 	}
       
    62 
       
    63 
       
    64 CCleSessionProxy::~CCleSessionProxy()
       
    65 	{
       
    66 	if(iConnected)
       
    67 		iCleSession.Close();
       
    68 	}
       
    69 
       
    70 MCleSessionProxy* CCleSessionProxy::CreateNewProxyL()
       
    71 	{
       
    72 	return CCleSessionProxy::NewL();
       
    73 	}