public class SnapshotManager extends Object
Modifier and Type | Field and Description |
---|---|
private DisabledInheritanceFilter |
disabledInheritanceFilter |
private Map<Integer,AnnotationSetSnapshot> |
snapshots |
Constructor and Description |
---|
SnapshotManager()
Create a new snapshot manager.
|
Modifier and Type | Method and Description |
---|---|
List<AnnotationSnapshot> |
findAnnotations(DbControl dc,
Annotatable item,
Filter<? super AnnotationSnapshot> filter,
boolean searchInherited) |
List<AnnotationSnapshot> |
findAnnotations(DbControl dc,
Annotatable item,
Filter<? super AnnotationSnapshot> filter,
boolean searchPrimary,
boolean searchInherited)
Utility method for calling
getSnapshot and findAnnotations
in one go. |
List<AnnotationSnapshot> |
findAnnotations(DbControl dc,
AnnotationSetSnapshot snapshot,
Filter<? super AnnotationSnapshot> filter,
boolean searchInherited)
Find annotations.
|
List<AnnotationSnapshot> |
findAnnotations(DbControl dc,
AnnotationSetSnapshot snapshot,
Filter<? super AnnotationSnapshot> filter,
boolean searchPrimary,
boolean searchInherited)
Search in a snapshot for all annotations matching a given filter.
|
static String |
getCacheKey(int annotationSetId)
The static cache key under which the snapshot for the
annotation set with the given id is cached.
|
AnnotationSetSnapshot |
getSnapshot(DbControl dc,
int annotationSetId)
Get the annotation snapshot for the annotation set with the given id.
|
static boolean |
removeSnapshot(int annotationSetId)
Removes a snapshot from the static cache.
|
static int |
removeSnapshots(List<Integer> annotationSetIds)
Removes a list of snapshots from the static cache.
|
private final Map<Integer,AnnotationSetSnapshot> snapshots
private DisabledInheritanceFilter disabledInheritanceFilter
public static String getCacheKey(int annotationSetId)
annotationSetId
- The ID of an annotation setpublic static boolean removeSnapshot(int annotationSetId)
annotationSetId
- The ID of the annotation setpublic static int removeSnapshots(List<Integer> annotationSetIds)
annotationSetIds
- A list with IDs of annotation set spublic AnnotationSetSnapshot getSnapshot(DbControl dc, int annotationSetId)
dc
- A DbControl to use if the snapshot has to be created from
the database cacheannotationSetId
- The id of the annotation setpublic List<AnnotationSnapshot> findAnnotations(DbControl dc, AnnotationSetSnapshot snapshot, Filter<? super AnnotationSnapshot> filter, boolean searchInherited)
public List<AnnotationSnapshot> findAnnotations(DbControl dc, AnnotationSetSnapshot snapshot, Filter<? super AnnotationSnapshot> filter, boolean searchPrimary, boolean searchInherited)
dc
- A DbControl to use for database access if a snapshot doesn't
exists for an inherited annotation setsnapshot
- The snapshot to searchfilter
- A filter that should match the wanted annotation snapshots
or null to match all annotationssearchPrimary
- TRUE if primary annotations should be searchedsearchInherited
- TRUE if inherited annotations should be searchedpublic List<AnnotationSnapshot> findAnnotations(DbControl dc, Annotatable item, Filter<? super AnnotationSnapshot> filter, boolean searchInherited)
public List<AnnotationSnapshot> findAnnotations(DbControl dc, Annotatable item, Filter<? super AnnotationSnapshot> filter, boolean searchPrimary, boolean searchInherited)
getSnapshot
and findAnnotations
in one go.getSnapshot(DbControl, int)
,
findAnnotations(DbControl, AnnotationSetSnapshot, Filter, boolean, boolean)