001: /*
002: * JBoss, Home of Professional Open Source.
003: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
004: * as indicated by the @author tags. See the copyright.txt file in the
005: * distribution for a full listing of individual contributors.
006: *
007: * This is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU Lesser General Public License as
009: * published by the Free Software Foundation; either version 2.1 of
010: * the License, or (at your option) any later version.
011: *
012: * This software is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this software; if not, write to the Free
019: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021: */
022: package org.jboss.monitor.services;
023:
024: import javax.management.ObjectName;
025:
026: import org.jboss.monitor.alarm.AlarmTableNotification;
027: import org.jboss.mx.util.ObjectNameFactory;
028: import org.jboss.system.ListenerServiceMBean;
029:
030: /**
031: * MBean interface.
032: *
033: * @author <a href="mailto:dimitris@jboss.org">Dimitris Andreadis</a>
034: * @version $Revision: 57210 $
035: */
036: public interface ActiveAlarmTableMBean extends ListenerServiceMBean {
037: ObjectName OBJECT_NAME = ObjectNameFactory
038: .create("jboss.monitor:service=ActiveAlarmTable");
039:
040: // Attributes ----------------------------------------------------
041:
042: /**
043: * The unique serverId
044: */
045: void setServerId(String serverId);
046:
047: String getServerId();
048:
049: /**
050: * The dynamic log level
051: */
052: void setLogLevel(String logLevel);
053:
054: String getLogLevel();
055:
056: /**
057: * The maximum number of alarms to keep, use -1 to disable
058: */
059: void setMaxTableSize(int maxSize);
060:
061: int getMaxTableSize();
062:
063: /**
064: * Number of notifications received.
065: */
066: long getNotificationsReceived();
067:
068: /**
069: * Number of active alarms in the table
070: */
071: int getActiveAlarmCount();
072:
073: // Operations ----------------------------------------------------
074:
075: /**
076: * Acknowledge all alarms
077: * @return number of acknowledged alarms
078: */
079: int acknowledgeAll(String user, String system);
080:
081: /**
082: * Uncknowledge all alarms
083: * @return number of unacknowledged alarms
084: */
085: int unacknowledgeAll(String user, String system);
086:
087: /**
088: * Acknowledge an Alarm
089: * @return true if ack was succesful, false otherwise (not in table or acked already)
090: */
091: boolean acknowledge(String alarmId, String user, String system);
092:
093: /**
094: * Unacknowledge an Alarm
095: * @return true if unack was succesful, false otherwise (not in table or unacked already)
096: */
097: boolean unacknowledge(String alarmId, String user, String system);
098:
099: /**
100: * Gets the ActiveAlarmTable
101: */
102: AlarmTableNotification[] fetchAlarmTable();
103:
104: /**
105: * Gets the ActiveAlarmTable as Html
106: */
107: String fetchAlarmTableAsHtml();
108:
109: }
|