| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Portions Copyright 2006 Sun Microsystems, Inc. |
| | | * Portions Copyright 2006-2007 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.monitors; |
| | | |
| | |
| | | import org.opends.server.types.AttributeValue; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | import static org.opends.server.loggers.Debug.*; |
| | | import static org.opends.server.loggers.debug.DebugLogger.debugCought; |
| | | import static org.opends.server.loggers.debug.DebugLogger.debugEnabled; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | |
| | | |
| | | |
| | |
| | | public class SystemInfoMonitorProvider |
| | | extends MonitorProvider |
| | | { |
| | | /** |
| | | * The fully-qualified name of this class for debugging purposes. |
| | | */ |
| | | private static final String CLASS_NAME = |
| | | "org.opends.server.monitors.SystemInfoMonitorProvider"; |
| | | |
| | | |
| | | |
| | |
| | | public void initializeMonitorProvider(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | assert debugEnter(CLASS_NAME, "initializeMonitorProvider", |
| | | String.valueOf(configEntry)); |
| | | |
| | | // No initialization is required. |
| | | } |
| | |
| | | */ |
| | | public String getMonitorInstanceName() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getMonitorInstanceName"); |
| | | |
| | | return "System Information"; |
| | | } |
| | |
| | | */ |
| | | public long getUpdateInterval() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getUpdateInterval"); |
| | | |
| | | // This monitor does not need to run periodically. |
| | | return 0; |
| | |
| | | */ |
| | | public void updateMonitorData() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "updateMonitorData"); |
| | | |
| | | // This monitor does not need to run periodically. |
| | | return; |
| | |
| | | */ |
| | | public ArrayList<Attribute> getMonitorData() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getMonitorData"); |
| | | |
| | | |
| | | ArrayList<Attribute> attrs = new ArrayList<Attribute>(12); |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "getMonitorData", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | */ |
| | | private Attribute createAttribute(String name, String value) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "createAttribute", String.valueOf(name), |
| | | String.valueOf(value)); |
| | | |
| | | AttributeType attrType = DirectoryServer.getDefaultAttributeType(name); |
| | | |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "createAttribute", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | values.add(new AttributeValue(encodedValue, encodedValue)); |
| | | } |