/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at legal-notices/CDDLv1_0.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2006-2010 Sun Microsystems, Inc.
* Portions Copyright 2014-2015 ForgeRock AS
*/
/**
* This class implements a monitor provider that will report generic information
* for an enabled Directory Server backend, including its backend ID, base DNs,
* writability mode, and the number of entries it contains.
*/
public class BackendMonitor
extends MonitorProvider<MonitorProviderCfg>
{
/** The attribute type that will be used to report the backend ID. */
/** The attribute type that will be used to report the set of base DNs. */
/** The attribute type that will be used to report the number of entries. */
/** The attribute type that will be used to report the number of entries per base DN. */
/** The attribute type that will be used to indicate if a backend is private. */
/** The attribute type that will be used to report the writability mode. */
/** The backend with which this monitor is associated. */
/** The name for this monitor. */
/**
* Creates a new instance of this backend monitor provider that will work with
* the provided backend. Most of the initialization should be handled in the
* {@code initializeMonitorProvider} method.
*
* @param backend The backend with which this monitor is associated.
*/
{
}
{
writabilityModeType = DirectoryServer.getAttributeTypeOrDefault(ATTR_MONITOR_BACKEND_WRITABILITY_MODE);
}
{
return monitorName;
}
/**
* Retrieves the objectclass that should be included in the monitor entry
* created from this monitor provider.
*
* @return The objectclass that should be included in the monitor entry
* created from this monitor provider.
*/
{
}
{
.valueOf(backendCount)));
{
{
long entryCount = -1;
try
{
}
{
}
}
}
else
{
// This is done to avoid recalculating the number of entries
// using the numSubordinates method in the case where the
// backend has a single base DN.
}
return attrs;
}
}