org.esa.beam.framework.processor
Class ProcessorUtils

java.lang.Object
  extended by org.esa.beam.framework.processor.ProcessorUtils

public class ProcessorUtils
extends Object

This class contains an assortment of convenience methods that may be useful when developing scientific processors within the BEAM framework.


Constructor Summary
ProcessorUtils()
           
 
Method Summary
static ProductRef createProductRef(String filePath, String fileFormat)
          Creates a valid ProductRef from the given file path and file format string
static ProductWriter createProductWriter(ProductRef prodRef)
          Creates a product writer based on the information stored in the product reference passed in
static Term createTerm(String expression, Product product)
          Creates a Term from the expression string passed in and validates that the product supplied can interpret the expression.
static void removeLoggingHandler()
          Flushes all logging handlers attached to the system logger and removes them.
static void setProcessorLoggingHandler(String defaultPrefix, Request request, Formatter formatter)
          Sets a default set of logging handlers to the systemlogger.
static void setProcessorLoggingHandler(String defaultPrefix, Request request, String appName, String appVersion, String copyrightInfo)
          Sets a default set of logging handlers to the systemlogger.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProcessorUtils

public ProcessorUtils()
Method Detail

createTerm

public static Term createTerm(String expression,
                              Product product)
                       throws ProcessorException
Creates a Term from the expression string passed in and validates that the product supplied can interpret the expression.

Parameters:
expression - the expression string
product - the product to interprete the expression
Returns:
a validated term
Throws:
ProcessorException - on any failure

createProductWriter

public static ProductWriter createProductWriter(ProductRef prodRef)
                                         throws ProcessorException
Creates a product writer based on the information stored in the product reference passed in

Parameters:
prodRef - the ProductRef containing the information for the output product
Throws:
ProcessorException

setProcessorLoggingHandler

public static void setProcessorLoggingHandler(String defaultPrefix,
                                              Request request,
                                              String appName,
                                              String appVersion,
                                              String copyrightInfo)
Sets a default set of logging handlers to the systemlogger.

Parameters:
defaultPrefix - the default log file prefix
request - the processing request
appName - the application name
appVersion - the application version string
copyrightInfo - the copyright information

setProcessorLoggingHandler

public static void setProcessorLoggingHandler(String defaultPrefix,
                                              Request request,
                                              Formatter formatter)
Sets a default set of logging handlers to the systemlogger.

Parameters:
defaultPrefix - the default log file prefix
request - the processing request
formatter - a formatter to be used

removeLoggingHandler

public static void removeLoggingHandler()
Flushes all logging handlers attached to the system logger and removes them. Attaches a new CacheHandler.


createProductRef

public static ProductRef createProductRef(String filePath,
                                          String fileFormat)
Creates a valid ProductRef from the given file path and file format string

Parameters:
filePath -
fileFormat -
Returns:
null if no filePath is given or filePath is empty


Copyright © 2002-2012 Brockmann Consult GmbH. All Rights Reserved.