org.abstracthorizon.danube.http.matcher
Class Prefix

java.lang.Object
  extended by org.abstracthorizon.danube.http.matcher.AbstractMatcher
      extended by org.abstracthorizon.danube.http.matcher.Prefix
All Implemented Interfaces:
Matcher

public class Prefix
extends AbstractMatcher

This matcher checks prefix of http URI. If URI starts with given prefix and follow character is "/" or "?" or URI is exactly the same length as prefix then it returns positive match

Author:
Daniel Sendula

Field Summary
protected  String prefix
          Prefix
 
Fields inherited from class org.abstracthorizon.danube.http.matcher.AbstractMatcher
connectionHandler, stopOnMatch
 
Constructor Summary
Prefix()
          Constructor
Prefix(ConnectionHandler connectionHandler, boolean stopOnMatch, String prefix)
          Constructor
Prefix(ConnectionHandler connectionHandler, String prefix)
          Constrcutor
 
Method Summary
 void adjustForInvocation(HTTPConnection httpConnection)
          Adjusts connection for nested connection handler to be invoked
 String getPrefix()
          Returns prefix
 boolean matches(HTTPConnection httpConnection)
          This matcher checks prefix of requested path.
 void setPrefix(String prefix)
          Sets prefix
 
Methods inherited from class org.abstracthorizon.danube.http.matcher.AbstractMatcher
getConnectionHandler, isStopOnMatch, setConnectionHandler, setStopOnMatch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

prefix

protected String prefix
Prefix

Constructor Detail

Prefix

public Prefix()
Constructor


Prefix

public Prefix(ConnectionHandler connectionHandler,
              String prefix)
Constrcutor

Parameters:
connectionHandler - connection handler
prefix - prefix

Prefix

public Prefix(ConnectionHandler connectionHandler,
              boolean stopOnMatch,
              String prefix)
Constructor

Parameters:
connectionHandler - connection handler
stopOnMatch - stop on match
prefix - prefix
Method Detail

getPrefix

public String getPrefix()
Returns prefix

Returns:
prefix

setPrefix

public void setPrefix(String prefix)
Sets prefix

Parameters:
prefix - prefix

matches

public boolean matches(HTTPConnection httpConnection)
This matcher checks prefix of requested path. If path starts with given prefix and following character is "/" or path is exactly the same length as prefix then it returns positive match

Parameters:
httpConnection - http connection
Returns:
true if uri from connection is matched

adjustForInvocation

public void adjustForInvocation(HTTPConnection httpConnection)
Adjusts connection for nested connection handler to be invoked

Parameters:
connection - connection to be a used


Copyright © 2005-2009 Abstract Horizon. All Rights Reserved.