MonitoringUtil.java revision fb3b3a01405c222ae1fdbbe6f5c1d4aa696195bb
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2009 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: OpenSSOMonitoringUtil.java,v 1.2 2009/11/10 01:33:22 bigfatrat Exp $
*
*/
/*
* Portions Copyrighted 2011-2014 ForgeRock AS
*/
public class MonitoringUtil {
private static boolean initialized = false;
private static boolean isMonAvailable = true;
private static String [] networkMonitors = {
"dbLookupPrivileges",
"dbLookupReferrals"
};
// constructor
private MonitoringUtil () {
}
public static String[] getNetworkMonitorNames() {
return networkMonitors;
}
/**
* return whether the specified network monitor
* has been instantiated in the entitlements service yet
*/
if (debug.messageEnabled()) {
}
if (debug.warningEnabled()) {
}
return false;
}
// names are all lowercase
return true;
} else {
return false;
}
}
/**
* Escapes colons (":") in the supplied String to ":".
* Useful mostly for the MBean names, as jdmk really doesn't
* like them.
*/
}
}
return str;
}
}
try {
} catch (SSOException ex) {
} catch (IdRepoException ex) {
"IdRepoError getting identity for realm '" +
}
return realmDN;
}
return null;
}
// prep for the "%BASE_DIR%/%SERVER_URI%/" style filepath
{
}
ossoUri += "/";
}
baseDir += "/";
}
}
try {
// assume first is userid, second is password, ignore rest
new DecodeAction(passwd));
}
}
}
return hm;
} else {
return null;
}
} catch (IOException e) {
e.getMessage());
} catch (RuntimeException e) {
} catch (Exception e) {
}
return null;
}
/**
* it should be an 8-Byte array, where
* bytes 0-1: year
* byte 2: month
* byte 3: day
* byte 4: hours
* byte 5: minutes
* byte 6: seconds
* byte 7: deci-seconds (will be 0)
*
* @param date
* @return the converted date
*/
int iyear = 0;
try {
} catch (NumberFormatException ex) {
}
try {
} catch (NumberFormatException ex) {
}
return ret;
}
private static void checkInit() {
if (!initialized) {
try {
} catch (ClassNotFoundException cnfe) {
isMonAvailable = false;
} catch (NoClassDefFoundError ncdfe) {
// if the Agent class is avaliable, but the SNMP library isn't (ssoadm)
// TODO: fix this when the project is modularized
isMonAvailable = false;
}
initialized = true;
}
}
public static boolean isRunning() {
checkInit();
}
public static int getPolicyWindowSize() {
checkInit();
}
}