-
Notifications
You must be signed in to change notification settings - Fork 461
/
IdentifierCache.java
80 lines (48 loc) · 2.53 KB
/
IdentifierCache.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
package com.dotmarketing.business;
import com.dotmarketing.beans.Host;
import com.dotmarketing.beans.Identifier;
import com.dotmarketing.beans.VersionInfo;
import com.dotmarketing.portlets.contentlet.model.ContentletVersionInfo;
import java.util.List;
public abstract class IdentifierCache implements Cachable {
abstract protected void addIdentifierToCache(Identifier id);
abstract protected void addIdentifierToCache(Identifier id, Versionable v) ;
abstract protected void addIdentifierToCache(String identifier, String inode) ;
abstract protected Identifier getIdentifier(String identId);
abstract protected Identifier getIdentifier(Host host, String URI);
abstract protected Identifier getIdentifier(String hostId, String URI);
abstract protected String getIdentifierFromInode(Versionable versionable);
abstract protected String getIdentifierFromInode(String inode);
abstract protected void removeFromCacheByURI(String hostId, String URI);
abstract public void removeFromCacheByVersionable(Versionable versionable);
abstract public void removeFromCacheByIdentifier(String inode);
abstract public void removeFromCacheByInode(String inode);
abstract public VersionInfo getVersionInfo(String identifier);
abstract protected void addVersionInfoToCache(VersionInfo versionInfo);
abstract protected void removeVersionInfoFromCache(String identifier);
abstract protected ContentletVersionInfo getContentVersionInfo(String identifier, long lang);
abstract protected ContentletVersionInfo getContentVersionInfo(String identifier, long lang, String variantId);
abstract protected void addContentletVersionInfoToCache(ContentletVersionInfo contV);
abstract public void removeContentletVersionInfoToCache(String identifier, long lang);
abstract public void removeContentletVersionInfoToCache(String identifier, long lang, String variantId);
abstract public void clearCache();
public String[] getGroups() {
String[] groups = { getPrimaryGroup(), getVersionInfoGroup(),getVersionGroup(),get404Group() };
return groups;
}
public String getPrimaryGroup() {
return "IdentifierCache";
}
public String getVersionInfoGroup() {
return "VersionInfoCache";
}
public String getVersionGroup() {
return "VersionCache";
}
public String get404Group() {
return "Identifier404Cache";
}
public abstract void putContentVersionInfos(String identifier,
List<ContentletVersionInfo> cvis);
public abstract List<ContentletVersionInfo> getContentVersionInfos(String identifier);
}