Allow dynamic control of operations

4.x.x
Charitha Goonetilleke 4 years ago
parent c5e26804dc
commit a16c82bebd

@ -22,6 +22,10 @@ public class CommandOperation extends Operation {
private boolean enabled;
public CommandOperation() {
setControl(Control.NO_REPEAT);
}
public boolean isEnabled() {
return enabled;
}
@ -34,8 +38,4 @@ public class CommandOperation extends Operation {
return Type.COMMAND;
}
public Control getControl(){
return Control.NO_REPEAT;
}
}

@ -23,10 +23,11 @@ import java.util.List;
public class ConfigOperation extends Operation {
private List<Property> properties;
private final List<Property> properties;
public ConfigOperation() {
properties = new ArrayList<Property>();
properties = new ArrayList<>();
setControl(Control.REPEAT);
}
public List<Property> getConfigProperties() {
@ -37,6 +38,10 @@ public class ConfigOperation extends Operation {
properties.add(new Property(name, value, type));
}
public Type getType() {
return Type.CONFIG;
}
public static class Property {
private String name;
private Object value;
@ -73,13 +78,4 @@ public class ConfigOperation extends Operation {
}
}
public Type getType() {
return Type.CONFIG;
}
public Control getControl(){
return Control.REPEAT;
}
}

@ -19,7 +19,13 @@ package org.wso2.carbon.device.mgt.core.dto.operation.mgt;
import java.util.List;
public class PolicyOperation extends Operation{
public class PolicyOperation extends Operation {
private List<ProfileOperation> profileOperations;
public PolicyOperation() {
setControl(Control.REPEAT);
}
public List<ProfileOperation> getProfileOperations() {
return profileOperations;
@ -29,10 +35,4 @@ public class PolicyOperation extends Operation{
this.profileOperations = profileOperations;
}
private List<ProfileOperation> profileOperations;
public Control getControl(){
return Control.REPEAT;
}
}

@ -22,13 +22,12 @@ import java.io.Serializable;
public class ProfileOperation extends ConfigOperation implements Serializable {
public Type getType() {
return Type.PROFILE;
public ProfileOperation() {
super();
}
public Control getControl(){
return Control.REPEAT;
public Type getType() {
return Type.PROFILE;
}
}

@ -24,6 +24,10 @@ public class CommandOperation extends Operation {
private boolean enabled;
public CommandOperation() {
setControl(Control.NO_REPEAT);
}
public boolean isEnabled() {
return enabled;
}
@ -35,8 +39,5 @@ public class CommandOperation extends Operation {
public Type getType() {
return Type.COMMAND;
}
public Control getControl(){
return Control.NO_REPEAT;
}
}

@ -21,8 +21,6 @@ package org.wso2.carbon.device.mgt.core.operation.mgt;
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
public class ConfigOperation extends Operation {
@ -38,6 +36,15 @@ public class ConfigOperation extends Operation {
properties.add(new Property(name, value, type));
}*/
public ConfigOperation() {
//properties = new ArrayList<>();
setControl(Control.REPEAT);
}
public Type getType() {
return Type.CONFIG;
}
public static class Property implements Serializable {
private String name;
private Object value;
@ -74,12 +81,4 @@ public class ConfigOperation extends Operation {
}
}
public Type getType() {
return Type.CONFIG;
}
public Control getControl(){
return Control.REPEAT;
}
}

@ -18,6 +18,7 @@
package org.wso2.carbon.device.mgt.core.operation.mgt;
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
import java.util.List;
public class PolicyOperation extends Operation {
@ -25,6 +26,10 @@ public class PolicyOperation extends Operation {
public static final String POLICY_OPERATION_CODE = "POLICY_BUNDLE";
private List<ProfileOperation> profileOperations;
public PolicyOperation() {
setControl(Control.REPEAT);
}
public List<ProfileOperation> getProfileOperations() {
return profileOperations;
}
@ -33,8 +38,4 @@ public class PolicyOperation extends Operation {
this.profileOperations = profileOperations;
}
public Control getControl(){
return Control.REPEAT;
}
}

@ -19,21 +19,21 @@
package org.wso2.carbon.device.mgt.core.operation.mgt;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
public class ProfileOperation extends ConfigOperation implements Serializable {
private static final long serialVersionUID = -3322674908775087365L;
private List<Integer> correctiveActionIds;
private List<Integer> reactiveActionIds;
public Type getType() {
return Type.PROFILE;
public ProfileOperation() {
super();
}
public Control getControl(){
return Control.REPEAT;
public Type getType() {
return Type.PROFILE;
}
public List<Integer> getCorrectiveActionIds() {
@ -51,4 +51,5 @@ public class ProfileOperation extends ConfigOperation implements Serializable {
public void setReactiveActionIds(List<Integer> reactiveActionIds) {
this.reactiveActionIds = reactiveActionIds;
}
}

Loading…
Cancel
Save