net.sf.urlchecker.commands
Class URLMatchCommand

Package class diagram package URLMatchCommand
java.lang.Object
  extended by net.sf.urlchecker.commands.AbstractCommand
      extended by net.sf.urlchecker.commands.URLMatchCommand
All Implemented Interfaces:
Command

public class URLMatchCommand
extends AbstractCommand

The URLMatch Command. It extracts URLs from the input stream using the regular expression PATTERN configured in the configuration file and if none defined the GenericCommunicationFactory.DEFAULT_PATTERN

$Id: URLMatchCommand.java 182 2010-12-13 22:51:53Z georgosn $

Version:
$LastChangedRevision: 182 $
Author:
$LastChangedBy: georgosn $

Constructor Summary
URLMatchCommand(Command successor)
          Instantiates a new URL match command.
 
Method Summary
protected  Result getResult(String uri)
          Returns the result.
 Set<Result> process(Context context)
          This method processes the input Context and forwards the results on to the successor.
 
Methods inherited from class net.sf.urlchecker.commands.AbstractCommand
fireEvent, getSuccessor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLMatchCommand

public URLMatchCommand(Command successor)
Instantiates a new URL match command.

Parameters:
successor - the successor
Method Detail

getResult

protected Result getResult(String uri)
Returns the result.

Parameters:
uri - the uri
Returns:
the result

process

public Set<Result> process(Context context)
                    throws org.apache.commons.configuration.ConfigurationException
This method processes the input Context and forwards the results on to the successor. This implementation of the method simply checks if there are any successors and passes the context. if no successor is registered for the command then it merely returns the results from the context. The method also fires a BasicChainEvent before sending the control to the successor command with an END Type. This behavior allows the subclasses to concentrate in processing the input while the rest of the package releases all the features of event firing and handling. Events can be fired from within subclasses but it is better not to fire END events as this is handled here. START events though, must be fired in the subclasses if they are needed.

Specified by:
process in interface Command
Overrides:
process in class AbstractCommand
Parameters:
context - the input
Returns:
the set
Throws:
org.apache.commons.configuration.ConfigurationException - the configuration exception


Copyright © 2010 Nikolaos Georgosopoulos. All Rights Reserved.