本文整理了Java中org.opennms.netmgt.xml.event.Event.addParm()
方法的一些代码示例,展示了Event.addParm()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Event.addParm()
方法的具体详情如下:
包路径:org.opennms.netmgt.xml.event.Event
类名称:Event
方法名:addParm
暂无
代码示例来源:origin: OpenNMS/opennms
public EventBuilder addParam(final Parm parm) {
m_event.addParm(parm);
return this;
}
代码示例来源:origin: OpenNMS/opennms
private void sendRearmForTriggeredStates() {
for (String instance : m_thresholdEvaluatorStates.keySet()) {
for (ThresholdEvaluatorState state : m_thresholdEvaluatorStates.get(instance)) {
if (state.isTriggered()) {
Event e = state.getEventForState(Status.RE_ARMED, new Date(), Double.NaN, null);
Parm p = new Parm();
p.setParmName("reason");
Value v = new Value();
v.setContent("Configuration has been changed");
p.setValue(v);
e.addParm(p);
LOG.info("sendRearmForTriggeredStates: sending rearm for {}", e);
ThresholdingEventProxyFactory.getFactory().getProxy().add(e);
state.clearState();
}
}
}
}
代码示例来源:origin: OpenNMS/opennms
@Override
protected void setValue(Event targetEvent, String value) {
if (value == null) {
LOG.debug("Value of parameter is null setting to blank");
value="";
}
for (final Parm parm : targetEvent.getParmCollection()) {
if (parm.getParmName().equals(getAttributeName())) {
org.opennms.netmgt.xml.event.Value val = parm.getValue();
if (val == null) {
val = new org.opennms.netmgt.xml.event.Value();
parm.setValue(val);
}
LOG.debug("Overriding value of parameter {}. Setting it to {}", value, getAttributeName());
val.setContent(value);
return;
}
}
// if we got here then we didn't find the existing parameter
Parm newParm = new Parm();
newParm.setParmName(getAttributeName());
org.opennms.netmgt.xml.event.Value val = new org.opennms.netmgt.xml.event.Value();
newParm.setValue(val);
LOG.debug("Setting value of parameter {} to {}", value, getAttributeName());
val.setContent(value);
targetEvent.addParm(newParm);
}
}
代码示例来源:origin: OpenNMS/opennms
v.setExpand(p.getExpand());
parm.setValue(v);
e.addParm(parm);
} else {
LOG.warn("expandEvent: the event {} already has a parameter named {}, the original content will be preserved. Check the event definition and rename the optional parameter.", e.getUei(),p.getName());
代码示例来源:origin: org.opennms.features.events/org.opennms.features.events.daemon
v.setExpand(p.getExpand());
parm.setValue(v);
e.addParm(parm);
} else {
LOG.warn("expandEvent: the event {} already has a parameter named {}, the original content will be preserved. Check the event definition and rename the optional parameter.", e.getUei(),p.getName());
内容来源于网络,如有侵权,请联系作者删除!