BasicMonitoringAttributes.java revision cf364c082dfe5ea566abc3c20bc5546a4629c5eb
/*
* 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 2009 Sun Microsystems, Inc.
* Portions Copyright 2014 ForgeRock AS
*/
/**
* The enumeration containing the different monitoring attributes that can be
* displayed in the monitoring panels.
*/
public enum BasicMonitoringAttributes implements MonitoringAttributes
{
/**
* Start Date.
*/
/**
* Current Date.
*/
/**
* Current Connections.
*/
/**
* Maximum Connections.
*/
/**
* Total Connections.
*/
/**
* Average Request Backlog.
*/
/**
* Max Request Backlog.
*/
/**
* Current Request Backlog.
*/
/**
* Requests submitted.
*/
/**
* Requests rejected.
*/
/**
* Entry cache Hits.
*/
"entryCacheHits"),
/**
* Current entry cache count.
*/
"currentEntryCacheCount"),
/**
* Entry cache tries.
*/
"entryCacheTries"),
/**
* Entry cache hit ratio.
*/
"entryCacheHitRatio"),
/**
* Entry cache current size.
*/
"currentEntryCacheSize"),
/**
* Entry cache max size.
*/
"maxEntryCacheSize"),
/**
* Entry cache max count.
*/
"maxEntryCacheCount"),
/**
* Available CPUs.
*/
"availableCPUs"),
/**
* System Name.
*/
"systemName"),
/**
* Operating System.
*/
"operatingSystem"),
/**
* Free used memory.
*/
"freeUsedMemory"),
/**
* Max memory.
*/
"maxMemory"),
/**
* Used memory.
*/
"usedMemory"),
/**
* Class path.
*/
"classPath"),
/**
* Java Vendor.
*/
"javaVendor"),
/**
* JVM Vendor.
*/
"javaVendor"),
/**
* Java Version.
*/
"javaVersion"),
/**
* JVM Version.
*/
"jvmVersion"),
/**
* JVM Architecture.
*/
"jvmArchitecture"),
/**
* JVM Arguments.
*/
"jvmArguments"),
/**
* Add Request.
*/
"addRequests"),
/**
* Add Responses.
*/
"addResponses"),
/**
* Bind Request.
*/
"bindRequests"),
/**
* Bind Responses.
*/
"bindResponses"),
/**
* Compare Requests.
*/
"compareRequests"),
/**
* Compare Responses.
*/
"compareResponses"),
/**
* Delete Request.
*/
"deleteRequests"),
/**
* Delete Responses.
*/
"deleteResponses"),
/**
* Extended Request.
*/
"extendedRequests"),
/**
* Extended Responses.
*/
"extendedResponses"),
/**
* Modify DN Request.
*/
"modifyDNRequests"),
/**
* Modify DN Responses.
*/
"modifyDNResponses"),
/**
* Modify Request.
*/
"modifyRequests"),
/**
* Modify Responses.
*/
"modifyResponses"),
/**
* Search Request.
*/
"searchRequests"),
/**
* Searches Done.
*/
"searchResultsDone"),
/**
* Unbind Request.
*/
"unbindRequests"),;
static
{
// Do this here, since static references do not work if this is done
// in the constructor.
{
}
}
private LocalizableMessage msg;
private String attributeName;
private boolean isAborted;
private boolean isNumeric;
private boolean isGMTDate;
private boolean isValueInBytes;
private boolean canHaveAverage;
private boolean isTime;
{
this.attributeName = attributeName;
}
/**
* {@inheritDoc}
*/
public LocalizableMessage getMessage()
{
return msg;
}
/**
* {@inheritDoc}
*/
public String getAttributeName()
{
return attributeName;
}
/**
* {@inheritDoc}
*/
public boolean isAborted()
{
return isAborted;
}
/**
* {@inheritDoc}
*/
public boolean isNumeric()
{
return isNumeric;
}
/**
* {@inheritDoc}
*/
public boolean isTime()
{
return isTime;
}
/**
* {@inheritDoc}
*/
public boolean isGMTDate()
{
return isGMTDate;
}
/**
* {@inheritDoc}
*/
public boolean isValueInBytes()
{
return isValueInBytes;
}
/**
* {@inheritDoc}
*/
public boolean canHaveAverage()
{
return canHaveAverage;
}
/**
* {@inheritDoc}
*/
public boolean isNumericDate()
{
return false;
}
private void calculateProperties()
{
this == SEARCH_DONE;
isGMTDate = this == START_DATE ||
this == CURRENT_DATE;
isValueInBytes = this == FREE_USED_MEMORY ||
this == MAX_MEMORY ||
this == USED_MEMORY;
!isGMTDate() &&
this != SYSTEM_NAME &&
this != OPERATING_SYSTEM &&
this != CLASS_PATH &&
this != JAVA_VENDOR &&
this != JVM_VENDOR &&
this != JAVA_VERSION &&
this != JVM_VERSION &&
this != JVM_ARCHITECTURE &&
this != JVM_ARGUMENTS;
}
}