Methods Summary |
---|
public void | addCollector(Collector obj)
if(obj != null)
collectors.add(obj);
|
protected void | addCustomerInputCollector()
if (config.getCLIOptions().getCustomerInput() != null ||
config.getCLIOptions().getCustomerInputFile() != null) {
addCollector(new CustomerInputCollector(
config.getCLIOptions().getCustomerInputFile(),
config.getCLIOptions().getCustomerInput(),
target.getIntermediateReportDir(),
config.getExecutionContext().isLocal()));
}
|
protected void | addFilesCollector(boolean captureInstallationLog, java.lang.String dataType)
if(captureInstallationLog) {
if(installationLogCollector == null) {
String installationRoot = DiagnosticServiceHelper.getInstallationRoot();
List<String> files = new ArrayList(2);
String[] logFiles =
new File(installationRoot).list(new FilenameFilter() {
public boolean accept(File folder, String name) {
if( (name.contains(Constants.INSTALLATION_LOG_PREFIX)) ||
(name.contains(Constants.SJSAS_INSTALLATION_LOG_PREFIX)))
return true;
return false;
}
});
files.addAll(Arrays.asList(logFiles));
installationLogCollector = new FilesCollector(installationRoot,
target.getIntermediateReportDir(),files, dataType);
addCollector(installationLogCollector);
}
}
|
protected void | addInstallationCheckSumCollector()
if(checksumCollector == null) {
checksumCollector = new ChecksumCollector(
DiagnosticServiceHelper.getInstallationRoot(),
target.getIntermediateReportDir());
addCollector(checksumCollector);
}
|
protected void | addMonitoringInfoCollector(java.lang.String reportDir, java.lang.String path, java.lang.String instanceName)
if(path == null)
path = "";
reportDir= reportDir + File.separator + path + File.separator +
instanceName;
addCollector(new MonitoringInfoCollector(path, instanceName, reportDir));
|
protected void | addMonitoringInfoCollectors(java.lang.String path, java.util.List instances)
String reportDir = target.getIntermediateReportDir();
Iterator<String> iterator = instances.iterator();
while (iterator.hasNext()) {
String instanceName = iterator.next();
addMonitoringInfoCollector(reportDir, path,instanceName);
}
|
public abstract void | addRemoteCollectors()
|
protected void | addSystemInfoCollector(boolean captureSystemInfoEnabled)
if(captureSystemInfoEnabled) {
String reportDir = config.getTarget().getIntermediateReportDir();
if(systemInfoCollector == null) {
systemInfoCollector = new SystemInfoCollector(reportDir);
//Add the collector only once.
addCollector(systemInfoCollector);
}
}
|
private Data | capture(Collector obj)Invoke collector to capture information
try {
return obj.capture();
} catch (Throwable de) {
logger.log(Level.WARNING,
"diagnostic-service.error_collecting_data" ,
new Object[]{de.getMessage()});
}
return null;
|
public Data | capture()Invoke various collectors to capture diagnostic data
WritableDataImpl dataImpl = new WritableDataImpl();
Iterator<Collector> list = collectors.iterator();
while(list.hasNext()) {
Data dataObj = capture(list.next());
if(dataObj != null)
dataImpl.addChild(dataObj);
}
if (!dataImpl.getChildren().hasNext()) {
//no data has been collected by any of the collectors.
DiagnosticException e = new DiagnosticException("No Diagnostic data has been collected");
logger.log(Level.WARNING, "diagnostic-service.no_data_collected");
throw e;
}
return dataImpl;
|
public void | initialize()Initialize collectors
collectors = new ArrayList(8);
addCustomerInputCollector();
//addInstallationCheckSumCollector();
initializeInstanceCollectors(config.getInstanceConfigurations());
addRemoteCollectors();
//addSystemInfoCollector();
|
protected void | initializeInstanceCollectors(java.util.Iterator iterator)Initialize instance collectors
while(iterator.hasNext()) {
ServiceConfig serviceConfig = iterator.next();
String repositoryDir = serviceConfig.getRepositoryDir() ;
String reportDir = target.getIntermediateReportDir();
if(!(serviceConfig.getInstanceName().equals(Constants.SERVER)))
reportDir = reportDir+ File.separator +
serviceConfig.getInstanceName();
if(serviceConfig.isCaptureChecksumEnabled()) {
addInstallationCheckSumCollector();
ChecksumCollector collector = new ChecksumCollector(
repositoryDir,
reportDir);
addCollector(collector);
}
if(serviceConfig.isVerifyDomainEnabled()) {
DomainXMLVerificationCollector domainXMLCollector
= new DomainXMLVerificationCollector(repositoryDir,
reportDir);
addCollector(domainXMLCollector);
}
addCollector(new ConfigCollector(repositoryDir, reportDir));
//If minLogLevel != OFF, add collector
if(!(serviceConfig.getMinLogLevel() == Level.OFF.intValue())) {
Collector collectorObj = new LogCollector(
config.getCLIOptions().getStartDate(),
config.getCLIOptions().getEndDate(),
reportDir, serviceConfig );
if (collectorObj != null)
addCollector(collectorObj);
}
if(serviceConfig.isCaptureAppDDEnabled()) {
addCollector(new AppInfoCollector(repositoryDir, reportDir));
}
addFilesCollector(serviceConfig.isCaptureInstallLogEnabled(),
DataType.INSTALLATION_LOG);
addSystemInfoCollector(serviceConfig.isCaptureSystemInfoEnabled());
}
|