net.krecan.m2_proxy.store
Class RegExpStoreValidator

java.lang.Object
  extended by net.krecan.m2_proxy.store.RegExpStoreValidator
All Implemented Interfaces:
StoreValidator

public class RegExpStoreValidator
extends Object
implements StoreValidator

Validates resources in the store. Decision is based on the regular expression and timeout.

Author:
Lukas Krecan

Nested Class Summary
static class RegExpStoreValidator.RegexpTimeout
          Helper class to store rexep together with time.
 
Field Summary
protected static int TIME_NOT_DEFINED
           
 
Fields inherited from interface net.krecan.m2_proxy.store.StoreValidator
EVERYTHING_VALID_VALIDATOR, NOTHING_VALID_VALIDATOR
 
Constructor Summary
RegExpStoreValidator()
           
 
Method Summary
 boolean isResourceValid(Resource resource)
          Decides if the entry in the store is valid.
protected  boolean matches(List regexpTimeouts, String resourcePath, long time)
          Check if resourcePath matches some regexp from the list.
protected  long parseTimeout(String timeout)
           
 void setExcludes(List excludeList)
           
 void setExcludesMap(Map excludeMap)
           
 void setIncludes(List includeList)
           
 void setIncludesMap(Map includeMap)
           
 boolean shouldStoreResource(Resource resource)
          Decides whether we should store the resource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TIME_NOT_DEFINED

protected static final int TIME_NOT_DEFINED
See Also:
Constant Field Values
Constructor Detail

RegExpStoreValidator

public RegExpStoreValidator()
Method Detail

shouldStoreResource

public boolean shouldStoreResource(Resource resource)
Description copied from interface: StoreValidator
Decides whether we should store the resource

Specified by:
shouldStoreResource in interface StoreValidator
Returns:

isResourceValid

public boolean isResourceValid(Resource resource)
Description copied from interface: StoreValidator
Decides if the entry in the store is valid. If resource is null, returns false.

Specified by:
isResourceValid in interface StoreValidator
Returns:

matches

protected boolean matches(List regexpTimeouts,
                          String resourcePath,
                          long time)
Check if resourcePath matches some regexp from the list. If the time is > 0 then checks timeout as well

Parameters:
regexpTimeouts -
resourcePath -
time -
Returns:

setIncludes

public void setIncludes(List includeList)

setExcludes

public void setExcludes(List excludeList)

setIncludesMap

public void setIncludesMap(Map includeMap)

parseTimeout

protected long parseTimeout(String timeout)

setExcludesMap

public void setExcludesMap(Map excludeMap)


Copyright © 2006 null. All Rights Reserved.