use of com.sun.identity.log.secure.SecureLogHelper in project OpenAM by OpenRock.
the class SecureFileHandler method initializeVerifier.
/**
* Initialize SecureLog verifier
* @param verPass verifier password
* @param token AM token
*/
public static void initializeVerifier(AMPassword verPass, Object token) {
/* Remove the relevant verifier initialization code when deploying
* it finally. For the timebeing it will be done in the old way
* of doing it in the constructor thru initializeSecurity();
*/
try {
setVerPassword(verPass, token);
LogManager lmanager = LogManagerUtil.getLogManager();
String logPath = lmanager.getProperty(LogConstants.LOG_LOCATION);
if (!logPath.endsWith("/"))
logPath += "/";
LogManager manager = LogManagerUtil.getLogManager();
Enumeration e = manager.getLoggerNames();
while (e.hasMoreElements()) {
String FileName = (String) e.nextElement();
String verifierFileName = logPath + PREFIX + "ver." + FileName;
SecureLogHelper helper = getSecureLogHelper(FileName);
AMPassword logPassword = getLogPassword();
// explicit auditor role in DSAME to initialize ver.
if (helper != null) {
helper.initializeVerifier(verifierFileName, logPassword, verPassword);
try {
Debug.message(FileName + ":Trying to start the Verifier Thread");
Logger logger = (com.sun.identity.log.Logger) Logger.getLogger(FileName);
Handler[] handlers = logger.getHandlers();
((com.sun.identity.log.handlers.SecureFileHandler) handlers[0]).startVerifierThread();
Debug.message(FileName + ":Started Log Verifier thread");
} catch (Exception ex) {
Debug.error(FileName + ":Unable to start Verifier Thread", ex);
// throw custom exception
}
}
verificationInitialized = true;
}
} catch (Exception e) {
Debug.error("Error initializing Verification", e);
}
}
use of com.sun.identity.log.secure.SecureLogHelper in project OpenAM by OpenRock.
the class SecureFileHandler method getSecureLogHelperInst.
/**
* Returns SecureLogHelper instance
* @return SecureLogHelper instance
*/
public static SecureLogHelper getSecureLogHelperInst() {
SecureLogHelper helper = null;
String helperClass = LogManagerUtil.getLogManager().getProperty(LogConstants.SECURE_LOG_HELPER);
if (Debug.messageEnabled()) {
Debug.message("Configured SecureLogHelper Impl class : " + helperClass);
}
try {
helper = (SecureLogHelper) Class.forName(helperClass).newInstance();
} catch (Exception e) {
Debug.error("Could not instantiate class " + helperClass, e);
}
return helper;
}
Aggregations