Skip to content

Commit 18bd1eb

Browse files
committed
cm: imagemanager: add initial image manager interfaces and doc
Signed-off-by: Oleksandr Grytsov <[email protected]>
1 parent 38349de commit 18bd1eb

File tree

4 files changed

+149
-152
lines changed

4 files changed

+149
-152
lines changed

src/core/cm/imagemanager/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ set(TARGET_NAME imagemanager)
1414
# Headers
1515
# ######################################################################################################################
1616

17-
set(HEADERS imageprovider.hpp)
17+
set(HEADERS itf/updateitemlisterner.hpp)
1818

1919
# ######################################################################################################################
2020
# Target
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Image manager
2+
3+
Image manager stores update item images and provide update item image info for other modules.
4+
5+
It implements the following interfaces:
6+
7+
* [aos::cm::updatemanager::UpdateItemManagerItf]() - update item manager for [updatemanager]() module;
8+
* [aos::cm::launcher::UpdateItemProviderItf]() - update item provider for [launcher]() module;
9+
* [aos::cm::smcontroller::UpdateImageProviderItf]() - update image provider for [smcontroller]() module;
10+
* [aos::cm::imagemanager::UpdateItemNotifierItf]() - update item notifier to notify other modules about update items
11+
action.
12+
13+
It requires the following interfaces:
14+
15+
* ...
16+
17+
```mermaid
18+
classDiagram
19+
class ImageManager["aos::cm::imagemanager::ImageManager"] {
20+
}
21+
22+
class UpdateItemManagerItf["aos::cm::updatemanager::UpdateItemManagerItf"] {
23+
<<interface>>
24+
}
25+
26+
class UpdateItemProviderItf ["aos::cm::launcher::UpdateItemProviderItf"] {
27+
<<interface>>
28+
}
29+
30+
class UpdateImageProviderItf ["aos::cm::smcontroller::UpdateImageProviderItf"] {
31+
<<interface>>
32+
}
33+
34+
class UpdateItemNotifierItf ["aos::cm::imagemanager::UpdateItemNotifierItf"] {
35+
<<interface>>
36+
}
37+
38+
ImageManager <|.. UpdateItemManagerItf
39+
ImageManager <|.. UpdateItemProviderItf
40+
ImageManager <|.. UpdateImageProviderItf
41+
ImageManager <|.. UpdateItemNotifierItf
42+
```
43+
44+
## aos::cm::updatemanager::UpdateItemManagerItf
45+
46+
### GetUpdateItemsStatuses
47+
48+
Returns currently installed images statuses for each update item.
49+
50+
### InstallUpdateItem
51+
52+
Installs update item images.
53+
54+
### UninstallUpdateItem
55+
56+
Uninstalls update item images.
57+
58+
### RevertUpdateItem
59+
60+
Reverts update item images.
61+
62+
## aos::cm::launcher::UpdateItemProviderItf
63+
64+
### GetServiceNetworkData
65+
66+
Returns network data for specified service.
67+
68+
### GetUpdateItemVersion
69+
70+
Returns currently installed update item version.
71+
72+
## aos::cm::smcontroller::UpdateImageProviderItf
73+
74+
### GetUpdateImageInfo
75+
76+
Returns update image info for specified platform.
77+
78+
## aos::cm::imagemanager::UpdateItemNotifierItf
79+
80+
Notifies subscribers about changing update item states.
81+
82+
### SubscribeListener
83+
84+
Subscribes to changing update item states.
85+
86+
### UnsubscribeListener
87+
88+
Unsubscribes from changing update item states.

src/core/cm/imagemanager/imageprovider.hpp

Lines changed: 0 additions & 151 deletions
This file was deleted.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*
2+
* Copyright (C) 2025 EPAM Systems, Inc.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#ifndef AOS_CORE_CM_IMAGEMANAGER_ITF_UPDATEITEMLISTENER_HPP_
8+
#define AOS_CORE_CM_IMAGEMANAGER_ITF_UPDATEITEMLISTENER_HPP_
9+
10+
#include <core/common/cloudprotocol/common.hpp>
11+
12+
namespace aos::cm::imagemanager {
13+
14+
/**
15+
* Interface for receiving notification about update items states.
16+
*/
17+
class UpdateItemListenerItf {
18+
public:
19+
/**
20+
* Destructor.
21+
*/
22+
virtual ~UpdateItemListenerItf() = default;
23+
24+
/**
25+
* Notifies about update item removal.
26+
*
27+
* @param identifier identifier of the removed update item.
28+
*/
29+
virtual void OnUpdateItemRemoved(const cloudprotocol::Identifier& identifier) = 0;
30+
};
31+
32+
/**
33+
* Interface for notifying about update item states.
34+
*/
35+
class UpdateItemNotifierItf {
36+
/**
37+
* Destructor.
38+
*/
39+
virtual ~UpdateItemNotifierItf() = default;
40+
41+
/**
42+
* Subscribes update item notifications.
43+
*
44+
* @param listener update item listener.
45+
* @return Error.
46+
*/
47+
virtual Error SubscribeListener(UpdateItemListenerItf& listener) = 0;
48+
49+
/**
50+
* Unsubscribes from update item notifications.
51+
*
52+
* @param listener update item listener.
53+
* @return Error.
54+
*/
55+
virtual Error UnsubscribeListener(UpdateItemListenerItf& listener) = 0;
56+
};
57+
58+
} // namespace aos::cm::imagemanager
59+
60+
#endif

0 commit comments

Comments
 (0)