<xs:attribute name="type" type="o:basicTypeT" use="required" />
<xs:attribute name="since" type="o:versionT" use="required" />
<xs:attribute name="plugin" type="xs:string" use="optional" />
+ <xs:attribute name="life" use="optional">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="permanent"/>
+ <xs:enumeration value="volatile"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
return type;
}
+void Action::setLife(ActionRuleLife val)
+{
+ life = val;
+}
+
+Action::ActionRuleLife Action::getLife()
+{
+ return life;
+}
+
Action::ActionRestrict Action::getRestrict()
{
return restriction;
ASYNC
} ActionType;
+ typedef enum {
+ PERMANENT,
+ VOLATILE
+ } ActionRuleLife;
+
Action();
Action(const std::string &ruleName);
virtual ~Action();
bool getStopOnErr();
void setType(ActionType val);
ActionType getType();
+ void setLife(ActionRuleLife val);
+ ActionRuleLife getLife();
void setPlugin(Plugin *pi);
void setPrivilege(const std::string &val);
std::string getPrivilege();
std::string ruleName;
bool isChanged;
ActionType type;
+ ActionRuleLife life;
Plugin *plugin;
PluginAction *piAction;
private:
MODES_NAMESPACE_USE;
+ActionRule::ActionRule()
+ : plugin(nullptr), life(Action::PERMANENT)
+{
+}
+
std::string ActionRule::getName()
{
return ruleName;
{
privilege = priv;
}
+
+void ActionRule::setLife(Action::ActionRuleLife val)
+{
+ life = val;
+}
class ActionRule {
public:
+ ActionRule();
virtual ~ActionRule() = default;
std::string getName();
Plugin* getPlugin();
void setPlugin(Plugin *pi);
void setPrivilege(const std::string &priv);
+ void setLife(Action::ActionRuleLife val);
virtual Action* makeAction() = 0;
virtual int addAlias(const std::string &alias, const std::string &value) = 0;
protected:
std::string ruleName;
std::string privilege;
Plugin *plugin;
+ Action::ActionRuleLife life;
private:
// TODO:: handle conflict List, since, description, version
//std::list<std::string> conflictActionList;
(xmlChar*)"name",
(xmlChar*)"type",
(xmlChar*)"plugin",
+ (xmlChar*)"life",
(xmlChar*)"alias",
(xmlChar*)"conflict",
(xmlChar*)"privilege",
{
string type, name, pluginName;
ActionRule *actionRule = NULL;
+ Action::ActionRuleLife life = Action::PERMANENT;
try {
name = XMLParser::extractValueOfTag(node, RULE_TAGS[TagAttName]);
type = XMLParser::extractValueOfTag(node, RULE_TAGS[TagAttType]);
pluginName = XMLParser::extractValueOfTag(node, RULE_TAGS[TagAttPlugin]);
+ if (XMLParser::extractValueOfTag(node, RULE_TAGS[TagAttLife]) == "")
+ life = Action::VOLATILE;
} catch (ModesEx &e) {
ERR("extractValueOfTag() Fail(%s)", e.what());
throw;
}
actionRule->setPlugin(plugin);
+ actionRule->setLife(life);
for (xmlNode *cur = node->children; cur; cur = cur->next) {
if (xmlIsBlankNode(cur))
continue;
TagAttName,
TagAttType,
TagAttPlugin,
+ TagAttLife,
TagElemAlias,
TagElemConflict,
TagElemPrivilege,
action->setValueAliases(valueAliasList);
action->setPrivilege(privilege);
action->setPlugin(plugin);
+ action->setLife(life);
return action;
}
std::list<std::shared_ptr<Action>> actionList = mode.getActionList();
for (auto it = actionList.begin(); it != actionList.end(); it++) {
- if ((*it)->backupUndoInfo().empty())
+ if ((*it)->getLife() == Action::VOLATILE || (*it)->backupUndoInfo().empty())
continue;
xmlNodePtr infoNode = xmlNewNode(NULL, ModesXMLTag::INFO);