blob: 434fcf3502c3e66d7ab7e61e835c9668199ae01e [file] [log] [blame]
///////////////////////////////////////////////////////////////////////////////
// //
// Copyright (c) 2000-2019 Ericsson Telecom AB //
// //
// All rights reserved. This program and the accompanying materials //
// are made available under the terms of the Eclipse Public License v2.0 //
// which accompanies this distribution, and is available at //
// https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html //
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
// Module: EPTF_CLL_HostAdminUI_Functions
//
// Purpose:
// This module contains HostAdminUI functions of EPTF CLL UIHandler.
//
// Module Parameters:
//
// Module depends on:
// <EPTF_CLL_UIHandlerClient_Functions>
// <EPTF_CLL_UIHandler_Definitions>
// <EPTF_CLL_UIHandlerVariableUI_Function>
// <EPTF_CLL_UIHandler_WidgetFunctions>
// <EPTF_CLL_Logging_Definitions>
// <EPTF_CLL_Logging_Functions>
// <EPTF_CLL_LoggingUI_Definitions>
// <EPTF_CLL_LoggingUI_Functions>
// <EPTF_CLL_LoggingUIClient_Functions>
// <EPTF_CLL_Base_Functions>
// <EPTF_CLL_HostAdminUI_Definitions>
// <EPTF_CLL_HostAdmin_Functions>
// <EPTF_CLL_HostAdmin_Definitions>
// <EPTF_CLL_Variable_Functions>
// <XTDP_PDU_Defs>
//
// Current Owner:
// Zsolt Szalai (EZSOSZA)
//
// Last Review Date:
// 2007-xx-xx
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////
module EPTF_CLL_HostAdminUI_Functions
// [.objid{ itu_t(0) identified_organization(4) etsi(0)
// identified_organization(127) ericsson(5) testing(0)
// <put further nodes here if needed>}]
{
import from EPTF_CLL_UIHandler_Definitions all;
import from EPTF_CLL_UIHandlerVariableUI_Functions all;
import from EPTF_CLL_Logging_Definitions all;
import from EPTF_CLL_Logging_Functions all;
import from EPTF_CLL_LoggingUI_Definitions all;
import from EPTF_CLL_LoggingUIClient_Functions all;
import from EPTF_CLL_Base_Functions all;
import from EPTF_CLL_HostAdminUI_Definitions all;
import from EPTF_CLL_HostAdmin_Functions all;
import from EPTF_CLL_HostAdmin_Definitions all;
modulepar boolean tsp_debug_EPTF_HostAdminUI := false;
///////////////////////////////////////////////////////////
// Function: f_EPTF_HostAdminUI_init_CT
//
// Purpose:
// Initialize the component
//
// Parameters:
// pl_selfName - *in* *charstring* - the name of the component
// pl_hostname - *in* *charstring* - the name of the host it is executed on
// pl_UIHandler - *in* *EPTF_UIHandler_CT* - The UIHandler component of the application
//
// Detailed Comments:
// -
///////////////////////////////////////////////////////////
public function f_EPTF_HostAdminUI_init_CT(in charstring pl_selfName,
in charstring pl_hostname,
in EPTF_UIHandler_CT pl_UIHandler,
in EPTF_LoggingUI_CT pl_loggingUi_compRef := null)
runs on EPTF_HostAdminUI_CT {
if(pl_loggingUi_compRef != null) {
f_EPTF_LoggingUIClient_init_CT(pl_selfName, pl_loggingUi_compRef, pl_UIHandler);
} else {
f_EPTF_Logging_init_CT(pl_selfName);
}
v_HostAdminUI_loggingMaskId := f_EPTF_Logging_registerComponentMasks(tsp_EPTF_HostAdminUI_loggingComponentMask, c_EPTF_HostAdmin_loggingEventClasses, EPTF_Logging_CLL);
if(tsp_debug_EPTF_HostAdminUI) {
f_EPTF_Logging_enableLocalMask(v_HostAdminUI_loggingMaskId, c_EPTF_HostAdmin_loggingClassIdx_Debug);
} else {
f_EPTF_Logging_disableLocalMask(v_HostAdminUI_loggingMaskId, c_EPTF_HostAdmin_loggingClassIdx_Debug);
}
if (not v_HostAdminUI_initialized) {
f_EPTF_UIHandler_VariableUI_init_CT(f_EPTF_Base_selfName(), pl_UIHandler);
f_EPTF_HostAdmin_init_CT(f_EPTF_Base_selfName(), pl_hostname);
v_HostAdminUI_name := f_EPTF_Base_selfName();
v_HostAdminUI_hostname := pl_hostname;
v_HostAdminUI_initialized := true;
f_EPTF_Base_registerCleanup(refers(f_EPTF_HostAdminUI_cleanup_CT));
f_EPTF_HostAdminUI_debug("----CLL_HostAdminUI INIT DONE----");
}
}
private function f_EPTF_HostAdminUI_cleanup_CT() runs on EPTF_HostAdminUI_CT{
v_HostAdminUI_initialized := false;
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_HostAdminUI_behavior
//
// Purpose:
// Initialize the component, put out the variables and starts to measure
//
// Parameters:
// pl_selfName - *in* *charstring* - the name of the component
// pl_hostname - *in* *charstring* - the name of the host it is executed on
// pl_UIHandler - *in* *EPTF_UIHandler_CT* - The UIHandler component of the application
//
// Detailed Comments:
// You only need to create a component with that type on a host,
// and start the component with this function.
//
///////////////////////////////////////////////////////////
public function f_EPTF_HostAdminUI_behavior(
in charstring pl_selfname,
in charstring pl_hostname,
in EPTF_UIHandler_CT pl_UIHandler,
in EPTF_LoggingUI_CT pl_loggingUi_compRef := null)
runs on EPTF_HostAdminUI_CT{
f_EPTF_HostAdminUI_init_CT(pl_selfname, pl_hostname, pl_UIHandler,pl_loggingUi_compRef);
f_EPTF_HostAdmin_behavior(f_EPTF_Base_selfName(), pl_hostname);
}
group Logging {
///////////////////////////////////////////////////////////
// Function: f_EPTF_HostAdminUI_error
//
// Purpose:
// Function to log an error from HostAdminUI feature.
//
// Parameters:
// - pl_message - *in* *charstring* - the message to log
//
// Return Value:
// -
//
// Errors & assertions:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////
private function f_EPTF_HostAdminUI_error(in charstring pl_message)
runs on EPTF_HostAdminUI_CT
{
f_EPTF_Logging_error(true, tsp_EPTF_HostAdminUI_loggingComponentMask&": "&pl_message);
f_EPTF_Base_stopAll();
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_HostAdminUI_warning
//
// Purpose:
// Function to log a warning from HostAdminUI feature.
//
// Parameters:
// - pl_message - *in* *charstring* - the message to log
//
// Return Value:
// -
//
// Errors & assertions:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////
private function f_EPTF_HostAdminUI_warning(in @lazy charstring pl_message)
runs on EPTF_HostAdminUI_CT
{
f_EPTF_Logging_warningV2(pl_message, v_HostAdminUI_loggingMaskId, {c_EPTF_HostAdmin_loggingClassIdx_Warning});
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_HostAdminUI_debug
//
// Purpose:
// Function to log a debug message from HostAdminUI feature.
//
// Parameters:
// - pl_message - *in* *charstring* - the message to log
//
// Return Value:
// -
//
// Errors & assertions:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////
private function f_EPTF_HostAdminUI_debug(in @lazy charstring pl_message)
runs on EPTF_HostAdminUI_CT
{
f_EPTF_Logging_debugV2(pl_message, v_HostAdminUI_loggingMaskId, {c_EPTF_HostAdmin_loggingClassIdx_Debug});
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_HostAdminUI_debugEnabled
//
// Purpose:
// Function to check if debug is enabled for HostAdminUI
//
// Parameters:
// -
//
// Return Value:
// *boolean* - true if debug enalbed
//
// Errors & assertions:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////
private function f_EPTF_HostAdminUI_debugEnabled()
runs on EPTF_HostAdminUI_CT
return boolean
{
return f_EPTF_Logging_isEnabled(v_HostAdminUI_loggingMaskId, c_EPTF_HostAdmin_loggingClassIdx_Debug);
}
} // group Logging
}