@Singleton @Named public class DefaultUpdatePolicyAnalyzer extends java.lang.Object implements UpdatePolicyAnalyzer
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
LOGGER |
Constructor and Description |
---|
DefaultUpdatePolicyAnalyzer() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getEffectiveUpdatePolicy(RepositorySystemSession session,
java.lang.String policy1,
java.lang.String policy2)
Returns the policy with the shorter update interval.
|
private int |
getMinutes(java.lang.String policy) |
boolean |
isUpdatedRequired(RepositorySystemSession session,
long lastModified,
java.lang.String policy)
Determines whether the specified modification timestamp satisfies the freshness constraint expressed by the given
update policy.
|
private int |
ordinalOfUpdatePolicy(java.lang.String policy) |
public java.lang.String getEffectiveUpdatePolicy(RepositorySystemSession session, java.lang.String policy1, java.lang.String policy2)
UpdatePolicyAnalyzer
getEffectiveUpdatePolicy
in interface UpdatePolicyAnalyzer
session
- The repository system session during which the request is made, must not be null
.policy1
- A policy to compare, may be null
.policy2
- A policy to compare, may be null
.private int ordinalOfUpdatePolicy(java.lang.String policy)
public boolean isUpdatedRequired(RepositorySystemSession session, long lastModified, java.lang.String policy)
UpdatePolicyAnalyzer
isUpdatedRequired
in interface UpdatePolicyAnalyzer
session
- The repository system session during which the check is made, must not be null
.lastModified
- The timestamp to check against the update policy.policy
- The update policy, may be null
.true
if the specified timestamp is older than acceptable by the update policy, false
otherwise.private int getMinutes(java.lang.String policy)