Class SubjectSourceCacheItem
java.lang.Object
edu.internet2.middleware.grouper.subj.cache.SubjectSourceCacheItem
- All Implemented Interfaces:
Serializable
item in the subject source cache
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
expired()
if this is expiredboolean
expiredHelper
(int timeToLiveSeconds, int timeToLiveNotFoundSeconds) if this is expiredlong
millis since 1970 last accessed from cache or system of recordlong
millis since 1970 last retrieved from system of recordint
number of times this has been accessed totalint
number of time this has been accessed since last retrievedint
the subjectstatic int
if the subject has been used at least this many times in the last cycle then auto refresh the subject or else just remove the subject set to 0 to refresh allboolean
boolean
needsToBeResolvedHelper
(int timeToLiveSeconds, int timeToLiveSecondsPercentageToResolveSubjectsIfNecessary, int timeToLiveNotFoundSeconds, int timeToLiveNotFoundPercentageToResolveSubjectsIfNecessary, int minUseInCycleToAutoRefresh) if this is needs to be resolvedvoid
setLastAccessed
(long lastAccessed1) millis since 1970 last accessed from cache or system of recordvoid
setLastRetrieved
(long lastRetrieved1) millis since 1970 last retrieved from system of recordvoid
setNumberOfTimesAccessed
(int numberOfTimesAccessed1) number of times this has been accessed totalvoid
setNumberOfTimesAccessedSinceLastRetrieved
(int numberOfTimesAccessedSinceLastRetrieved1) number of time this has been accessed since last retrievedvoid
setNumberOfTimesRetrieved
(int numberOfTimesRetrieved1) number of times this has been accessed since last retrievedvoid
setSubject
(Subject subject1) the subjectstatic int
Resolve subjects again if necessary, after this percent of time to live for not found subjects.static int
static int
static int
Resolve subjects again if necessary, after this percent of time to live
-
Constructor Details
-
SubjectSourceCacheItem
public SubjectSourceCacheItem()
-
-
Method Details
-
getNumberOfTimesRetrieved
public int getNumberOfTimesRetrieved()- Returns:
- the numberOfTimesRetrieved
-
setNumberOfTimesRetrieved
public void setNumberOfTimesRetrieved(int numberOfTimesRetrieved1) number of times this has been accessed since last retrieved- Parameters:
numberOfTimesRetrieved1
- the numberOfTimesRetrieved to set
-
getNumberOfTimesAccessed
public int getNumberOfTimesAccessed()number of times this has been accessed total- Returns:
- the numberOfTimesRetrieved
-
setNumberOfTimesAccessed
public void setNumberOfTimesAccessed(int numberOfTimesAccessed1) number of times this has been accessed total- Parameters:
numberOfTimesAccessed1
- the numberOfTimesAccessed to set
-
expired
public boolean expired()if this is expired- Returns:
- true if expired
-
timeToLiveNotFoundSeconds
public static int timeToLiveNotFoundSeconds()- Returns:
- time to live of not found
-
timeToLiveSeconds
public static int timeToLiveSeconds()- Returns:
- time to live seconds
-
timeToLiveSecondsPercentageToResolveSubjectsIfNecessary
public static int timeToLiveSecondsPercentageToResolveSubjectsIfNecessary()Resolve subjects again if necessary, after this percent of time to live- Returns:
- time to live seconds
-
timeToLiveNotFoundPercentageToResolveSubjectsIfNecessary
public static int timeToLiveNotFoundPercentageToResolveSubjectsIfNecessary()Resolve subjects again if necessary, after this percent of time to live for not found subjects. note if the time to live for not found subjects is low, this has to be low too so there is time to resolve...- Returns:
- time to live seconds
-
minUseInCycleToAutoRefresh
public static int minUseInCycleToAutoRefresh()if the subject has been used at least this many times in the last cycle then auto refresh the subject or else just remove the subject set to 0 to refresh all- Returns:
- the min use
-
needsToBeResolved
public boolean needsToBeResolved()- Returns:
- subject needs to be resolved
-
needsToBeResolvedHelper
public boolean needsToBeResolvedHelper(int timeToLiveSeconds, int timeToLiveSecondsPercentageToResolveSubjectsIfNecessary, int timeToLiveNotFoundSeconds, int timeToLiveNotFoundPercentageToResolveSubjectsIfNecessary, int minUseInCycleToAutoRefresh) if this is needs to be resolved- Parameters:
timeToLiveSeconds
-timeToLiveSecondsPercentageToResolveSubjectsIfNecessary
-timeToLiveNotFoundSeconds
-timeToLiveNotFoundPercentageToResolveSubjectsIfNecessary
-minUseInCycleToAutoRefresh
-- Returns:
- true if expired
-
expiredHelper
public boolean expiredHelper(int timeToLiveSeconds, int timeToLiveNotFoundSeconds) if this is expired- Parameters:
timeToLiveSeconds
-timeToLiveNotFoundSeconds
-- Returns:
- true if expired
-
getSubject
the subject- Returns:
- the subject
-
setSubject
the subject- Parameters:
subject1
- the subject to set
-
getLastRetrieved
public long getLastRetrieved()millis since 1970 last retrieved from system of record- Returns:
- the lastRetrieved
-
setLastRetrieved
public void setLastRetrieved(long lastRetrieved1) millis since 1970 last retrieved from system of record- Parameters:
lastRetrieved1
- the lastRetrieved to set
-
getLastAccessed
public long getLastAccessed()millis since 1970 last accessed from cache or system of record- Returns:
- the lastAccessed
-
setLastAccessed
public void setLastAccessed(long lastAccessed1) millis since 1970 last accessed from cache or system of record- Parameters:
lastAccessed1
- the lastAccessed to set
-
getNumberOfTimesAccessedSinceLastRetrieved
public int getNumberOfTimesAccessedSinceLastRetrieved()number of time this has been accessed since last retrieved- Returns:
- the numberOfTimesAccessedSinceLastRetrieved
-
setNumberOfTimesAccessedSinceLastRetrieved
public void setNumberOfTimesAccessedSinceLastRetrieved(int numberOfTimesAccessedSinceLastRetrieved1) number of time this has been accessed since last retrieved- Parameters:
numberOfTimesAccessedSinceLastRetrieved1
- the numberOfTimesAccessedSinceLastRetrieved to set
-