LCOV - code coverage report
Current view: top level - serverManager/common/source - SessionServerAppFactory.cpp (source / functions) Coverage Total Hit
Test: coverage.info Lines: 35.0 % 20 7
Test Date: 2026-09-11 17:36:12 Functions: 33.3 % 3 1

            Line data    Source code
       1              : /*
       2              :  * If not stated otherwise in this file or this component's LICENSE file the
       3              :  * following copyright and licenses apply:
       4              :  *
       5              :  * Copyright 2022 Sky UK
       6              :  *
       7              :  * Licensed under the Apache License, Version 2.0 (the "License");
       8              :  * you may not use this file except in compliance with the License.
       9              :  * You may obtain a copy of the License at
      10              :  *
      11              :  * http://www.apache.org/licenses/LICENSE-2.0
      12              :  *
      13              :  * Unless required by applicable law or agreed to in writing, software
      14              :  * distributed under the License is distributed on an "AS IS" BASIS,
      15              :  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      16              :  * See the License for the specific language governing permissions and
      17              :  * limitations under the License.
      18              :  */
      19              : 
      20              : #include "SessionServerAppFactory.h"
      21              : #include "ITimer.h"
      22              : #include "SessionServerApp.h"
      23              : #include <memory>
      24              : #include <string>
      25              : #include <utility>
      26              : 
      27              : namespace rialto::servermanager::common
      28              : {
      29            1 : SessionServerAppFactory::SessionServerAppFactory(const std::list<std::string> &environmentVariables,
      30              :                                                  const std::string &sessionServerPath,
      31              :                                                  std::chrono::milliseconds sessionServerStartupTimeout,
      32              :                                                  unsigned int socketPermissions, const std::string &socketOwner,
      33            1 :                                                  const std::string &socketGroup)
      34            1 :     : m_kEnvironmentVariables{environmentVariables}, m_kSessionServerPath{sessionServerPath},
      35            1 :       m_kSessionServerStartupTimeout{sessionServerStartupTimeout}, m_kSocketPermissions{socketPermissions},
      36            1 :       m_kSocketOwner{socketOwner}, m_kSocketGroup{socketGroup},
      37            2 :       m_linuxWrapperFactory{firebolt::rialto::wrappers::ILinuxWrapperFactory::createFactory()}
      38              : {
      39            1 : }
      40              : 
      41            0 : std::shared_ptr<ISessionServerApp> SessionServerAppFactory::create(
      42              :     const std::string &appName, const firebolt::rialto::common::SessionServerState &initialState,
      43              :     const firebolt::rialto::common::AppConfig &appConfig, SessionServerAppManager &sessionServerAppManager,
      44              :     std::unique_ptr<firebolt::rialto::ipc::INamedSocket> &&namedSocket) const
      45              : {
      46            0 :     return std::make_shared<SessionServerApp>(appName, initialState, appConfig,
      47            0 :                                               m_linuxWrapperFactory->createLinuxWrapper(),
      48            0 :                                               firebolt::rialto::common::ITimerFactory::getFactory(),
      49            0 :                                               sessionServerAppManager, m_kEnvironmentVariables, m_kSessionServerPath,
      50            0 :                                               m_kSessionServerStartupTimeout, m_kSocketPermissions, m_kSocketOwner,
      51            0 :                                               m_kSocketGroup, std::move(namedSocket));
      52              : }
      53              : 
      54            0 : std::shared_ptr<ISessionServerApp> SessionServerAppFactory::create(SessionServerAppManager &sessionServerAppManager) const
      55              : {
      56            0 :     return std::make_shared<SessionServerApp>(m_linuxWrapperFactory->createLinuxWrapper(),
      57            0 :                                               firebolt::rialto::common::ITimerFactory::getFactory(),
      58            0 :                                               sessionServerAppManager, m_kEnvironmentVariables, m_kSessionServerPath,
      59            0 :                                               m_kSessionServerStartupTimeout, m_kSocketPermissions, m_kSocketOwner,
      60            0 :                                               m_kSocketGroup);
      61              : }
      62              : } // namespace rialto::servermanager::common
        

Generated by: LCOV version 2.0-1