Package io.openems.edge.core.appmanager
Class AppCenterBackendUtilImpl
java.lang.Object
io.openems.edge.core.appmanager.AppCenterBackendUtilImpl
- All Implemented Interfaces:
AppCenterBackendUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCompletableFuture<? extends JsonrpcResponseSuccess>
addDeinstallAppInstanceHistory
(User user, String appId, UUID instanceId) Adds a deinstall app history entry to the key which installed the instance.void
addInstallAppInstanceHistory
(User user, String key, String appId, UUID instanceId) Adds a install app history entry to the given key.Gets the installed apps that were logged in the backend.getPossibleApps
(String key) Gets the possible apps that can be installed with the given key.boolean
Gets if this edge is connected to the backend.boolean
isKeyApplicable
(User user, String key, String appId) Gets from the backend if the given key can be applied to the given appId.
-
Constructor Details
-
AppCenterBackendUtilImpl
-
-
Method Details
-
isKeyApplicable
public boolean isKeyApplicable(User user, String key, String appId) throws OpenemsError.OpenemsNamedException Description copied from interface:AppCenterBackendUtil
Gets from the backend if the given key can be applied to the given appId.- Specified by:
isKeyApplicable
in interfaceAppCenterBackendUtil
- Parameters:
user
- the executing userkey
- the key to be validatedappId
- the id of theOpenemsApp
- Returns:
- true if the key can be applied
- Throws:
OpenemsError.OpenemsNamedException
-
addInstallAppInstanceHistory
public void addInstallAppInstanceHistory(User user, String key, String appId, UUID instanceId) throws OpenemsError.OpenemsNamedException Description copied from interface:AppCenterBackendUtil
Adds a install app history entry to the given key.- Specified by:
addInstallAppInstanceHistory
in interfaceAppCenterBackendUtil
- Parameters:
user
- the executing userkey
- the key the app should get installed withappId
- the app id of the created instanceinstanceId
- the instanceId of the created instance- Throws:
OpenemsError.OpenemsNamedException
- on error
-
addDeinstallAppInstanceHistory
public CompletableFuture<? extends JsonrpcResponseSuccess> addDeinstallAppInstanceHistory(User user, String appId, UUID instanceId) throws OpenemsError.OpenemsNamedException Description copied from interface:AppCenterBackendUtil
Adds a deinstall app history entry to the key which installed the instance.- Specified by:
addDeinstallAppInstanceHistory
in interfaceAppCenterBackendUtil
- Parameters:
user
- the executing userappId
- the app id of the removed instanceinstanceId
- the instanceId of the removed instance- Returns:
- the
CompletableFuture
of the request - Throws:
OpenemsError.OpenemsNamedException
- on error
-
getPossibleApps
Description copied from interface:AppCenterBackendUtil
Gets the possible apps that can be installed with the given key.- Specified by:
getPossibleApps
in interfaceAppCenterBackendUtil
- Parameters:
key
- the key that the apps can be installed with- Returns:
- a list of bundles with a list of their apps
-
getInstalledApps
public List<AppCenterGetInstalledAppsResponse.Instance> getInstalledApps() throws OpenemsError.OpenemsNamedExceptionDescription copied from interface:AppCenterBackendUtil
Gets the installed apps that were logged in the backend.- Specified by:
getInstalledApps
in interfaceAppCenterBackendUtil
- Returns:
- the instances that should be installed
- Throws:
OpenemsError.OpenemsNamedException
-
isConnected
public boolean isConnected()Description copied from interface:AppCenterBackendUtil
Gets if this edge is connected to the backend.- Specified by:
isConnected
in interfaceAppCenterBackendUtil
- Returns:
- true if this edge is connected to the backend
-