Permalink
Browse files

Remove internal enabled flag from API. Active flag is used from now on.

  • Loading branch information...
1 parent 0bf5019 commit 4babc5689450ce5676745dfefaf8f8d2b54c9b86 Ryan Morgan committed May 6, 2009
@@ -55,7 +55,6 @@ public class AlertdefinitionController extends ApiController {
description: d.description,
priority: d.priority,
active: d.active,
- enabled: d.enabled,
frequency: d.frequencyType,
count: d.count,
range: d.range,
@@ -324,7 +323,7 @@ public class AlertdefinitionController extends ApiController {
// Required attributes, basically everything but description
['controlFiltered', 'notifyFiltered', 'willRecover', 'range', 'count',
- 'frequency', 'enabled', 'active', 'priority',
+ 'frequency', 'active', 'priority',
'name'].each { attr ->
if (xmlDef."@${attr}" == null) {
failureXml = getFailureXML(ErrorCode.INVALID_PARAMETERS,
@@ -402,7 +401,6 @@ public class AlertdefinitionController extends ApiController {
adv.appdefType = aeid.type
adv.appdefId = aeid.id
adv.priority = xmlDef.'@priority'?.toInteger()
- adv.enabled = xmlDef.'@enabled'.toBoolean()
adv.active = xmlDef.'@active'.toBoolean()
adv.willRecover = xmlDef.'@willRecover'.toBoolean()
adv.notifyFiltered = xmlDef.'@notifyFiltered'?.toBoolean()
@@ -252,13 +252,13 @@ public void testSyncControlFiltered() throws Exception {
cleanup(response.getAlertDefinition());
}
- public void testSyncEnable() throws Exception {
+ public void testSyncActive() throws Exception {
AlertDefinitionApi api = getApi().getAlertDefinitionApi();
Resource platform = getLocalPlatformResource(false, false);
AlertDefinition d = generateTestDefinition();
- d.setEnabled(false);
+ d.setActive(false);
d.setResource(platform);
d.getAlertCondition().add(AlertDefinitionBuilder.createPropertyCondition(true, "myProp"));
List<AlertDefinition> definitions = new ArrayList<AlertDefinition>();
@@ -270,9 +270,9 @@ public void testSyncEnable() throws Exception {
assertEquals(response.getAlertDefinition().size(), 1);
d = response.getAlertDefinition().get(0);
validateDefinition(d);
- assertTrue("Enabled is not false", !d.isEnabled());
+ assertTrue("Enabled is not false", !d.isActive());
- d.setEnabled(true);
+ d.setActive(true);
definitions.clear();
definitions.add(d);
response = api.syncAlertDefinitions(definitions);
@@ -281,7 +281,7 @@ public void testSyncEnable() throws Exception {
assertEquals(response.getAlertDefinition().size(), 1);
d = response.getAlertDefinition().get(0);
validateDefinition(d);
- assertTrue("Enabled is not true", d.isEnabled());
+ assertTrue("Enabled is not true", d.isActive());
// Cleanup
cleanup(response.getAlertDefinition());
@@ -22,7 +22,7 @@ protected AlertDefinition generateTestDefinition() {
d.setName("Test Alert Definition" + r.nextInt());
d.setDescription("Test Alert Description");
d.setPriority(AlertPriority.MEDIUM.getPriority());
- d.setEnabled(true);
+ d.setActive(true);
return d;
}
View
@@ -51,7 +51,6 @@
<xs:attribute name="parent" type="xs:int" use="optional" />
<xs:attribute name="priority" type="xs:int" use="required" />
<xs:attribute name="active" type="xs:boolean" use="required" />
- <xs:attribute name="enabled" type="xs:boolean" use="required" />
<xs:attribute name="frequency" type="xs:int" use="required" />
<xs:attribute name="count" type="xs:int" use="required" />
<xs:attribute name="range" type="xs:int" use="required" />

0 comments on commit 4babc56

Please sign in to comment.