1 23 package com.sun.enterprise.diagnostics; 24 25 26 27 import com.sun.enterprise.diagnostics.collect.Collector; 28 import com.sun.enterprise.diagnostics.collect.DomainXMLHelper; 29 import com.sun.enterprise.diagnostics.report.html.HTMLReportWriter; 30 import com.sun.logging.LogDomains; 31 32 import java.util.zip.ZipFile ; 33 import java.util.List ; 34 import java.util.Map ; 35 import java.io.File ; 36 import java.util.logging.Logger ; 37 import java.util.logging.Level ; 38 43 public class PEDiagnosticAgent implements DiagnosticAgent { 44 45 private static Logger logger = LogDomains.getLogger(LogDomains.ADMIN_LOGGER); 46 47 48 public PEDiagnosticAgent() { 49 } 50 51 52 53 59 public String generateReport(Map options) throws DiagnosticException { 60 if(options != null) { 61 BackendObjectFactory objectFactory = getBackendObjectFactory(options); 62 ReportGenerator generator = objectFactory.createReportGenerator(); 63 return generator.generate().getName(); 64 } 65 throw new DiagnosticException(" Null Input for report generation"); 66 } 67 68 76 public String generateReport(Map clioptions, List <String > instances, 77 String targetType) throws DiagnosticException { 78 throw new DiagnosticException("Unsupported operation"); 79 } 80 81 82 87 public List <String > getConfidentialProperties(String repositoryDir) 88 throws DiagnosticException { 89 return new DomainXMLHelper(repositoryDir).getAttrs(); 90 } 91 92 97 public void deleteReport(String fileName) throws DiagnosticException { 98 if (fileName != null) { 99 File file = new File (fileName); 100 if(file.exists()) { 101 file.delete(); 102 } 103 } 104 } 105 108 protected BackendObjectFactory getBackendObjectFactory(Map input) { 109 return new PEBackendObjectFactory(input); 110 } 111 112 private Logger getLogger() { 113 return logger; 114 } 115 } 116 | Popular Tags |