From: bruce m. <tr...@us...> - 2004-07-25 17:25:49
|
Update of /cvsroot/babeldoc/babeldoc/modules/scanner/src/com/babeldoc/scanner In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16769/modules/scanner/src/com/babeldoc/scanner Modified Files: ScannerFactory.java ScannerWorker.java Added Files: package.html Log Message: javadoc and formatting here. --- NEW FILE: package.html --- <body> <h2>Introduction</h2> Scanners are a way of periodically loading documents into a pipeline. There are many sources that can be scanned: directories, ftp server, imap servers and more besides. Additionally the scanners either operate periodically or like cron services. <h2>Configuration</h2> All of the configurations for the Scanner module are to be found in the scanner directory. </body> Index: ScannerWorker.java =================================================================== RCS file: /cvsroot/babeldoc/babeldoc/modules/scanner/src/com/babeldoc/scanner/ScannerWorker.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** ScannerWorker.java 24 Jul 2004 00:18:52 -0000 1.37 --- ScannerWorker.java 25 Jul 2004 17:25:39 -0000 1.38 *************** *** 54,58 **** package com.babeldoc.scanner; - import java.io.OutputStream; import java.util.Hashtable; import java.util.Map; --- 54,57 ---- *************** *** 282,287 **** Matcher matcher = pattern.matcher(text); boolean result = matcher.matches(); ! if (LogService.getInstance().isDebugEnabled()) { ! LogService.getInstance().logDebug( I18n.get("scanner.ScannerWorker.debug.match", Boolean .toString(result), text)); --- 281,286 ---- Matcher matcher = pattern.matcher(text); boolean result = matcher.matches(); ! if (getLog().isDebugEnabled()) { ! getLog().logDebug( I18n.get("scanner.ScannerWorker.debug.match", Boolean .toString(result), text)); *************** *** 412,423 **** /** ! * Make a scan ! * ! * @param data ! * DOCUMENT ME! ! * @param attr ! * DOCUMENT ME! * ! * @return DOCUMENT ME! */ protected boolean enqueue(byte[] data, Map attr) { --- 411,421 ---- /** ! * After some data has been scanned, use the configured feeder (see Scanner) to ! * submit it to the pipeline. * ! * @param data raw data to submit ! * @param attr map of attributes ! * ! * @return success flag */ protected boolean enqueue(byte[] data, Map attr) { *************** *** 446,454 **** /** ! * Add a feed document with path specified only ! * ! * @param data ! * @param path ! * @return */ protected boolean enqueue(byte[] data, String path) { --- 444,454 ---- /** ! * After some data has been scanned, use the configured feeder (see Scanner) to ! * submit it to the pipeline. This method does not accept a map of attributes - ! * it will create one and add the path to the attributes ! * ! * @param data raw data from scan ! * @param path location of data ! * @return success flag */ protected boolean enqueue(byte[] data, String path) { *************** *** 461,470 **** /** ! * Simplified enqueue method ! * ! * @param data ! * @param path ! * @param time ! * @return */ protected boolean enqueue(byte[] data, String path, long time) { --- 461,472 ---- /** ! * After some data has been scanned, use the configured feeder (see Scanner) to ! * submit it to the pipeline. This method does not accept a map of attributes - ! * it will create one and add the path and time to the attributes ! * ! * @param data raw data from scan ! * @param path location of data ! * @param time when the scan was made ! * @return success flag */ protected boolean enqueue(byte[] data, String path, long time) { *************** *** 480,487 **** * Another quick and easy way to enqueue some data * ! * @param data ! * array of bytes ! * @param pairs ! * name value pair array * @return success flag */ --- 482,487 ---- * Another quick and easy way to enqueue some data * ! * @param data array of bytes ! * @param pairs name value pair array to make the attribute map * @return success flag */ *************** *** 493,498 **** * Set the status on this object * ! * @param newStatus ! * DOCUMENT ME! */ private synchronized void setStatus(ScannerWorkerStatus newStatus) { --- 493,497 ---- * Set the status on this object * ! * @param newStatus state that this scanner worker */ private synchronized void setStatus(ScannerWorkerStatus newStatus) { *************** *** 504,508 **** * Get the currently defined feeder object * ! * @return */ public IFeeder getFeeder() { --- 503,507 ---- * Get the currently defined feeder object * ! * @return feeder object */ public IFeeder getFeeder() { *************** *** 522,527 **** * Set the log for this object * ! * @param log ! * new log */ protected void setLog(LogService log) { --- 521,525 ---- * Set the log for this object * ! * @param log new log */ protected void setLog(LogService log) { Index: ScannerFactory.java =================================================================== RCS file: /cvsroot/babeldoc/babeldoc/modules/scanner/src/com/babeldoc/scanner/ScannerFactory.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ScannerFactory.java 4 Dec 2003 00:44:42 -0000 1.12 --- ScannerFactory.java 25 Jul 2004 17:25:39 -0000 1.13 *************** *** 107,111 **** */ private ScannerFactory(String scannerConfigName) { ! log.logDebug("Creating ScannerFactory for scanner configuration " + scannerConfigName); //load worker configuration --- 107,112 ---- */ private ScannerFactory(String scannerConfigName) { ! if(log.isDebugEnabled()) ! log.logDebug("Creating ScannerFactory for scanner configuration " + scannerConfigName); //load worker configuration *************** *** 155,159 **** /** ! * Get scanner worker with name workerName. * * @param workerName name of scanner worker --- 156,162 ---- /** ! * Get scanner worker with name workerName. If the scanner is not ! * found in the cache, create a scanner of that name, configure it, ! * cache it and return it. * * @param workerName name of scanner worker *************** *** 181,187 **** /** ! * Get the list of workers ! * ! * @return DOCUMENT ME! */ public ScannerWorker[] getWorkers() { --- 184,188 ---- /** ! * @return Get the list of workers */ public ScannerWorker[] getWorkers() { *************** *** 197,201 **** /** ! * Configure a worker * * @param workerConfig configuration data --- 198,204 ---- /** ! * Create and configure a worker. The type of worker is used to create the ! * worker and the config options are then passed to the scanner worker to ! * configure it. * * @param workerConfig configuration data *************** *** 208,212 **** throws ScannerConfigurationException { ! log.logDebug("Configuring worker " + workerConfig.getName()); String workerType = workerConfig.getValue(ScannerWorkerInfo.SCANNER_TYPE); --- 211,216 ---- throws ScannerConfigurationException { ! if(log.isDebugEnabled()) ! log.logDebug("Configuring worker " + workerConfig.getName()); String workerType = workerConfig.getValue(ScannerWorkerInfo.SCANNER_TYPE); *************** *** 215,219 **** try { ScannerWorker worker = (ScannerWorker) type.getTypeInstance(); ! log.logDebug("Creating worker instance for type " + type.getTypeName()); worker.configure(workerConfig); --- 219,224 ---- try { ScannerWorker worker = (ScannerWorker) type.getTypeInstance(); ! if(log.isDebugEnabled()) ! log.logDebug("Creating worker instance for type " + type.getTypeName()); worker.configure(workerConfig); *************** *** 235,239 **** /** ! * Itialize workers for */ private void configureWorkers() { --- 240,244 ---- /** ! * Configure and cache all the works */ private void configureWorkers() { *************** *** 244,248 **** IConfigData config = configData.getChild(scannerName); ! log.logDebug("Getting configuration " + config); try { --- 249,255 ---- IConfigData config = configData.getChild(scannerName); ! ! if(log.isDebugEnabled()) ! log.logDebug("Getting configuration " + config); try { *************** *** 254,258 **** } } ! public void flushConfig() { factories.clear(); --- 261,268 ---- } } ! ! /** ! * null all the caches. ! */ public void flushConfig() { factories.clear(); |