FileDocCategorySizeDatePackage
ServiceConfig.javaAPI DocGlassfish v2 API8557Fri May 04 22:34:40 BST 2007com.sun.enterprise.diagnostics

ServiceConfig

public class ServiceConfig extends Object
Represents diagnostic service related config information from domain.xml
author
Manisha Umbarje

Fields Summary
private static Logger
logger
private String
logFile
private int
minLogLevel
private int
maxNoOfEntries
private String
repositoryDir
private String
instanceName
private boolean
local
private boolean
captureSystemInfoEnabled
private boolean
captureChecksumEnabled
private boolean
captureAppDDEnabled
private boolean
captureInstallLogEnabled
private boolean
verifyDomainEnabled
private boolean
captureHadbInfoEnabled
private ServiceConfigHelper
configHelper
Constructors Summary
public ServiceConfig(boolean localFlag, String repositoryDir, String instanceName)


         
                
	local = localFlag;
	this.repositoryDir = repositoryDir;
	this.instanceName = instanceName;
	setValues();
    
public ServiceConfig(boolean captureChecksumEnabled, boolean captureAppDDEnabled, boolean captureInstallLogEnabled, boolean verifyDomainEnabled, boolean captureHadbInfoEnabled, boolean captureSystemInfoEnabled, int minLogLevel, int maxNoOfEntries, String logFile, String repositoryDir, String instanceName)

        this.captureChecksumEnabled = captureChecksumEnabled;
        this.captureAppDDEnabled = captureAppDDEnabled;
        this.captureInstallLogEnabled = captureInstallLogEnabled;
        this.verifyDomainEnabled = verifyDomainEnabled;
        this.captureHadbInfoEnabled = captureHadbInfoEnabled;
        this.captureSystemInfoEnabled = captureSystemInfoEnabled;
        this.minLogLevel = minLogLevel;
        this.maxNoOfEntries = maxNoOfEntries;
        this.logFile = logFile;
        this.instanceName = instanceName;
        this.repositoryDir = repositoryDir;
    
Methods Summary
public voiddebug()

        logger.log(Level.FINEST, "diagnostic-service.capture_app_dd ", 
               new Object[] {captureAppDDEnabled});
        logger.log(Level.FINEST, "diagnostic-service.capture_hadb_info",
                new Object[]{captureHadbInfoEnabled});
        logger.log(Level.FINEST, "diagnostic-service.capture_checksum",
                new Object[]{captureChecksumEnabled});
        logger.log(Level.FINEST, "diagnostic-service.capture_install_log",
                new Object[]{captureInstallLogEnabled});
        logger.log(Level.FINEST, "diagnostic-service.min_log_level", 
                new Object[]{minLogLevel});
        logger.log(Level.FINEST, "diagnostic-service.max_log_entries", 
                new Object[]{maxNoOfEntries});
    
private java.lang.StringgetAttribute(java.lang.String attribute)
Retrieve value of the supplied attribute

	return configHelper.getAttribute(attribute);
    
private booleangetBooleanAttribute(java.lang.String attrName)

        return Boolean.valueOf(getAttribute(attrName)).booleanValue();
    
public java.lang.StringgetConfigName()
Returns null, if ServiceConfig is created with default values.

        if (configHelper != null)
            return configHelper.getConfigName();
        return null;
            
    
public java.lang.StringgetInstanceName()

        return instanceName;
    
public java.lang.StringgetLogFile()
Returns value of file of log-service

	return logFile;
    
public intgetMaxNoOfEntries()
Returns value of max-log-entries of diagnostic-service

	return maxNoOfEntries;
    
public intgetMinLogLevel()
Returns value of min-log-level of diagnostic-service

	return minLogLevel;
    
public java.lang.StringgetRepositoryDir()
Returns central or cache repository location

	return repositoryDir;
    
public booleanisCaptureAppDDEnabled()
Returns true capturing app DD is enabled

	return captureAppDDEnabled;
    
public booleanisCaptureChecksumEnabled()
Returns true if check sum is captured

	return captureChecksumEnabled;
    
public booleanisCaptureHadbInfoEnabled()
Returns true capturing app DD is enabled

	return captureHadbInfoEnabled;
    
public booleanisCaptureInstallLogEnabled()
Returns true capturing install log is enabled

	return captureInstallLogEnabled;
    
public booleanisCaptureSystemInfoEnabled()
Returns true if output of verify-domain is captured

	return captureSystemInfoEnabled;
    
public booleanisVerifyDomainEnabled()
Returns true if output of verify-domain is captured

	return verifyDomainEnabled;
    
private voidsetValues()
Initializes config values

        //setRepositoryDir();
	configHelper = new ServiceConfigHelper(repositoryDir, instanceName, local);
        minLogLevel = Level.parse
		    (getAttribute(ServerTags.MIN_LOG_LEVEL)).intValue();
	logFile = getAttribute(ServerTags.FILE);
	maxNoOfEntries = Integer.parseInt
		    (getAttribute(ServerTags.MAX_LOG_ENTRIES));
        captureAppDDEnabled = getBooleanAttribute(ServerTags.CAPTURE_APP_DD);
	captureInstallLogEnabled =getBooleanAttribute(ServerTags.CAPTURE_INSTALL_LOG);
        verifyDomainEnabled = getBooleanAttribute(ServerTags.VERIFY_CONFIG);
	captureHadbInfoEnabled = getBooleanAttribute(ServerTags.CAPTURE_HADB_INFO);
        captureChecksumEnabled = getBooleanAttribute(ServerTags.COMPUTE_CHECKSUM);
        captureSystemInfoEnabled = getBooleanAttribute(ServerTags.CAPTURE_SYSTEM_INFO);
    
public java.lang.StringtoString()

        return getInstanceName() + "," + getConfigName() + 
                "," + getMaxNoOfEntries() +"," + getMinLogLevel() + 
                "," + getLogFile() +
                "," + getRepositoryDir() + "," + isCaptureAppDDEnabled() + 
                "," + isCaptureChecksumEnabled() + 
                "," + isCaptureHadbInfoEnabled() + 
                "," + isCaptureInstallLogEnabled() +
                "," + isVerifyDomainEnabled() ;