Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/core/cm/communication/communication.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ class CommunicationItf {

} // namespace aos::cm::communication

#endif // AOS_CORE_CM_COMMUNICATION_COMMUNICATION_HPP_
#endif
2 changes: 1 addition & 1 deletion src/core/cm/communication/servicediscovery.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@ struct ServiceDiscoveryResponse {

} // namespace aos::cm::communication

#endif // AOS_CORE_CM_COMMUNICATION_SERVICEDISCOVERY_HPP_
#endif
2 changes: 1 addition & 1 deletion src/core/cm/fileserver/itf/fileserver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ class FileServerItf {

} // namespace aos::cm::fileserver

#endif // AOS_CORE_CM_FILESERVER_HPP_
#endif
2 changes: 1 addition & 1 deletion src/core/cm/imagemanager/imagemanager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,4 +254,4 @@ class ImageManager : public ImageManagerItf,

} // namespace aos::cm::imagemanager

#endif // AOS_CORE_CM_IMAGEMANAGER_IMAGEMANAGER_HPP_
#endif
2 changes: 1 addition & 1 deletion src/core/cm/imagemanager/itf/imageunpacker.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ class ImageUnpackerItf {

} // namespace aos::cm::imagemanager

#endif // AOS_CORE_CM_IMAGEMANAGER_ITF_IMAGEUNPACKER_HPP_
#endif
2 changes: 1 addition & 1 deletion src/core/cm/imagemanager/itf/storage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,4 @@ class StorageItf {

} // namespace aos::cm::imagemanager::storage

#endif // AOS_CORE_CM_IMAGEMANAGER_ITF_STORAGE_HPP_
#endif
2 changes: 1 addition & 1 deletion src/core/cm/launcher/itf/instancerunner.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ class InstanceRunnerItf {

} // namespace aos::cm::launcher

#endif // AOS_CORE_CM_LAUNCHER_ITF_STATUSLISTENER_HPP_
#endif
1 change: 1 addition & 0 deletions src/core/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ add_subdirectory(alerts)
add_subdirectory(connectionprovider)
add_subdirectory(crypto)
add_subdirectory(downloader)
add_subdirectory(iamclient)
add_subdirectory(logprovider)
add_subdirectory(monitoring)
add_subdirectory(ocispec)
Expand Down
2 changes: 1 addition & 1 deletion src/core/common/consts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ constexpr auto cMaxNumConcurrentItems = AOS_CONFIG_MAX_NUM_CONCURRENT_ITEMS;

} // namespace aos

#endif // AOS_CORE_COMMON_CONSTS_HPP_
#endif
31 changes: 31 additions & 0 deletions src/core/common/iamclient/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#
# Copyright (C) 2025 EPAM Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#

# ######################################################################################################################
# Target name
# ######################################################################################################################

set(TARGET_NAME iamclient)

# ######################################################################################################################
# Headers
# ######################################################################################################################

set(HEADERS itf/currentnodeinfoprovider.hpp)

# ######################################################################################################################
# Target
# ######################################################################################################################

add_module(TARGET_NAME ${TARGET_NAME} HEADERS ${HEADERS})

# ######################################################################################################################
# Tests
# ######################################################################################################################

if(WITH_TEST)
add_subdirectory(tests)
endif()
69 changes: 69 additions & 0 deletions src/core/common/iamclient/itf/currentnodeinfoprovider.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*
* Copyright (C) 2025 EPAM Systems, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

#ifndef AOS_CORE_COMMON_IAMCLIENT_ITF_CURRENTNODEINFOPROVIDER_HPP_
#define AOS_CORE_COMMON_IAMCLIENT_ITF_CURRENTNODEINFOPROVIDER_HPP_

#include <core/common/types/common.hpp>

namespace aos::iamclient {

/**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add an empty line

* Interface for receiving notification about changing current node information.
*/
class CurrentNodeInfoListenerItf {
public:
/**
* Destructor.
*/
virtual ~CurrentNodeInfoListenerItf() = default;

/**
* Notifies about current node info changed.
*
* @param info current node information.
*/
virtual void OnCurrentNodeInfoChanged(const NodeInfo& info) = 0;
};

/**
* Current node information provider interface.
*/
class CurrentNodeInfoProviderItf {
public:
/**
* Destructor.
*/
virtual ~CurrentNodeInfoProviderItf() = default;

/**
* Returns current node info .
*
* @param[out] nodeInfo current node information.
* @return Error.
*/
virtual Error GetCurrentNodeInfo(NodeInfo& nodeInfo) const = 0;

/**
* Subscribes current node info notifications.
*
* @param listener current node info listener.
* @return Error.
*/
virtual Error SubscribeListener(CurrentNodeInfoListenerItf& listener) = 0;

/**
* Unsubscribes from current node info notifications.
*
* @param listener current node info listener.
* @return Error.
*/
virtual Error UnsubscribeListener(CurrentNodeInfoListenerItf& listener) = 0;
};

} // namespace aos::iamclient

#endif
33 changes: 33 additions & 0 deletions src/core/common/iamclient/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#
# Copyright (C) 2025 EPAM Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#

set(TARGET_NAME iamclient_test)

# ######################################################################################################################
# Sources
# ######################################################################################################################

set(SOURCES iamclient.cpp)

# ######################################################################################################################
# Libraries
# ######################################################################################################################

set(LIBRARIES aos::core::cm::iamclient GTest::gmock_main)

# ######################################################################################################################
# Target
# ######################################################################################################################

add_test(
TARGET_NAME
${TARGET_NAME}
LOG_MODULE
SOURCES
${SOURCES}
LIBRARIES
${LIBRARIES}
)
7 changes: 7 additions & 0 deletions src/core/common/iamclient/tests/iamclient.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Copyright (C) 2025 EPAM Systems, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <core/common/iamclient/itf/currentnodeinfoprovider.hpp>
2 changes: 1 addition & 1 deletion src/core/common/tests/crypto/providers/cryptofactory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ using DefaultCryptoFactory = OpenSSLCryptoFactory;
#error "No crypto provider defined. Define WITH_OPENSSL or WITH_MBEDTLS."
#endif

#endif // CRYPTOFACTORY_HPP_
#endif
2 changes: 1 addition & 1 deletion src/core/common/types/instance.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,4 @@ using InstanceStatusArray = StaticArray<InstanceStatus, cMaxNumInstances>;

} // namespace aos

#endif // AOS_CORE_COMMON_TYPES_INSTANCE_HPP_
#endif
2 changes: 1 addition & 1 deletion src/core/common/types/network.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,4 +192,4 @@ struct Host {

} // namespace aos

#endif // AOS_CORE_COMMON_TYPES_NETWORK_HPP_
#endif
2 changes: 1 addition & 1 deletion src/core/common/types/permissions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ struct FunctionServicePermissions {

} // namespace aos

#endif // AOS_CORE_COMMON_TYPES_PERMISSIONS_HPP_
#endif
2 changes: 1 addition & 1 deletion src/core/common/types/unitstatus.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,4 @@ struct UnitStatus {

} // namespace aos

#endif // AOS_CORE_COMMON_TYPES_UNITSTATUS_HPP_
#endif
2 changes: 1 addition & 1 deletion src/core/sm/networkmanager/cni.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,4 +292,4 @@ class CNIItf {

} // namespace aos::sm::cni

#endif // AOS_SM_CNI_HPP_
#endif
2 changes: 1 addition & 1 deletion src/core/testconfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@
*/
#define AOS_CONFIG_LAUNCHER_RUNTIME_DIR "/tmp/aos/runtime"

#endif // AOS_CORE_TESTCONFIG_HPP_
#endif
Loading