FileDocCategorySizeDatePackage
CustomerInputCollector.javaAPI DocGlassfish v2 API4181Fri May 04 22:34:44 BST 2007com.sun.enterprise.diagnostics.collect

CustomerInputCollector

public class CustomerInputCollector extends Object implements Collector
author
mu125243

Fields Summary
String
customerInputFile
String
customerInput
String
intermediateReportLocation
boolean
local
protected static final Logger
logger
Constructors Summary
public CustomerInputCollector(String customerInputFile, String customerInput, String intermediateReportLocation, boolean local)
Creates a new instance of CustomerInputCollector


           
         
                
       this.intermediateReportLocation = intermediateReportLocation;
       this.customerInput = customerInput;
       this.customerInputFile = customerInputFile;
       this.local = local;
    
Methods Summary
public com.sun.enterprise.diagnostics.Datacapture()

        if(customerInputFile != null)
            return copyCustomerInputFile(customerInputFile);
        if(customerInput != null && customerInput.trim().length() > 0) {
            WritableDataImpl customerInfo = new WritableDataImpl(DataType.CUSTOMER_INFO);
            customerInfo.addValue(customerInput);
            return customerInfo;
        }
        return null;
    
private com.sun.enterprise.diagnostics.DatacopyCustomerInputFile(java.lang.String inputFile)
Copies customer input

param
inputFile name of file to be copied.

        if(inputFile != null) {
            try {
                String destFile = intermediateReportLocation +
                        Defaults.CUSTOMER_INPUT;
                FileUtils.copyFile(inputFile, destFile);
                return new FileData(destFile,
                        DataType.CUSTOMER_INFO);
            } catch (IOException ioe) {
                logger.log(Level.WARNING, "diagnostic-service.copy_failed",
                        new Object[]{inputFile, ioe.getMessage()});
            }
        }
        return null;