add new methods to check whether the app is updatable or installable in a given state

4.x.x
Gathika94 6 years ago
parent bb808fd9e3
commit f714feb239

@ -21,7 +21,8 @@ package org.wso2.carbon.device.application.mgt.common;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ApiModel(value = "ApplicationRelease", description = "This class holds the details when releasing an Application to application store")
@ApiModel(value = "ApplicationRelease", description = "This class holds the details when releasing an Application to " +
"application store")
public class ApplicationRelease {
@ApiModelProperty(name = "id",

@ -16,10 +16,9 @@
* under the License.
*/
/*
* Copyright (c) 2019, Entgra Inc. (http://www.entgra.io) All Rights Reserved.
/* Copyright (c) 2019, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
*
* Entgra Inc. licenses this file to you under the Apache License,
* Entgra (Pvt) Ltd. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
@ -153,4 +152,20 @@ public class LifecycleStateManger {
}
return null;
}
public boolean isUpdatable(String state){
State currentState = getMatchingState(state);
if(currentState.getIsAppUpdatable()){
return true;
}
return false;
}
public boolean isInstallable(String state){
State currentState = getMatchingState(state);
if(currentState.getIsAppInstallable()){
return true;
}
return false;
}
}

Loading…
Cancel
Save