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 String
TYPE_ACCESSED
static String
TYPE_CREATED
static String
TYPE_MODIFIED
static String
VERSION_INCLUDE
static String
VERSION_ONLY
static String
VERSION_SKIP
static String
WHEN_AFTER
static String
WHEN_BEFORE
-
Constructor Summary
Constructors Constructor Description RuleFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.".void
add(String when, String type, DateThingy dateThingy)
protected void
addType(String when, String type, DateThingy dateThingy)
protected void
addWhen(String when, String type, DateThingy dateThingy)
boolean
apply(long created, long accessed, long modified)
Returns true if the arguments match this filter.protected boolean
checkRule(String type, long time)
protected boolean
checkRule(HashMap<String,DateThingy> dd, long time)
protected void
checkType(String t)
protected void
checkWhen(String w)
protected RuleFilter
clone()
boolean
containsByType(String type)
boolean
containsByWhen(String when)
HashMap<String,DateThingy>
getByType(String type)
HashMap<String,DateThingy>
getByWhen(String when)
DateThingy
getDate(String when, String type)
HashMap<String,HashMap<String,DateThingy>>
getDatesByWhen()
String
getVersion()
boolean
hasDate(String when, String type)
Contains a date by when and type.boolean
isAllowOverride()
boolean
isVersion(String v)
RuleFilter
overrideFromParent(RuleFilter parent)
The argument is assumed to be the parent and this object overrides its values.void
setAllowOverride(boolean allowOverride)
void
setDatesByWhen(HashMap<String,HashMap<String,DateThingy>> datesByWhen)
void
setVersion(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()
-
-