Tabnine Logo
AlertStreamEvent.getSiteId
Code IndexAdd Tabnine to your IDE (free)

How to use
getSiteId
method
in
org.apache.eagle.alert.engine.model.AlertStreamEvent

Best Java code snippets using org.apache.eagle.alert.engine.model.AlertStreamEvent.getSiteId (Showing top 4 results out of 315)

origin: apache/eagle

  private static VelocityContext buildAlertContext(PolicyDefinition policyDefinition, AlertStreamEvent event) {
    VelocityContext context = new VelocityContext();
    context.put(AlertContextFields.SITE_ID, event.getSiteId());
    context.put(AlertContextFields.STREAM_ID, event.getStreamId());
    context.put(AlertContextFields.ALERT_ID, event.getAlertId());
    context.put(AlertContextFields.CREATED_BY, event.getCreatedBy());
    context.put(AlertContextFields.CREATED_TIMESTAMP, event.getCreatedTime());
    context.put(AlertContextFields.CREATED_TIME,  String.format("%s %s",
        DateTimeUtil.millisecondsToHumanDateWithSeconds(event.getCreatedTime()),
        DateTimeUtil.CURRENT_TIME_ZONE.getID()));
    context.put(AlertContextFields.ALERT_TIMESTAMP, event.getTimestamp());
    context.put(AlertContextFields.ALERT_TIME,  String.format("%s %s",
        DateTimeUtil.millisecondsToHumanDateWithSeconds(event.getTimestamp()),
        DateTimeUtil.CURRENT_TIME_ZONE.getID()));
    context.put(AlertContextFields.ALERT_SCHEMA, event.getSchema());
    context.put(AlertContextFields.ALERT_EVENT, event);

    context.put(AlertContextFields.POLICY_ID, policyDefinition.getName());
    context.put(AlertContextFields.POLICY_DESC, policyDefinition.getDescription());
    context.put(AlertContextFields.POLICY_TYPE, policyDefinition.getDefinition().getType());
    context.put(AlertContextFields.POLICY_DEFINITION, policyDefinition.getDefinition().getValue());
    context.put(AlertContextFields.POLICY_HANDLER, policyDefinition.getDefinition().getHandlerClass());

    for (Map.Entry<String, Object> entry : event.getDataMap().entrySet()) {
      context.put(entry.getKey(), entry.getValue());
    }
    return context;
  }
}
origin: apache/eagle

@Override
public String toString() {
  List<String> dataStrings = new ArrayList<>(this.getData().length);
  for (Object obj : this.getData()) {
    if (obj != null) {
      dataStrings.add(obj.toString());
    } else {
      dataStrings.add(null);
    }
  }
  return String.format("Alert {site=%s, stream=%s,timestamp=%s,data=%s, policyId=%s, createdBy=%s, metaVersion=%s}",
    this.getSiteId(),
    this.getStreamId(), DateTimeUtil.millisecondsToHumanDateWithMilliseconds(this.getTimestamp()),
    this.getDataMap(), this.getPolicyId(), this.getCreatedBy(), this.getMetaVersion());
}
origin: apache/eagle

try {
  alertContext.put(PublishConstants.ALERT_EMAIL_ALERT_DETAIL_URL,
    String.format("%s/#/site/%s/alert/detail/%s?timestamp=%s", rootUrl, event.getSiteId(), URIUtil.encodeQuery(event.getAlertId(), "UTF-8"), event.getTimestamp()));
  alertContext.put(PublishConstants.ALERT_EMAIL_POLICY_DETAIL_URL,
    String.format("%s/#/site/%s/policy/detail/%s", rootUrl, event.getSiteId(), URIUtil.encodeQuery(event.getPolicyId(), "UTF-8")));
} catch (URIException e) {
  LOG.warn(e.getMessage(), e);
  alertContext.put(PublishConstants.ALERT_EMAIL_ALERT_DETAIL_URL,
    String.format("%s/#/site/%s/alert/detail/%s?timestamp=%s", rootUrl, event.getSiteId(), event.getAlertId(), event.getTimestamp()));
  alertContext.put(PublishConstants.ALERT_EMAIL_POLICY_DETAIL_URL,
    String.format("%s/#/site/%s/policy/detail/%s", rootUrl, event.getSiteId(), event.getPolicyId()));
origin: apache/eagle

public AlertStreamEvent(AlertStreamEvent event) {
  this.siteId = event.getSiteId();
  this.alertId = event.getAlertId();
  this.policyId = event.policyId;
  this.schema = event.schema;
  this.createdBy = event.createdBy;
  this.createdTime = event.createdTime;
  this.setTimestamp(event.getTimestamp());
  this.setData(new Object[event.data.length]);
  System.arraycopy(event.data, 0, this.data, 0, event.data.length);
  this.setStreamId(event.getStreamId());
  this.setMetaVersion(event.getMetaVersion());
}
org.apache.eagle.alert.engine.modelAlertStreamEventgetSiteId

Popular methods of AlertStreamEvent

  • ensureAlertId
  • getAlertId
  • getBody
  • getCreatedTime
  • getPolicyId
  • getSubject
  • setData
  • toString
  • <init>
  • getContext
  • getData
  • getDataMap
  • getData,
  • getDataMap,
  • getStreamId,
  • setContext,
  • setCreatedTime,
  • setPolicyId,
  • setSchema,
  • setStreamId,
  • setTimestamp,
  • getCategory

Popular in Java

  • Making http requests using okhttp
  • getExternalFilesDir (Context)
  • requestLocationUpdates (LocationManager)
  • notifyDataSetChanged (ArrayAdapter)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • Menu (java.awt)
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now