Codota Logo
EventBuilder.setUei
Code IndexAdd Codota to your IDE (free)

How to use
setUei
method
in
org.opennms.netmgt.model.events.EventBuilder

Best Java code snippets using org.opennms.netmgt.model.events.EventBuilder.setUei (Showing top 6 results out of 315)

  • Common ways to obtain EventBuilder
private void myMethod () {
EventBuilder e =
  • Codota IconString uei;String str;new EventBuilder(uei, str)
  • Codota IconString uei;String source;new EventBuilder(uei, source)
  • Smart code suggestions by Codota
}
origin: OpenNMS/opennms

@Override
public void reloadConfig() {
  EventBuilder ebldr = new EventBuilder(EventConstants.RELOAD_DAEMON_CONFIG_SUCCESSFUL_UEI, getName());
  ebldr.addParam(EventConstants.PARM_DAEMON_NAME, "DroolsCorrelationEngine-" + m_name);
  try {
    LOG.info("Reloading configuration for engine {}", m_name);
    EngineConfiguration cfg = JaxbUtils.unmarshal(EngineConfiguration.class, m_configPath);
    Optional<RuleSet> opt = cfg.getRuleSetCollection().stream().filter(rs -> rs.getName().equals(getName())).findFirst();
    if (opt.isPresent()) {
      marshallStateToDisk(true);
      opt.get().updateEngine(this);
      initialize();
    } else {
      ebldr.setUei(EventConstants.RELOAD_DAEMON_CONFIG_FAILED_UEI);
      ebldr.addParam(EventConstants.PARM_REASON, "RuleSet not found on " + m_configPath);
    }
  } catch (Exception e) {
    ebldr.setUei(EventConstants.RELOAD_DAEMON_CONFIG_FAILED_UEI);
    ebldr.addParam(EventConstants.PARM_REASON, e.getMessage());
  } finally {
    sendEvent(ebldr.getEvent());
  }
}
origin: OpenNMS/opennms

/**
 * <p>Constructor for EventBuilder.</p>
 *
 * @param uei a {@link java.lang.String} object.
 * @param source a {@link java.lang.String} object.
 * @param date a {@link java.util.Date} object.
 */
public EventBuilder(final String uei, final String source, final Date date) {
  m_event = new Event();
  setUei(uei);
  setTime(date);
  setSource(source);
  checkForIllegalUei();
}
origin: org.opennms/drools-correlation-engine

@Override
public void reloadConfig() {
  EventBuilder ebldr = new EventBuilder(EventConstants.RELOAD_DAEMON_CONFIG_SUCCESSFUL_UEI, getName());
  ebldr.addParam(EventConstants.PARM_DAEMON_NAME, "DroolsCorrelationEngine-" + m_name);
  try {
    LOG.info("Reloading configuration for engine {}", m_name);
    EngineConfiguration cfg = JaxbUtils.unmarshal(EngineConfiguration.class, m_configPath);
    Optional<RuleSet> opt = cfg.getRuleSetCollection().stream().filter(rs -> rs.getName().equals(getName())).findFirst();
    if (opt.isPresent()) {
      marshallStateToDisk(true);
      opt.get().updateEngine(this);
      initialize();
    } else {
      ebldr.setUei(EventConstants.RELOAD_DAEMON_CONFIG_FAILED_UEI);
      ebldr.addParam(EventConstants.PARM_REASON, "RuleSet not found on " + m_configPath);
    }
  } catch (Exception e) {
    ebldr.setUei(EventConstants.RELOAD_DAEMON_CONFIG_FAILED_UEI);
    ebldr.addParam(EventConstants.PARM_REASON, e.getMessage());
  } finally {
    sendEvent(ebldr.getEvent());
  }
}
origin: OpenNMS/opennms

/**
 * Checks the message for substring matches to a {@link UeiMatch}. If the message
 * matches, then the UEI is updated (or the event is discarded if the discard
 * UEI is used). Parameter assignments are NOT performed for substring matches.
 * 
 * @param message
 * @param uei
 * @param bldr
 * @param discardUei
 * @return
 * @throws MessageDiscardedException
 */
private static boolean matchSubstring(String message, final UeiMatch uei, final EventBuilder bldr, final String discardUei) throws MessageDiscardedException {
  final boolean traceEnabled = LOG.isTraceEnabled();
  if (message.contains(uei.getMatch().getExpression())) {
    if (discardUei.equals(uei.getUei())) {
      if (traceEnabled) LOG.trace("Specified UEI '{}' is same as discard-uei, discarding this message.", uei.getUei());
      throw new MessageDiscardedException();
    } else {
      // Update the UEI to the new value
      if (traceEnabled) LOG.trace("Changed the UEI of a Syslogd event, based on substring match, to : {}", uei.getUei());
      bldr.setUei(uei.getUei());
      return true;
    }
  } else {
    if (traceEnabled) LOG.trace("No substring match for text of a Syslogd event to : {}", uei.getMatch().getExpression());
    return false;
  }
}
origin: OpenNMS/opennms

bldr.setUei(uei.getUei());
origin: OpenNMS/opennms

bldr.setUei("uei.opennms.org/syslogd/" + facilityTxt + "/" + priorityTxt);
bldr.setSource("syslogd");
org.opennms.netmgt.model.eventsEventBuildersetUei

Popular methods of EventBuilder

  • <init>
    Constructor for EventBuilder.
  • getEvent
  • addParam
  • setInterface
  • setNodeid
  • setTime
  • setService
  • setHost
  • setSeverity
  • setLogMessage
    setLogMessage
  • setIfIndex
  • setParam
    setParam
  • setIfIndex,
  • setParam,
  • setAlarmData,
  • setDescription,
  • setDistPoller,
  • setField,
  • setIpInterface,
  • setLogDest,
  • setParms

Popular in Java

  • Finding current android device location
  • startActivity (Activity)
  • onCreateOptionsMenu (Activity)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • ArrayList (java.util)
    Resizable-array implementation of the List interface. Implements all optional list operations, and p
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • DataSource (javax.sql)
    A factory for connections to the physical data source that this DataSource object represents. An alt
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now