Adding app-mgt store interface methods and implementations

feature/appm-store/pbac
amalhub 7 years ago
parent e54ab93d15
commit ee76f6cb0f

@ -52,6 +52,14 @@ public class SubscriptionManagementAPIImpl implements SubscriptionManagementAPI{
if (!installationDetails.getDeviceIdentifiers().isEmpty()) { if (!installationDetails.getDeviceIdentifiers().isEmpty()) {
List<DeviceIdentifier> deviceList = installationDetails.getDeviceIdentifiers(); List<DeviceIdentifier> deviceList = installationDetails.getDeviceIdentifiers();
response = subscriptionManager.installApplicationForDevices(applicationUUTD, deviceList); response = subscriptionManager.installApplicationForDevices(applicationUUTD, deviceList);
} else if (!installationDetails.getUserNameList().isEmpty()) {
List<String> userList = installationDetails.getUserNameList();
response = subscriptionManager.installApplicationForUsers(applicationUUTD, userList);
} else if (!installationDetails.getRoleNameList().isEmpty()) {
List<String> roleList = installationDetails.getRoleNameList();
response = subscriptionManager.installApplicationForRoles(applicationUUTD, roleList);
} else {
response = "Missing request data!";
} }
return Response.status(Response.Status.OK).entity(response).build(); return Response.status(Response.Status.OK).entity(response).build();
} catch (ApplicationManagementException e) { } catch (ApplicationManagementException e) {

@ -36,6 +36,24 @@ public interface SubscriptionManager {
*/ */
List<DeviceIdentifier> installApplicationForDevices(String applicationUUID, List<DeviceIdentifier> deviceList) throws ApplicationManagementException; List<DeviceIdentifier> installApplicationForDevices(String applicationUUID, List<DeviceIdentifier> deviceList) throws ApplicationManagementException;
/**
* To install an application to given list of users.
* @param applicationUUID Application ID
* @param userList User list
* @return User list which the application has been installed
* @throws ApplicationManagementException Application Management Exception
*/
List<String> installApplicationForUsers(String applicationUUID, List<String> userList) throws ApplicationManagementException;
/**
* To install an application to given list of users.
* @param applicationUUID Application ID
* @param roleList Role list
* @return Role list which the application has been installed
* @throws ApplicationManagementException Application Management Exception
*/
List<String> installApplicationForRoles(String applicationUUID, List<String> roleList) throws ApplicationManagementException;
/** /**
* To uninstall an application from a given list of devices. * To uninstall an application from a given list of devices.
* @param applicationUUID Application ID * @param applicationUUID Application ID

@ -34,11 +34,31 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
log.info("Install application: " + applicationUUID + " to: " + deviceList.size() + " devices."); log.info("Install application: " + applicationUUID + " to: " + deviceList.size() + " devices.");
for (DeviceIdentifier device : deviceList) { for (DeviceIdentifier device : deviceList) {
String deviceId = device.getId(); String deviceId = device.getId();
//Todo: implementation, validations
//Todo: generating one time download link for the application and put install operation to device.
//Todo: Store the mappings in DB.
} }
return deviceList; return deviceList;
} }
@Override
public List<String> installApplicationForUsers(String applicationUUID, List<String> userList) throws ApplicationManagementException {
log.info("Install application: " + applicationUUID + " to: " + userList.size() + " users.");
for (String user : userList) {
//Todo: implementation
}
return userList;
}
@Override
public List<String> installApplicationForRoles(String applicationUUID, List<String> roleList) throws ApplicationManagementException {
log.info("Install application: " + applicationUUID + " to: " + roleList.size() + " users.");
for (String role : roleList) {
//Todo: implementation
}
return roleList;
}
@Override @Override
public List<DeviceIdentifier> uninstallApplication(String applicationUUID, List<DeviceIdentifier> deviceList) throws ApplicationManagementException { public List<DeviceIdentifier> uninstallApplication(String applicationUUID, List<DeviceIdentifier> deviceList) throws ApplicationManagementException {
return null; return null;

Loading…
Cancel
Save