Class RuleFilter
- java.lang.Object
-
- org.oa4mp.delegation.server.storage.uuc.RuleFilter
-
public class RuleFilter extends Object
Created by Jeff Gaynor
on 2/12/24 at 1:48 PM
-
-
Field Summary
Fields Modifier and Type Field Description static StringTYPE_ACCESSEDstatic StringTYPE_CREATEDstatic StringTYPE_MODIFIEDstatic StringVERSION_INCLUDEstatic StringVERSION_ONLYstatic StringVERSION_SKIPstatic StringWHEN_AFTERstatic StringWHEN_BEFORE
-
Constructor Summary
Constructors Constructor Description RuleFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(String when, String type, String rawDate)This is to be invoked straight from the configuration and the date may be an ISO 8601 date or a raw string like "2000 sec.".voidadd(String when, String type, DateThingy dateThingy)protected voidaddType(String when, String type, DateThingy dateThingy)protected voidaddWhen(String when, String type, DateThingy dateThingy)booleanapply(long created, long accessed, long modified)Returns true if the arguments match this filter.protected booleancheckRule(String type, long time)protected booleancheckRule(HashMap<String,DateThingy> dd, long time)protected voidcheckType(String t)protected voidcheckWhen(String w)protected RuleFilterclone()booleancontainsByType(String type)booleancontainsByWhen(String when)HashMap<String,DateThingy>getByType(String type)HashMap<String,DateThingy>getByWhen(String when)DateThingygetDate(String when, String type)HashMap<String,HashMap<String,DateThingy>>getDatesByWhen()StringgetVersion()booleanhasDate(String when, String type)Contains a date by when and type.booleanisAllowOverride()booleanisVersion(String v)RuleFilteroverrideFromParent(RuleFilter parent)The argument is assumed to be the parent and this object overrides its values.voidsetAllowOverride(boolean allowOverride)voidsetDatesByWhen(HashMap<String,HashMap<String,DateThingy>> datesByWhen)voidsetVersion(String version)
-
-
-
Field Detail
-
WHEN_AFTER
public static final String WHEN_AFTER
- See Also:
- Constant Field Values
-
WHEN_BEFORE
public static final String WHEN_BEFORE
- See Also:
- Constant Field Values
-
TYPE_ACCESSED
public static final String TYPE_ACCESSED
- See Also:
- Constant Field Values
-
TYPE_CREATED
public static final String TYPE_CREATED
- See Also:
- Constant Field Values
-
TYPE_MODIFIED
public static final String TYPE_MODIFIED
- See Also:
- Constant Field Values
-
VERSION_SKIP
public static final String VERSION_SKIP
- See Also:
- Constant Field Values
-
VERSION_ONLY
public static final String VERSION_ONLY
- See Also:
- Constant Field Values
-
VERSION_INCLUDE
public static final String VERSION_INCLUDE
- See Also:
- Constant Field Values
-
-
Method Detail
-
checkWhen
protected void checkWhen(String w)
-
checkType
protected void checkType(String t)
-
getDatesByWhen
public HashMap<String,HashMap<String,DateThingy>> getDatesByWhen()
-
setDatesByWhen
public void setDatesByWhen(HashMap<String,HashMap<String,DateThingy>> datesByWhen)
-
add
public void add(String when, String type, String rawDate)
This is to be invoked straight from the configuration and the date may be an ISO 8601 date or a raw string like "2000 sec.". The default (as per contract) when no units are specified is seconds.- Parameters:
when-type-rawDate-
-
addWhen
protected void addWhen(String when, String type, DateThingy dateThingy)
-
addType
protected void addType(String when, String type, DateThingy dateThingy)
-
add
public void add(String when, String type, DateThingy dateThingy)
-
getDate
public DateThingy getDate(String when, String type)
-
getByType
public HashMap<String,DateThingy> getByType(String type)
-
getByWhen
public HashMap<String,DateThingy> getByWhen(String when)
-
containsByWhen
public boolean containsByWhen(String when)
-
containsByType
public boolean containsByType(String type)
-
hasDate
public boolean hasDate(String when, String type)
Contains a date by when and type.- Parameters:
when-type-- Returns:
-
getVersion
public String getVersion()
-
setVersion
public void setVersion(String version)
-
isVersion
public boolean isVersion(String v)
-
isAllowOverride
public boolean isAllowOverride()
-
setAllowOverride
public void setAllowOverride(boolean allowOverride)
-
overrideFromParent
public RuleFilter overrideFromParent(RuleFilter parent)
The argument is assumed to be the parent and this object overrides its values.- Parameters:
parent-- Returns:
-
apply
public boolean apply(long created, long accessed, long modified)Returns true if the arguments match this filter.- Parameters:
created-accessed-modified-- Returns:
-
checkRule
protected boolean checkRule(String type, long time)
-
checkRule
protected boolean checkRule(HashMap<String,DateThingy> dd, long time)
-
clone
protected RuleFilter clone()
-
-