001/*
002 * Copyright 2008-2024 Ping Identity Corporation
003 * All Rights Reserved.
004 */
005/*
006 * Copyright 2008-2024 Ping Identity Corporation
007 *
008 * Licensed under the Apache License, Version 2.0 (the "License");
009 * you may not use this file except in compliance with the License.
010 * You may obtain a copy of the License at
011 *
012 *    http://www.apache.org/licenses/LICENSE-2.0
013 *
014 * Unless required by applicable law or agreed to in writing, software
015 * distributed under the License is distributed on an "AS IS" BASIS,
016 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017 * See the License for the specific language governing permissions and
018 * limitations under the License.
019 */
020/*
021 * Copyright (C) 2008-2024 Ping Identity Corporation
022 *
023 * This program is free software; you can redistribute it and/or modify
024 * it under the terms of the GNU General Public License (GPLv2 only)
025 * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
026 * as published by the Free Software Foundation.
027 *
028 * This program is distributed in the hope that it will be useful,
029 * but WITHOUT ANY WARRANTY; without even the implied warranty of
030 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
031 * GNU General Public License for more details.
032 *
033 * You should have received a copy of the GNU General Public License
034 * along with this program; if not, see <http://www.gnu.org/licenses>.
035 */
036package com.unboundid.ldap.sdk.unboundidds.monitors;
037
038
039
040import java.util.Collections;
041import java.util.Date;
042import java.util.LinkedHashMap;
043import java.util.List;
044import java.util.Map;
045
046import com.unboundid.ldap.sdk.Entry;
047import com.unboundid.util.NotMutable;
048import com.unboundid.util.NotNull;
049import com.unboundid.util.Nullable;
050import com.unboundid.util.StaticUtils;
051import com.unboundid.util.ThreadSafety;
052import com.unboundid.util.ThreadSafetyLevel;
053
054import static com.unboundid.ldap.sdk.unboundidds.monitors.MonitorMessages.*;
055
056
057
058/**
059 * This class defines a monitor entry that provides general information about
060 * the state of the Directory Server.  The general monitor entry is the
061 * top-level monitor entry that is generated by the monitor backend and is the
062 * parent of all monitor entries generated by the registered monitor providers.
063 * <BR>
064 * <BLOCKQUOTE>
065 *   <B>NOTE:</B>  This class, and other classes within the
066 *   {@code com.unboundid.ldap.sdk.unboundidds} package structure, are only
067 *   supported for use against Ping Identity, UnboundID, and
068 *   Nokia/Alcatel-Lucent 8661 server products.  These classes provide support
069 *   for proprietary functionality or for external specifications that are not
070 *   considered stable or mature enough to be guaranteed to work in an
071 *   interoperable way with other types of LDAP servers.
072 * </BLOCKQUOTE>
073 * <BR>
074 * Information that may be included in the general monitor entry includes:
075 * <UL>
076 *   <LI>The number of connections currently established to the server.</LI>
077 *   <LI>The maximum number of connections that have been established at any one
078 *       time.</LI>
079 *   <LI>The total number of connections established to the server since
080 *       startup.</LI>
081 *   <LI>The time that the directory server was started.</LI>
082 *   <LI>The current time on the server.</LI>
083 *   <LI>The length of time in milliseconds that the server has been
084 *       online.</LI>
085 *   <LI>A user-friendly string that describes the length of time that the
086 *       server has been online.</LI>
087 *   <LI>The name of the directory server product.</LI>
088 *   <LI>The name of the vendor that provides the directory server.</LI>
089 *   <LI>The server version string.</LI>
090 *   <LI>The DNs of the configuration entries for any third-party extensions
091 *       loaded in the server.</LI>
092 * </UL>
093 * The server should present at most one general monitor entry.  It can be
094 * retrieved using the {@link MonitorManager#getGeneralMonitorEntry} method.
095 * This entry provides specific methods for accessing information about the
096 * server (e.g., the
097 * {@link GeneralMonitorEntry#getCurrentConnections} method can be used
098 * to retrieve the number of connections currently established).  Alternately,
099 * this information may be accessed using the generic API.  See the
100 * {@link MonitorManager} class documentation for an example that demonstrates
101 * the use of the generic API for accessing monitor data.
102 */
103@NotMutable()
104@ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE)
105public final class GeneralMonitorEntry
106       extends MonitorEntry
107{
108  /**
109   * The structural object class used in general monitor entries.
110   */
111  @NotNull static final String GENERAL_MONITOR_OC = "ds-general-monitor-entry";
112
113
114
115  /**
116   * The name of the attribute that contains the name of the cluster in which
117   * the server is a member.
118   */
119  @NotNull private static final String ATTR_CLUSTER_NAME = "clusterName";
120
121
122
123  /**
124   * The name of the attribute that contains the number of connections currently
125   * established to the server.
126   */
127  @NotNull private static final String ATTR_CURRENT_CONNECTIONS =
128       "currentConnections";
129
130
131
132  /**
133   * The name of the attribute that contains the Directory Server's current
134   * time.
135   */
136  @NotNull private static final String ATTR_CURRENT_TIME = "currentTime";
137
138
139
140  /**
141   * The name of the attribute that contains the names of any alert types that
142   * have caused the server to be classified as "degraded".
143   */
144  @NotNull private static final String ATTR_DEGRADED_ALERT_TYPE =
145       "degraded-alert-type";
146
147
148
149  /**
150   * The name of the attribute that contains the server instance name.
151   */
152  @NotNull private static final String ATTR_INSTANCE_NAME = "instanceName";
153
154
155
156  /**
157   * The name of the attribute that contains the DN of the server's location
158   * config entry.
159   */
160  @NotNull private static final String ATTR_LOCATION_DN = "locationDN";
161
162
163
164  /**
165   * The name of the attribute that contains the name of the server's location
166   * config entry.
167   */
168  @NotNull private static final String ATTR_LOCATION_NAME = "locationName";
169
170
171
172  /**
173   * The name of the attribute that contains the maximum number of concurrent
174   * client connections established since startup.
175   */
176  @NotNull private static final String ATTR_MAX_CONNECTIONS = "maxConnections";
177
178
179
180  /**
181   * The name of the attribute that contains the Directory Server product name.
182   */
183  @NotNull private static final String ATTR_PRODUCT_NAME = "productName";
184
185
186
187  /**
188   * The name of the attribute that contains the UUID value that was generated
189   * when the server instance was initially created.
190   */
191  @NotNull private static final String ATTR_SERVER_UUID = "serverUUID";
192
193
194
195  /**
196   * The name of the attribute that contains the Directory Server start time.
197   */
198  @NotNull private static final String ATTR_START_TIME = "startTime";
199
200
201
202  /**
203   * The name of the attribute that contains the Directory Server startup ID.
204   */
205  @NotNull private static final String ATTR_STARTUP_ID = "startupID";
206
207
208
209  /**
210   * The name of the attribute that contains the Directory Server startup UUID.
211   */
212  @NotNull private static final String ATTR_STARTUP_UUID = "startupUUID";
213
214
215
216  /**
217   * The name of the attribute that holds the DNs of the configuration entries
218   * for any third-party extensions loaded in the server.
219   */
220  @NotNull private static final String ATTR_THIRD_PARTY_EXTENSION_DN =
221       "thirdPartyExtensionDN";
222
223
224
225  /**
226   * The name of the attribute that contains the total number of connections
227   * that have been established since startup.
228   */
229  @NotNull private static final String ATTR_TOTAL_CONNECTIONS =
230       "totalConnections";
231
232
233
234  /**
235   * The name of the attribute that contains the Directory Server's uptime.
236   */
237  @NotNull private static final String ATTR_UP_TIME = "upTime";
238
239
240
241  /**
242   * The name of the attribute that contains the Directory Server vendor name.
243   */
244  @NotNull private static final String ATTR_VENDOR_NAME = "productVendor";
245
246
247
248  /**
249   * The name of the attribute that contains the Directory Server version
250   * string.
251   */
252  @NotNull private static final String ATTR_VERSION = "productVersion";
253
254
255
256  /**
257   * The name of the attribute that contains the names of any alert types that
258   * have caused the server to be classified as "unavailable".
259   */
260  @NotNull private static final String ATTR_UNAVAILABLE_ALERT_TYPE =
261       "unavailable-alert-type";
262
263
264
265  /**
266   * The serial version UID for this serializable class.
267   */
268  private static final long serialVersionUID = 4262569940859462743L;
269
270
271
272  // The server's current time.
273  @Nullable private final Date currentTime;
274
275  // The server's start time.
276  @Nullable private final Date startTime;
277
278  // The names of the alert types that have caused the server to be classified
279  // as "degraded".
280  @NotNull private final List<String> degradedAlertTypes;
281
282  // The DNs of the config entries for any third-party extensions loaded in the
283  // server.
284  @NotNull private final List<String> thirdPartyExtensionDNs;
285
286  // The names of the alert types that have caused the server to be classified
287  // as "unavailable".
288  @NotNull private final List<String> unavailableAlertTypes;
289
290  // The number connections currently established.
291  @Nullable private final Long currentConnections;
292
293  // The maximum number connections established at any time since startup.
294  @Nullable private final Long maxConnections;
295
296  // The total number of connections that have been established since startup.
297  @Nullable private final Long totalConnections;
298
299  // The Directory Server cluster name.
300  @Nullable private final String clusterName;
301
302  // The Directory Server instance name.
303  @Nullable private final String instanceName;
304
305  // The DN of the Directory Server's location config entry.
306  @Nullable private final String locationDN;
307
308  // The name of the Directory Server's location config entry.
309  @Nullable private final String locationName;
310
311  // The Directory Server product name.
312  @Nullable private final String productName;
313
314  // The UUID value that was generated when the server instance was initially
315  // created.
316  @Nullable private final String serverUUID;
317
318  // The Directory Server startup ID.
319  @Nullable private final String startupID;
320
321  // The Directory Server startup UUID.
322  @Nullable private final String startupUUID;
323
324  // The string representation of the uptime.
325  @Nullable private final String uptime;
326
327  // The Directory Server vendor name.
328  @Nullable private final String vendorName;
329
330  // The Directory Server version string.
331  @Nullable private final String versionString;
332
333
334
335  /**
336   * Creates a new general monitor entry from the provided entry.
337   *
338   * @param  entry  The entry to be parsed as a general monitor entry.  It must
339   *                not be {@code null}.
340   */
341  public GeneralMonitorEntry(@NotNull final Entry entry)
342  {
343    super(entry);
344
345    currentConnections     = getLong(ATTR_CURRENT_CONNECTIONS);
346    currentTime            = getDate(ATTR_CURRENT_TIME);
347    maxConnections         = getLong(ATTR_MAX_CONNECTIONS);
348    productName            = getString(ATTR_PRODUCT_NAME);
349    startTime              = getDate(ATTR_START_TIME);
350    clusterName            = getString(ATTR_CLUSTER_NAME);
351    instanceName           = getString(ATTR_INSTANCE_NAME);
352    locationDN             = getString(ATTR_LOCATION_DN);
353    locationName           = getString(ATTR_LOCATION_NAME);
354    serverUUID             = getString(ATTR_SERVER_UUID);
355    startupID              = getString(ATTR_STARTUP_ID);
356    startupUUID            = getString(ATTR_STARTUP_UUID);
357    totalConnections       = getLong(ATTR_TOTAL_CONNECTIONS);
358    uptime                 = getString(ATTR_UP_TIME);
359    vendorName             = getString(ATTR_VENDOR_NAME);
360    versionString          = getString(ATTR_VERSION);
361    degradedAlertTypes     = getStrings(ATTR_DEGRADED_ALERT_TYPE);
362    unavailableAlertTypes  = getStrings(ATTR_UNAVAILABLE_ALERT_TYPE);
363    thirdPartyExtensionDNs = getStrings(ATTR_THIRD_PARTY_EXTENSION_DN);
364  }
365
366
367
368  /**
369   * Retrieves the number of connections currently established.
370   *
371   * @return  The number of connections currently established, or {@code null}
372   *          if it was not included in the monitor entry.
373   */
374  @Nullable()
375  public Long getCurrentConnections()
376  {
377    return currentConnections;
378  }
379
380
381
382  /**
383   * Retrieves the maximum number of concurrent connections established at any
384   * time since startup.
385   *
386   * @return  The maximum number of concurrent connections established at any
387   *          time since startup, or {@code null} if it was not included in the
388   *          monitor entry.
389   */
390  @Nullable()
391  public Long getMaxConnections()
392  {
393    return maxConnections;
394  }
395
396
397
398  /**
399   * Retrieves the total number of connections established since startup.
400   *
401   * @return  The total number of connections established since startup, or
402   *          {@code null} if it was not included in the monitor entry.
403   */
404  @Nullable()
405  public Long getTotalConnections()
406  {
407    return totalConnections;
408  }
409
410
411
412  /**
413   * Retrieves the current time as reported by the Directory Server.
414   *
415   * @return  The current time as reported by the Directory Server, or
416   *          {@code null} if it was not included in the monitor entry.
417   */
418  @Nullable()
419  public Date getCurrentTime()
420  {
421    return currentTime;
422  }
423
424
425
426  /**
427   * Retrieves the time that the Directory Server was started.
428   *
429   * @return  The time that the Directory Server was started, or {@code null} if
430   *          it was not included in the monitor entry.
431   */
432  @Nullable()
433  public Date getStartTime()
434  {
435    return startTime;
436  }
437
438
439
440  /**
441   * Retrieves the name of the cluster in which the server is a member.
442   *
443   * @return  The name of the cluster in which the server is a member, or
444   *          {@code null} if it was not included in the monitor entry.
445   */
446  @Nullable()
447  public String getClusterName()
448  {
449    return clusterName;
450  }
451
452
453
454  /**
455   * Retrieves the name assigned to the Directory Server instance.
456   *
457   * @return  The name assigned to the Directory Server instance, or
458   *          {@code null} if it was not included in the monitor entry.
459   */
460  @Nullable()
461  public String getInstanceName()
462  {
463    return instanceName;
464  }
465
466
467
468  /**
469   * Retrieves the name of the configuration entry that defines the server's
470   * location.
471   *
472   * @return  The name of the configuration entry that defines the server's
473   *          location, or {@code null} if it was not included in the monitor
474   *          entry.
475   */
476  @Nullable()
477  public String getLocationName()
478  {
479    return locationName;
480  }
481
482
483
484  /**
485   * Retrieves the DN of the configuration entry that defines the server's
486   * location.
487   *
488   * @return  The DN of the configuration entry that defines the server's
489   *          location, or {@code null} if it was not included in the monitor
490   *          entry.
491   */
492  @Nullable()
493  public String getLocationDN()
494  {
495    return locationDN;
496  }
497
498
499
500  /**
501   * Retrieves the UUID value that was generated when the server instance was
502   * initially created.
503   *
504   * @return  The UUID value that was generated when the server instance was
505   *          initially created, or {@code null} if it was not included in the
506   *          monitor entry.
507   */
508  @Nullable()
509  public String getServerUUID()
510  {
511    return serverUUID;
512  }
513
514
515
516  /**
517   * Retrieves a relatively compact identifier generated at the time the
518   * Directory Server was started.
519   *
520   * @return  A relatively compact identifier generated at the time the
521   *          Directory Server was started, or {@code null} if it was not
522   *          included in the monitor entry.
523   */
524  @Nullable()
525  public String getStartupID()
526  {
527    return startupID;
528  }
529
530
531
532  /**
533   * Retrieves the UUID that was generated when the Directory Server was
534   * started.
535   *
536   * @return  The UUID that was generated when the Directory Server was started,
537   *          or {@code null} if it was not included in the monitor entry.
538   */
539  @Nullable()
540  public String getStartupUUID()
541  {
542    return startupUUID;
543  }
544
545
546
547  /**
548   * Retrieves the Directory Server uptime in milliseconds.
549   *
550   * @return  The Directory Server uptime in milliseconds, or {@code null} if
551   *          either the current time or the start time was not available.
552   */
553  @Nullable()
554  public Long getUptimeMillis()
555  {
556    if ((currentTime == null) || (startTime == null))
557    {
558      return null;
559    }
560
561    return currentTime.getTime() - startTime.getTime();
562  }
563
564
565
566  /**
567   * Retrieves the human-readable string representation of the Directory Server
568   * uptime.
569   *
570   * @return  The human-readable string representation of the Directory Server
571   *          uptime, or {@code null} if it was not included in the monitor
572   *          entry.
573   */
574  @Nullable()
575  public String getUptimeString()
576  {
577    return uptime;
578  }
579
580
581
582  /**
583   * Retrieves the Directory Server product name.
584   *
585   * @return  The Directory Serve product name, or {@code null} if it was not
586   *          included in the monitor entry.
587   */
588  @Nullable()
589  public String getProductName()
590  {
591    return productName;
592  }
593
594
595
596  /**
597   * Retrieves the Directory Server vendor name string.
598   *
599   * @return  The Directory Server vendor name string, or {@code null} if it
600   *          was not included in the monitor entry.
601   */
602  @Nullable()
603  public String getVendorName()
604  {
605    return vendorName;
606  }
607
608
609
610  /**
611   * Retrieves the Directory Server version string.
612   *
613   * @return  The Directory Server version string, or {@code null} if it was not
614   *          included in the monitor entry.
615   */
616  @Nullable()
617  public String getVersionString()
618  {
619    return versionString;
620  }
621
622
623
624  /**
625   * Retrieves the names of any alert types which may have caused the server to
626   * be currently classified as "degraded".
627   *
628   * @return  The names of any alert types which may have caused the server to
629   *          be currently classified as "degraded", or an empty list if it was
630   *          not included in the monitor entry (which likely indicates that the
631   *          server is not classified as "degraded").
632   */
633  @NotNull()
634  public List<String> getDegradedAlertTypes()
635  {
636    return degradedAlertTypes;
637  }
638
639
640
641  /**
642   * Retrieves the names of any alert types which may have caused the server to
643   * be currently classified as "unavailable".
644   *
645   * @return  The names of any alert types which may have caused the server to
646   *          be currently classified as "unavailable", or an empty list if it
647   *          was not included in the monitor entry (which likely indicates that
648   *          the server is not classified as "unavailable").
649   */
650  @NotNull()
651  public List<String> getUnavailableAlertTypes()
652  {
653    return unavailableAlertTypes;
654  }
655
656
657
658  /**
659   * Retrieves the DNs of the configuration entries for any third-party
660   * extensions currently loaded in the server.
661   *
662   * @return  The DNs of the configuration entries for any third-party
663   *          extensions currently loaded in the server, or an empty list if it
664   *          was not included in the monitor entry.
665   */
666  @NotNull()
667  public List<String> getThirdPartyExtensionDNs()
668  {
669    return thirdPartyExtensionDNs;
670  }
671
672
673
674  /**
675   * {@inheritDoc}
676   */
677  @Override()
678  @NotNull()
679  public String getMonitorDisplayName()
680  {
681    return INFO_GENERAL_MONITOR_DISPNAME.get();
682  }
683
684
685
686  /**
687   * {@inheritDoc}
688   */
689  @Override()
690  @NotNull()
691  public String getMonitorDescription()
692  {
693    return INFO_GENERAL_MONITOR_DESC.get();
694  }
695
696
697
698  /**
699   * {@inheritDoc}
700   */
701  @Override()
702  @NotNull()
703  public Map<String,MonitorAttribute> getMonitorAttributes()
704  {
705    final LinkedHashMap<String,MonitorAttribute> attrs =
706         new LinkedHashMap<>(StaticUtils.computeMapCapacity(30));
707
708    if (productName != null)
709    {
710      addMonitorAttribute(attrs,
711           ATTR_PRODUCT_NAME,
712           INFO_GENERAL_DISPNAME_PRODUCT_NAME.get(),
713           INFO_GENERAL_DESC_PRODUCT_NAME.get(),
714           productName);
715    }
716
717    if (vendorName != null)
718    {
719      addMonitorAttribute(attrs,
720           ATTR_VENDOR_NAME,
721           INFO_GENERAL_DISPNAME_VENDOR_NAME.get(),
722           INFO_GENERAL_DESC_VENDOR_NAME.get(),
723           vendorName);
724    }
725
726    if (versionString != null)
727    {
728      addMonitorAttribute(attrs,
729           ATTR_VERSION,
730           INFO_GENERAL_DISPNAME_VERSION.get(),
731           INFO_GENERAL_DESC_VERSION.get(),
732           versionString);
733    }
734
735    if (clusterName != null)
736    {
737      addMonitorAttribute(attrs,
738           ATTR_CLUSTER_NAME,
739           INFO_GENERAL_DISPNAME_CLUSTER_NAME.get(),
740           INFO_GENERAL_DESC_CLUSTER_NAME.get(),
741           clusterName);
742    }
743
744    if (instanceName != null)
745    {
746      addMonitorAttribute(attrs,
747           ATTR_INSTANCE_NAME,
748           INFO_GENERAL_DISPNAME_INSTANCE_NAME.get(),
749           INFO_GENERAL_DESC_INSTANCE_NAME.get(),
750           instanceName);
751    }
752
753    if (locationName != null)
754    {
755      addMonitorAttribute(attrs,
756           ATTR_LOCATION_NAME,
757           INFO_GENERAL_DISPNAME_LOCATION_NAME.get(),
758           INFO_GENERAL_DESC_LOCATION_NAME.get(),
759           locationName);
760    }
761
762    if (locationDN != null)
763    {
764      addMonitorAttribute(attrs,
765           ATTR_LOCATION_DN,
766           INFO_GENERAL_DISPNAME_LOCATION_DN.get(),
767           INFO_GENERAL_DESC_LOCATION_DN.get(),
768           locationDN);
769    }
770
771    if (startTime != null)
772    {
773      addMonitorAttribute(attrs,
774           ATTR_START_TIME,
775           INFO_GENERAL_DISPNAME_START_TIME.get(),
776           INFO_GENERAL_DESC_START_TIME.get(),
777           startTime);
778    }
779
780    if (serverUUID != null)
781    {
782      addMonitorAttribute(attrs,
783           ATTR_SERVER_UUID,
784           INFO_GENERAL_DISPNAME_SERVER_UUID.get(),
785           INFO_GENERAL_DESC_SERVER_UUID.get(),
786           serverUUID);
787    }
788
789    if (startupID != null)
790    {
791      addMonitorAttribute(attrs,
792           ATTR_STARTUP_ID,
793           INFO_GENERAL_DISPNAME_STARTUP_ID.get(),
794           INFO_GENERAL_DESC_STARTUP_ID.get(),
795           startupID);
796    }
797
798    if (startupUUID != null)
799    {
800      addMonitorAttribute(attrs,
801           ATTR_STARTUP_UUID,
802           INFO_GENERAL_DISPNAME_STARTUP_UUID.get(),
803           INFO_GENERAL_DESC_STARTUP_UUID.get(),
804           startupUUID);
805    }
806
807    if (currentTime != null)
808    {
809      addMonitorAttribute(attrs,
810           ATTR_CURRENT_TIME,
811           INFO_GENERAL_DISPNAME_CURRENT_TIME.get(),
812           INFO_GENERAL_DESC_CURRENT_TIME.get(),
813           currentTime);
814    }
815
816    if (uptime != null)
817    {
818      addMonitorAttribute(attrs,
819           ATTR_UP_TIME,
820           INFO_GENERAL_DISPNAME_UPTIME.get(),
821           INFO_GENERAL_DESC_UPTIME.get(),
822           uptime);
823    }
824
825    if ((startTime != null) && (currentTime != null))
826    {
827      addMonitorAttribute(attrs,
828           "upTimeMillis",
829           INFO_GENERAL_DISPNAME_UPTIME_MILLIS.get(),
830           INFO_GENERAL_DESC_UPTIME_MILLIS.get(),
831           Long.valueOf(currentTime.getTime() - startTime.getTime()));
832    }
833
834    if (currentConnections != null)
835    {
836      addMonitorAttribute(attrs,
837           ATTR_CURRENT_CONNECTIONS,
838           INFO_GENERAL_DISPNAME_CURRENT_CONNECTIONS.get(),
839           INFO_GENERAL_DESC_CURRENT_CONNECTIONS.get(),
840           currentConnections);
841    }
842
843    if (maxConnections != null)
844    {
845      addMonitorAttribute(attrs,
846           ATTR_MAX_CONNECTIONS,
847           INFO_GENERAL_DISPNAME_MAX_CONNECTIONS.get(),
848           INFO_GENERAL_DESC_MAX_CONNECTIONS.get(),
849           maxConnections);
850    }
851
852    if (totalConnections != null)
853    {
854      addMonitorAttribute(attrs,
855           ATTR_TOTAL_CONNECTIONS,
856           INFO_GENERAL_DISPNAME_TOTAL_CONNECTIONS.get(),
857           INFO_GENERAL_DESC_TOTAL_CONNECTIONS.get(),
858           totalConnections);
859    }
860
861    if (! degradedAlertTypes.isEmpty())
862    {
863      addMonitorAttribute(attrs,
864           ATTR_DEGRADED_ALERT_TYPE,
865           INFO_GENERAL_DISPNAME_DEGRADED_ALERT_TYPE.get(),
866           INFO_GENERAL_DESC_DEGRADED_ALERT_TYPE.get(),
867           degradedAlertTypes);
868    }
869
870    if (! unavailableAlertTypes.isEmpty())
871    {
872      addMonitorAttribute(attrs,
873           ATTR_UNAVAILABLE_ALERT_TYPE,
874           INFO_GENERAL_DISPNAME_UNAVAILABLE_ALERT_TYPE.get(),
875           INFO_GENERAL_DESC_UNAVAILABLE_ALERT_TYPE.get(),
876           unavailableAlertTypes);
877    }
878
879    if (! thirdPartyExtensionDNs.isEmpty())
880    {
881      addMonitorAttribute(attrs,
882           ATTR_THIRD_PARTY_EXTENSION_DN,
883           INFO_GENERAL_DISPNAME_THIRD_PARTY_EXTENSION_DN.get(),
884           INFO_GENERAL_DESC_THIRD_PARTY_EXTENSION_DN.get(),
885           thirdPartyExtensionDNs);
886    }
887
888    return Collections.unmodifiableMap(attrs);
889  }
890}