netx.jnlp.cache

Class UpdatePolicy


public class UpdatePolicy
extends java.lang.Object

A policy that determines when a resource should be checked for an updated version.

Version:
$Revision: 1.3 $
Author:
Jon A. Maxwell (JAM) - initial author

Field Summary

static UpdatePolicy
ALWAYS
static UpdatePolicy
NEVER
static UpdatePolicy
SESSION

Constructor Summary

UpdatePolicy()
Create a new update policy; this policy always updates the entry unless the shouldUpdate method is overridden.
UpdatePolicy(long timeDiff)
Create an update policy that only checks a file for being updated if it has not been checked for longer than the specified time.

Method Summary

boolean
shouldUpdate(CacheEntry entry)
Returns whether the resource should be checked for being up-to-date.

Field Details

ALWAYS

public static UpdatePolicy ALWAYS

NEVER

public static UpdatePolicy NEVER

SESSION

public static UpdatePolicy SESSION

Constructor Details

UpdatePolicy

public UpdatePolicy()
Create a new update policy; this policy always updates the entry unless the shouldUpdate method is overridden.

UpdatePolicy

public UpdatePolicy(long timeDiff)
Create an update policy that only checks a file for being updated if it has not been checked for longer than the specified time.
Parameters:
timeDiff - how long in ms until update needed

Method Details

shouldUpdate

public boolean shouldUpdate(CacheEntry entry)
Returns whether the resource should be checked for being up-to-date.