|
|
@ -99,15 +99,17 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
log.debug("Create Application received for the tenant : " + tenantId + " From" + " the user : " + userName);
|
|
|
|
log.debug("Create Application received for the tenant : " + tenantId + " From" + " the user : " + userName);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ConnectionManagerUtil.openDBConnection();
|
|
|
|
validateAppCreatingRequest(application);
|
|
|
|
validateAppCreatingRequest(application);
|
|
|
|
validateAppReleasePayload(application.getApplicationReleases().get(0));
|
|
|
|
validateAppReleasePayload(application.getApplicationReleases().get(0));
|
|
|
|
DeviceType deviceType;
|
|
|
|
DeviceType deviceType;
|
|
|
|
ApplicationRelease applicationRelease;
|
|
|
|
ApplicationRelease applicationRelease;
|
|
|
|
List<ApplicationRelease> applicationReleases = new ArrayList<>();
|
|
|
|
List<ApplicationRelease> applicationReleases = new ArrayList<>();
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
ConnectionManagerUtil.openDBConnection();
|
|
|
|
|
|
|
|
ConnectionManagerUtil.beginDBTransaction();
|
|
|
|
ConnectionManagerUtil.beginDBTransaction();
|
|
|
|
MAMDeviceConnectorImpl mamDeviceConnector = new MAMDeviceConnectorImpl();
|
|
|
|
MAMDeviceConnectorImpl mamDeviceConnector = new MAMDeviceConnectorImpl();
|
|
|
|
|
|
|
|
// Getting the device type details to get device type ID for internal mappings
|
|
|
|
deviceType = mamDeviceConnector.getDeviceManagementService().getDeviceType(application.getDeviceType());
|
|
|
|
deviceType = mamDeviceConnector.getDeviceManagementService().getDeviceType(application.getDeviceType());
|
|
|
|
|
|
|
|
|
|
|
|
if (deviceType == null) {
|
|
|
|
if (deviceType == null) {
|
|
|
@ -115,6 +117,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Insert to application table
|
|
|
|
int appId = this.applicationDAO.createApplication(application, deviceType.getId());
|
|
|
|
int appId = this.applicationDAO.createApplication(application, deviceType.getId());
|
|
|
|
|
|
|
|
|
|
|
|
if (appId == -1) {
|
|
|
|
if (appId == -1) {
|
|
|
@ -122,13 +125,26 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
if(log.isDebugEnabled()){
|
|
|
|
|
|
|
|
log.debug("New Application entry added to AP_APP table. App Id:" + appId);
|
|
|
|
|
|
|
|
}
|
|
|
|
if (!application.getTags().isEmpty()) {
|
|
|
|
if (!application.getTags().isEmpty()) {
|
|
|
|
this.applicationDAO.addTags(application.getTags(), appId, tenantId);
|
|
|
|
this.applicationDAO.addTags(application.getTags(), appId, tenantId);
|
|
|
|
|
|
|
|
if(log.isDebugEnabled()){
|
|
|
|
|
|
|
|
log.debug("New tags entry added to AP_APP_TAG table. App Id:" + appId);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!application.getUnrestrictedRoles().isEmpty()) {
|
|
|
|
if (!application.getUnrestrictedRoles().isEmpty()) {
|
|
|
|
application.setIsRestricted(true);
|
|
|
|
application.setIsRestricted(true);
|
|
|
|
this.visibilityDAO.addUnrestrictedRoles(application.getUnrestrictedRoles(), appId, tenantId);
|
|
|
|
this.visibilityDAO.addUnrestrictedRoles(application.getUnrestrictedRoles(), appId, tenantId);
|
|
|
|
|
|
|
|
if(log.isDebugEnabled()){
|
|
|
|
|
|
|
|
log.debug("New restricted roles to app ID mapping added to AP_UNRESTRICTED_ROLE table." +
|
|
|
|
|
|
|
|
" App Id:" + appId);
|
|
|
|
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
if(log.isDebugEnabled()){
|
|
|
|
|
|
|
|
log.debug("App is not restricted to role. App Id:" + appId);
|
|
|
|
|
|
|
|
}
|
|
|
|
application.setIsRestricted(false);
|
|
|
|
application.setIsRestricted(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (application.getApplicationReleases().size() > 1 ){
|
|
|
|
if (application.getApplicationReleases().size() > 1 ){
|
|
|
@ -136,14 +152,22 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
"Invalid payload. Application creating payload should contains one application release, but "
|
|
|
|
"Invalid payload. Application creating payload should contains one application release, but "
|
|
|
|
+ "the payload contains more than one");
|
|
|
|
+ "the payload contains more than one");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(log.isDebugEnabled()){
|
|
|
|
|
|
|
|
log.debug("Creating a new release. App Id:" + appId);
|
|
|
|
|
|
|
|
}
|
|
|
|
applicationRelease = application.getApplicationReleases().get(0);
|
|
|
|
applicationRelease = application.getApplicationReleases().get(0);
|
|
|
|
applicationRelease = this.applicationReleaseDAO
|
|
|
|
applicationRelease = this.applicationReleaseDAO
|
|
|
|
.createRelease(applicationRelease, appId, tenantId);
|
|
|
|
.createRelease(applicationRelease, appId, tenantId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(log.isDebugEnabled()){
|
|
|
|
|
|
|
|
log.debug("Changing lifecycle state. App Id:" + appId);
|
|
|
|
|
|
|
|
}
|
|
|
|
LifecycleState lifecycleState = new LifecycleState();
|
|
|
|
LifecycleState lifecycleState = new LifecycleState();
|
|
|
|
lifecycleState.setCurrentState(AppLifecycleState.CREATED.toString());
|
|
|
|
lifecycleState.setCurrentState(AppLifecycleState.CREATED.toString());
|
|
|
|
lifecycleState.setPreviousState(AppLifecycleState.CREATED.toString());
|
|
|
|
lifecycleState.setPreviousState(AppLifecycleState.CREATED.toString());
|
|
|
|
changeLifecycleState(appId, applicationRelease.getUuid(), lifecycleState);
|
|
|
|
changeLifecycleState(appId, applicationRelease.getUuid(), lifecycleState, false,
|
|
|
|
|
|
|
|
applicationRelease.getId());
|
|
|
|
|
|
|
|
|
|
|
|
applicationRelease.setLifecycleState(lifecycleState);
|
|
|
|
applicationRelease.setLifecycleState(lifecycleState);
|
|
|
|
applicationReleases.add(applicationRelease);
|
|
|
|
applicationReleases.add(applicationRelease);
|
|
|
@ -160,12 +184,18 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
} catch (DeviceManagementException e) {
|
|
|
|
} catch (DeviceManagementException e) {
|
|
|
|
|
|
|
|
|
|
|
|
String msg = "Error occurred while getting device type id of " + application.getType();
|
|
|
|
String msg = "Error occurred while getting device type id of " + application.getType();
|
|
|
|
log.error(msg, e);
|
|
|
|
log.error(msg, e);
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
String msg = "Unknown exception while creating application.";
|
|
|
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
//ConnectionManagerUtil.closeDBConnection(); //todo: check this again
|
|
|
|
ConnectionManagerUtil.closeDBConnection();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -182,14 +212,17 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
ConnectionManagerUtil.openDBConnection();
|
|
|
|
ConnectionManagerUtil.getDBConnection();
|
|
|
|
applicationList = applicationDAO.getApplications(filter, tenantId);
|
|
|
|
applicationList = applicationDAO.getApplications(filter, tenantId);
|
|
|
|
if (!isAdminUser(userName, tenantId, CarbonConstants.UI_ADMIN_PERMISSION_COLLECTION)) {
|
|
|
|
if(applicationList != null && applicationList.getApplications() != null && applicationList
|
|
|
|
applicationList = getRoleRestrictedApplicationList(applicationList, userName);
|
|
|
|
.getApplications().size() > 0) {
|
|
|
|
}
|
|
|
|
if (!isAdminUser(userName, tenantId, CarbonConstants.UI_ADMIN_PERMISSION_COLLECTION)) {
|
|
|
|
for (Application application : applicationList.getApplications()) {
|
|
|
|
applicationList = getRoleRestrictedApplicationList(applicationList, userName);
|
|
|
|
applicationReleases = getReleases(application.getId());
|
|
|
|
}
|
|
|
|
application.setApplicationReleases(applicationReleases);
|
|
|
|
for (Application application : applicationList.getApplications()) {
|
|
|
|
|
|
|
|
applicationReleases = getReleases(application.getId());
|
|
|
|
|
|
|
|
application.setApplicationReleases(applicationReleases);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return applicationList;
|
|
|
|
return applicationList;
|
|
|
|
} catch (UserStoreException e) {
|
|
|
|
} catch (UserStoreException e) {
|
|
|
@ -199,8 +232,6 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
} catch (ApplicationManagementDAOException e) {
|
|
|
|
} catch (ApplicationManagementDAOException e) {
|
|
|
|
throw new ApplicationManagementException(
|
|
|
|
throw new ApplicationManagementException(
|
|
|
|
"DAO exception while getting applications for the user " + userName + " of tenant " + tenantId, e);
|
|
|
|
"DAO exception while getting applications for the user " + userName + " of tenant " + tenantId, e);
|
|
|
|
} finally {
|
|
|
|
|
|
|
|
ConnectionManagerUtil.closeDBConnection();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -220,7 +251,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
LifecycleState lifecycleState = new LifecycleState();
|
|
|
|
LifecycleState lifecycleState = new LifecycleState();
|
|
|
|
lifecycleState.setCurrentState(AppLifecycleState.CREATED.toString());
|
|
|
|
lifecycleState.setCurrentState(AppLifecycleState.CREATED.toString());
|
|
|
|
lifecycleState.setPreviousState(AppLifecycleState.CREATED.toString());
|
|
|
|
lifecycleState.setPreviousState(AppLifecycleState.CREATED.toString());
|
|
|
|
changeLifecycleState(application.getId(), applicationRelease.getUuid(), lifecycleState);
|
|
|
|
changeLifecycleState(application.getId(), applicationRelease.getUuid(), lifecycleState, true, 0);
|
|
|
|
|
|
|
|
|
|
|
|
ConnectionManagerUtil.commitDBTransaction();
|
|
|
|
ConnectionManagerUtil.commitDBTransaction();
|
|
|
|
return applicationRelease;
|
|
|
|
return applicationRelease;
|
|
|
@ -365,12 +396,12 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
log.debug("Request is received to retrieve all the releases related with the application " + application
|
|
|
|
log.debug("Request is received to retrieve all the releases related with the application " + application
|
|
|
|
.toString());
|
|
|
|
.toString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
ConnectionManagerUtil.getDBConnection();
|
|
|
|
ConnectionManagerUtil.openDBConnection();
|
|
|
|
applicationReleases = this.applicationReleaseDAO.getReleases(application.getName(), application.getType(), tenantId);
|
|
|
|
applicationReleases = this.applicationReleaseDAO.getReleases(application.getName(), application.getType(), tenantId);
|
|
|
|
for (ApplicationRelease applicationRelease : applicationReleases) {
|
|
|
|
for (ApplicationRelease applicationRelease : applicationReleases) {
|
|
|
|
LifecycleState lifecycleState = ApplicationManagementDAOFactory.getLifecycleStateDAO().
|
|
|
|
LifecycleState lifecycleState = ApplicationManagementDAOFactory.getLifecycleStateDAO().
|
|
|
|
getLatestLifeCycleStateByReleaseID(applicationRelease.getId());
|
|
|
|
getLatestLifeCycleStateByReleaseID(applicationRelease.getId());
|
|
|
|
if (lifecycleState != null) {
|
|
|
|
applicationRelease.setLifecycleState(lifecycleState);
|
|
|
|
applicationRelease.setLifecycleState(lifecycleState);
|
|
|
|
|
|
|
|
|
|
|
|
if (!AppLifecycleState.REMOVED.toString()
|
|
|
|
if (!AppLifecycleState.REMOVED.toString()
|
|
|
@ -378,10 +409,9 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
filteredApplicationReleases.add(applicationRelease);
|
|
|
|
filteredApplicationReleases.add(applicationRelease);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return filteredApplicationReleases;
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
|
|
ConnectionManagerUtil.closeDBConnection();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return filteredApplicationReleases;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
@ -410,7 +440,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
LifecycleState newAppLifecycleState = new LifecycleState();
|
|
|
|
LifecycleState newAppLifecycleState = new LifecycleState();
|
|
|
|
newAppLifecycleState.setPreviousState(appLifecycleState.getCurrentState());
|
|
|
|
newAppLifecycleState.setPreviousState(appLifecycleState.getCurrentState());
|
|
|
|
newAppLifecycleState.setCurrentState(AppLifecycleState.REMOVED.toString());
|
|
|
|
newAppLifecycleState.setCurrentState(AppLifecycleState.REMOVED.toString());
|
|
|
|
changeLifecycleState(applicationId, applicationRelease.getUuid(), newAppLifecycleState);
|
|
|
|
changeLifecycleState(applicationId, applicationRelease.getUuid(), newAppLifecycleState, true, 0);
|
|
|
|
storedLocations.add(applicationRelease.getAppHashValue());
|
|
|
|
storedLocations.add(applicationRelease.getAppHashValue());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ConnectionManagerUtil.openDBConnection();
|
|
|
|
ConnectionManagerUtil.openDBConnection();
|
|
|
@ -441,7 +471,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
LifecycleState newAppLifecycleState = new LifecycleState();
|
|
|
|
LifecycleState newAppLifecycleState = new LifecycleState();
|
|
|
|
newAppLifecycleState.setPreviousState(appLifecycleState.getCurrentState());
|
|
|
|
newAppLifecycleState.setPreviousState(appLifecycleState.getCurrentState());
|
|
|
|
newAppLifecycleState.setCurrentState(AppLifecycleState.REMOVED.toString());
|
|
|
|
newAppLifecycleState.setCurrentState(AppLifecycleState.REMOVED.toString());
|
|
|
|
changeLifecycleState(applicationId, applicationRelease.getUuid(), newAppLifecycleState);
|
|
|
|
changeLifecycleState(applicationId, applicationRelease.getUuid(), newAppLifecycleState, true, 0);
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
throw new ApplicationManagementException("Can't delete the application release, You have to move the " +
|
|
|
|
throw new ApplicationManagementException("Can't delete the application release, You have to move the " +
|
|
|
|
"lifecycle state from "+ currentState + " to acceptable " +
|
|
|
|
"lifecycle state from "+ currentState + " to acceptable " +
|
|
|
@ -583,27 +613,24 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
ApplicationManagementException {
|
|
|
|
ApplicationManagementException {
|
|
|
|
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
|
|
|
|
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
|
|
|
|
ApplicationRelease applicationRelease;
|
|
|
|
ApplicationRelease applicationRelease;
|
|
|
|
try {
|
|
|
|
|
|
|
|
if (applicationId <= 0) {
|
|
|
|
if (applicationId <= 0) {
|
|
|
|
throw new ApplicationManagementException(
|
|
|
|
throw new ApplicationManagementException(
|
|
|
|
"Application id could,t be a negative integer. Hence please add " +
|
|
|
|
"Application id could,t be a negative integer. Hence please add " +
|
|
|
|
"valid application id.");
|
|
|
|
"valid application id.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (applicationUuid == null) {
|
|
|
|
if (applicationUuid == null) {
|
|
|
|
throw new ApplicationManagementException("Application UUID is null. Application UUID is a required "
|
|
|
|
throw new ApplicationManagementException("Application UUID is null. Application UUID is a required "
|
|
|
|
+ "parameter to get the relevant application.");
|
|
|
|
+ "parameter to get the relevant application.");
|
|
|
|
}
|
|
|
|
|
|
|
|
ConnectionManagerUtil.openDBConnection();
|
|
|
|
|
|
|
|
applicationRelease = this.applicationReleaseDAO.getReleaseByIds(applicationId, applicationUuid, tenantId);
|
|
|
|
|
|
|
|
if (applicationRelease == null) {
|
|
|
|
|
|
|
|
throw new ApplicationManagementException("Doesn't exist a application release for application ID: " +
|
|
|
|
|
|
|
|
applicationId + "and application UUID: " +
|
|
|
|
|
|
|
|
applicationUuid);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return applicationRelease;
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
|
|
ConnectionManagerUtil.closeDBConnection();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ConnectionManagerUtil.getDBConnection();
|
|
|
|
|
|
|
|
applicationRelease = this.applicationReleaseDAO.getReleaseByIds(applicationId, applicationUuid, tenantId);
|
|
|
|
|
|
|
|
if (applicationRelease == null) {
|
|
|
|
|
|
|
|
throw new ApplicationManagementException("Doesn't exist a application release for application ID: " +
|
|
|
|
|
|
|
|
applicationId + "and application UUID: " +
|
|
|
|
|
|
|
|
applicationUuid);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return applicationRelease;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -703,19 +730,24 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void changeLifecycleState(int applicationId, String applicationUuid, LifecycleState state)
|
|
|
|
public void changeLifecycleState(int applicationId, String applicationUuid, LifecycleState state, Boolean
|
|
|
|
throws ApplicationManagementException {
|
|
|
|
checkExist, int releaseId) throws ApplicationManagementException {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
Application application = getApplicationIfAccessible(applicationId);
|
|
|
|
if (checkExist) {
|
|
|
|
ApplicationRelease applicationRelease = getAppReleaseIfExists(applicationId, applicationUuid);
|
|
|
|
getApplicationIfAccessible(applicationId);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (releaseId < 1) {
|
|
|
|
|
|
|
|
releaseId = getAppReleaseIfExists(applicationId, applicationUuid).getId();
|
|
|
|
|
|
|
|
}
|
|
|
|
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
|
|
|
|
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
|
|
|
|
String userName = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
|
|
|
|
String userName = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
|
|
|
|
state.setUpdatedBy(userName);
|
|
|
|
state.setUpdatedBy(userName);
|
|
|
|
|
|
|
|
|
|
|
|
if (state.getCurrentState() != null && state.getPreviousState() != null) {
|
|
|
|
if (state.getCurrentState() != null && state.getPreviousState() != null) {
|
|
|
|
if (lifecycleStateManger.isValidStateChange(state.getPreviousState(), state.getCurrentState())) {
|
|
|
|
|
|
|
|
|
|
|
|
if (getLifecycleManagementService().isValidStateChange(state.getPreviousState(), state.getCurrentState())) {
|
|
|
|
this.lifecycleStateDAO
|
|
|
|
this.lifecycleStateDAO
|
|
|
|
.addLifecycleState(state, application.getId(), applicationRelease.getId(), tenantId);
|
|
|
|
.addLifecycleState(state, applicationId, releaseId, tenantId);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
log.error("Invalid lifecycle state transition from '" + state.getPreviousState() + "'"
|
|
|
|
log.error("Invalid lifecycle state transition from '" + state.getPreviousState() + "'"
|
|
|
|
+ " to '" + state.getCurrentState() + "'");
|
|
|
|
+ " to '" + state.getCurrentState() + "'");
|
|
|
@ -829,4 +861,16 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return list;
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public LifecycleStateManger getLifecycleManagementService() {
|
|
|
|
|
|
|
|
PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
|
|
|
|
|
|
|
|
LifecycleStateManger deviceManagementProviderService =
|
|
|
|
|
|
|
|
(LifecycleStateManger) ctx.getOSGiService(LifecycleStateManger.class, null);
|
|
|
|
|
|
|
|
if (deviceManagementProviderService == null) {
|
|
|
|
|
|
|
|
String msg = "DeviceImpl Management provider service has not initialized.";
|
|
|
|
|
|
|
|
log.error(msg);
|
|
|
|
|
|
|
|
throw new IllegalStateException(msg);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return deviceManagementProviderService;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|