/*******************************************************************************
 * Copyright (c), 2001, 2002 N2 Broadband, Inc.  All Rights Reserved.
 *
 * This module contains unpublished, confidential, proprietary
 * material.  The use and dissemination of this material are
 * governed by a license.  The above copyright notice does not
 * evidence any actual or intended publication of this material.
 *
 * Author:  Drake H. Henderson
 * Created:  11-12-01
 *
 ******************************************************************************/

package com.n2bb.sysmonui.alerts;

import com.n2bb.sysmonui.util.SMUtility;

public class AlertDataBean {
  
  private String alertIdentifier = null;
  private String alertPattern = null;
  private int thresholdCount;
  private int thresholdSecs;
  private int frequencyCount;
  private int frequencySecs;
  private String email = null;
  private String snmp = null;

  public String getAlertIdentifier() {
    return alertIdentifier == null ? "": alertIdentifier;
  }

  public String getAlertPattern() {
    return alertPattern == null ? "" : alertPattern;
  }

  public int getThresholdCount() {
    return thresholdCount;
  }

  public int getThresholdSecs() {
    return thresholdSecs;
  }

  public int getFrequencyCount() {
    return frequencyCount;
  }

  public int getFrequencySecs() {
    return frequencySecs;
  }

  public String getEmail() {
    return email == null ? "" : email;
  }

  public String getSNMP() {
    return snmp == null ? "" : snmp;
  }

  public void setAlertIdentifier(String alertIdentifier) {
    this.alertIdentifier = alertIdentifier;
  }

  public void setAlertPattern(String alertPattern) {
    this.alertPattern = alertPattern;
  }

  public void setThresholdCount(int thresholdCount) {
    this.thresholdCount = thresholdCount;
  }

  public void setThresholdSecs(int thresholdSecs) {
    this.thresholdSecs = thresholdSecs;
  }

  public void setFrequencyCount(int frequencyCount) {
    this.frequencyCount = frequencyCount;
  }

  public void setFrequencySecs(int frequencySecs) {
    this.frequencySecs = frequencySecs;
  }

  public void setEmail(String email) {
    this.email = email;
  }

  public void setSNMP(String snmp) {
    this.snmp = snmp;
  }
  
  public String getFormattedThreshold() {
    return SMUtility.formatAlertFrequency(getThresholdCount(), getThresholdSecs());
  }

  public String getFormattedFrequency() {
    return SMUtility.formatAlertFrequency(getFrequencyCount(), getFrequencySecs());
  }
  
}

