keycloak
公開メンバ関数 | 静的公開メンバ関数 | 静的公開変数類 | 関数 | 非公開変数類 | 全メンバ一覧
org.keycloak.storage.client.ClientStorageProviderModel クラス
org.keycloak.storage.client.ClientStorageProviderModel の継承関係図
Inheritance graph
org.keycloak.storage.client.ClientStorageProviderModel 連携図
Collaboration graph

公開メンバ関数

 ClientStorageProviderModel ()
 
 ClientStorageProviderModel (ComponentModel copy)
 
void setEnabled (boolean flag)
 
boolean isEnabled ()
 
CachePolicy getCachePolicy ()
 
void setCachePolicy (CachePolicy cachePolicy)
 
long getMaxLifespan ()
 
void setMaxLifespan (long maxLifespan)
 
int getEvictionHour ()
 
void setEvictionHour (int evictionHour)
 
int getEvictionMinute ()
 
void setEvictionMinute (int evictionMinute)
 
int getEvictionDay ()
 
void setEvictionDay (int evictionDay)
 
long getCacheInvalidBefore ()
 
void setCacheInvalidBefore (long cacheInvalidBefore)
 
long getLifespan ()
 
boolean shouldInvalidate (CachedObject cached)
 
int getPriority ()
 
void setPriority (int priority)
 
String getId ()
 
void setId (String id)
 
String getName ()
 
void setName (String name)
 
MultivaluedHashMap< String, String > getConfig ()
 
void setConfig (MultivaluedHashMap< String, String > config)
 
boolean contains (String key)
 
String get (String key)
 
String get (String key, String defaultValue)
 
int get (String key, int defaultValue)
 
long get (String key, long defaultValue)
 
boolean get (String key, boolean defaultValue)
 
void put (String key, String value)
 
void put (String key, int value)
 
void put (String key, long value)
 
void put (String key, boolean value)
 
boolean hasNote (String key)
 
void setNote (String key, Object object)
 
String getProviderId ()
 
void setProviderId (String providerId)
 
String getProviderType ()
 
void setProviderType (String providerType)
 
String getParentId ()
 
void setParentId (String parentId)
 
String getSubType ()
 
void setSubType (String subType)
 

静的公開メンバ関数

static long dailyTimeout (int hour, int minute)
 
static long dailyEvictionBoundary (int hour, int minute)
 
static long weeklyTimeout (int day, int hour, int minute)
 
static int parsePriority (ComponentModel component)
 

静的公開変数類

static final String ENABLED = "enabled"
 
static final String CACHE_POLICY = "cachePolicy"
 
static final String MAX_LIFESPAN = "maxLifespan"
 
static final String EVICTION_HOUR = "evictionHour"
 
static final String EVICTION_MINUTE = "evictionMinute"
 
static final String EVICTION_DAY = "evictionDay"
 
static final String CACHE_INVALID_BEFORE = "cacheInvalidBefore"
 
static final String PRIORITY = "priority"
 
static Comparator< ComponentModelcomparator
 

関数

public< T > T getNote (String key)
 

非公開変数類

transient Boolean enabled
 

詳解

Stored configuration of a Client Storage provider instance.

著者
Bill Burke

構築子と解体子

◆ ClientStorageProviderModel() [1/2]

org.keycloak.storage.client.ClientStorageProviderModel.ClientStorageProviderModel ( )
inline
32  {
33  setProviderType(ClientStorageProvider.class.getName());
34  }
void setProviderType(String providerType)
Definition: ComponentModel.java:147

◆ ClientStorageProviderModel() [2/2]

org.keycloak.storage.client.ClientStorageProviderModel.ClientStorageProviderModel ( ComponentModel  copy)
inline
36  {
37  super(copy);
38  }

関数詳解

◆ contains()

boolean org.keycloak.component.ComponentModel.contains ( String  key)
inlineinherited
79  {
80  return config.containsKey(key);
81  }
MultivaluedHashMap< String, String > config
Definition: ComponentModel.java:39

◆ dailyEvictionBoundary()

static long org.keycloak.storage.CacheableStorageProviderModel.dailyEvictionBoundary ( int  hour,
int  minute 
)
inlinestaticinherited
236  {
237  Calendar cal = Calendar.getInstance();
238  cal.setTimeInMillis(Time.currentTimeMillis());
239  cal.set(Calendar.HOUR_OF_DAY, hour);
240  cal.set(Calendar.MINUTE, minute);
241  if (cal.getTimeInMillis() > Time.currentTimeMillis()) {
242  // if daily evict for today hasn't happened yet set boundary
243  // to yesterday's time of eviction
244  cal.add(Calendar.DAY_OF_YEAR, -1);
245  }
246  return cal.getTimeInMillis();
247  }

◆ dailyTimeout()

static long org.keycloak.storage.CacheableStorageProviderModel.dailyTimeout ( int  hour,
int  minute 
)
inlinestaticinherited
220  {
221  Calendar cal = Calendar.getInstance();
222  Calendar cal2 = Calendar.getInstance();
223  cal.setTimeInMillis(Time.currentTimeMillis());
224  cal2.setTimeInMillis(Time.currentTimeMillis());
225  cal2.set(Calendar.HOUR_OF_DAY, hour);
226  cal2.set(Calendar.MINUTE, minute);
227  if (cal2.getTimeInMillis() < cal.getTimeInMillis()) {
228  int add = (24 * 60 * 60 * 1000);
229  cal.add(Calendar.MILLISECOND, add);
230  } else {
231  cal = cal2;
232  }
233  return cal.getTimeInMillis();
234  }

◆ get() [1/5]

String org.keycloak.component.ComponentModel.get ( String  key)
inlineinherited
83  {
84  return config.getFirst(key);
85  }
V getFirst(K key)
Definition: MultivaluedHashMap.java:86
MultivaluedHashMap< String, String > config
Definition: ComponentModel.java:39

◆ get() [2/5]

String org.keycloak.component.ComponentModel.get ( String  key,
String  defaultValue 
)
inlineinherited
87  {
88  String s = config.getFirst(key);
89  return s != null ? s : defaultValue;
90  }
V getFirst(K key)
Definition: MultivaluedHashMap.java:86
MultivaluedHashMap< String, String > config
Definition: ComponentModel.java:39

◆ get() [3/5]

int org.keycloak.component.ComponentModel.get ( String  key,
int  defaultValue 
)
inlineinherited
92  {
93  String s = config.getFirst(key);
94  return s != null ? Integer.parseInt(s) : defaultValue;
95  }
V getFirst(K key)
Definition: MultivaluedHashMap.java:86
MultivaluedHashMap< String, String > config
Definition: ComponentModel.java:39

◆ get() [4/5]

long org.keycloak.component.ComponentModel.get ( String  key,
long  defaultValue 
)
inlineinherited
97  {
98  String s = config.getFirst(key);
99  return s != null ? Long.parseLong(s) : defaultValue;
100  }
V getFirst(K key)
Definition: MultivaluedHashMap.java:86
MultivaluedHashMap< String, String > config
Definition: ComponentModel.java:39

◆ get() [5/5]

boolean org.keycloak.component.ComponentModel.get ( String  key,
boolean  defaultValue 
)
inlineinherited
102  {
103  String s = config.getFirst(key);
104  return s != null ? Boolean.parseBoolean(s) : defaultValue;
105  }
V getFirst(K key)
Definition: MultivaluedHashMap.java:86
MultivaluedHashMap< String, String > config
Definition: ComponentModel.java:39

◆ getCacheInvalidBefore()

long org.keycloak.storage.CacheableStorageProviderModel.getCacheInvalidBefore ( )
inlineinherited
132  {
133  if (cacheInvalidBefore < 0) {
134  String str = getConfig().getFirst(CACHE_INVALID_BEFORE);
135  if (str == null) return -1;
136  cacheInvalidBefore = Long.valueOf(str);
137  }
138  return cacheInvalidBefore;
139  }
V getFirst(K key)
Definition: MultivaluedHashMap.java:86
transient long cacheInvalidBefore
Definition: CacheableStorageProviderModel.java:44
static final String CACHE_INVALID_BEFORE
Definition: CacheableStorageProviderModel.java:36
MultivaluedHashMap< String, String > getConfig()
Definition: ComponentModel.java:71

◆ getCachePolicy()

CachePolicy org.keycloak.storage.CacheableStorageProviderModel.getCachePolicy ( )
inlineinherited
54  {
55  if (cachePolicy == null) {
56  String str = getConfig().getFirst(CACHE_POLICY);
57  if (str == null) return null;
58  cachePolicy = CachePolicy.valueOf(str);
59  }
60  return cachePolicy;
61  }
V getFirst(K key)
Definition: MultivaluedHashMap.java:86
transient CachePolicy cachePolicy
Definition: CacheableStorageProviderModel.java:39
static final String CACHE_POLICY
Definition: CacheableStorageProviderModel.java:31
MultivaluedHashMap< String, String > getConfig()
Definition: ComponentModel.java:71

◆ getConfig()

MultivaluedHashMap<String, String> org.keycloak.component.ComponentModel.getConfig ( )
inlineinherited
71  {
72  return config;
73  }
MultivaluedHashMap< String, String > config
Definition: ComponentModel.java:39

◆ getEvictionDay()

int org.keycloak.storage.CacheableStorageProviderModel.getEvictionDay ( )
inlineinherited
117  {
118  if (evictionDay < 0) {
119  String str = getConfig().getFirst(EVICTION_DAY);
120  if (str == null) return -1;
121  evictionDay = Integer.valueOf(str);
122  }
123  return evictionDay;
124  }
V getFirst(K key)
Definition: MultivaluedHashMap.java:86
transient int evictionDay
Definition: CacheableStorageProviderModel.java:43
MultivaluedHashMap< String, String > getConfig()
Definition: ComponentModel.java:71
static final String EVICTION_DAY
Definition: CacheableStorageProviderModel.java:35

◆ getEvictionHour()

int org.keycloak.storage.CacheableStorageProviderModel.getEvictionHour ( )
inlineinherited
87  {
88  if (evictionHour < 0) {
89  String str = getConfig().getFirst(EVICTION_HOUR);
90  if (str == null) return -1;
91  evictionHour = Integer.valueOf(str);
92  }
93  return evictionHour;
94  }
V getFirst(K key)
Definition: MultivaluedHashMap.java:86
transient int evictionHour
Definition: CacheableStorageProviderModel.java:41
MultivaluedHashMap< String, String > getConfig()
Definition: ComponentModel.java:71
static final String EVICTION_HOUR
Definition: CacheableStorageProviderModel.java:33

◆ getEvictionMinute()

int org.keycloak.storage.CacheableStorageProviderModel.getEvictionMinute ( )
inlineinherited
102  {
103  if (evictionMinute < 0) {
104  String str = getConfig().getFirst(EVICTION_MINUTE);
105  if (str == null) return -1;
106  evictionMinute = Integer.valueOf(str);
107  }
108  return evictionMinute;
109  }
V getFirst(K key)
Definition: MultivaluedHashMap.java:86
transient int evictionMinute
Definition: CacheableStorageProviderModel.java:42
MultivaluedHashMap< String, String > getConfig()
Definition: ComponentModel.java:71
static final String EVICTION_MINUTE
Definition: CacheableStorageProviderModel.java:34

◆ getId()

String org.keycloak.component.ComponentModel.getId ( )
inlineinherited
55  {
56  return id;
57  }
String id
Definition: ComponentModel.java:33

◆ getLifespan()

long org.keycloak.storage.CacheableStorageProviderModel.getLifespan ( )
inlineinherited
164  {
165  UserStorageProviderModel.CachePolicy policy = getCachePolicy();
166  long lifespan = -1;
167  if (policy == null || policy == UserStorageProviderModel.CachePolicy.DEFAULT) {
168  lifespan = -1;
169  } else if (policy == CacheableStorageProviderModel.CachePolicy.EVICT_DAILY) {
170  if (getEvictionHour() > -1 && getEvictionMinute() > -1) {
171  lifespan = dailyTimeout(getEvictionHour(), getEvictionMinute()) - Time.currentTimeMillis();
172  }
173  } else if (policy == CacheableStorageProviderModel.CachePolicy.EVICT_WEEKLY) {
174  if (getEvictionDay() > 0 && getEvictionHour() > -1 && getEvictionMinute() > -1) {
175  lifespan = weeklyTimeout(getEvictionDay(), getEvictionHour(), getEvictionMinute()) - Time.currentTimeMillis();
176  }
177  } else if (policy == CacheableStorageProviderModel.CachePolicy.MAX_LIFESPAN) {
178  lifespan = getMaxLifespan();
179  }
180  return lifespan;
181  }
CacheableStorageProviderModel()
Definition: CacheableStorageProviderModel.java:47
int getEvictionMinute()
Definition: CacheableStorageProviderModel.java:102
static long weeklyTimeout(int day, int hour, int minute)
Definition: CacheableStorageProviderModel.java:249
long getMaxLifespan()
Definition: CacheableStorageProviderModel.java:73
int getEvictionHour()
Definition: CacheableStorageProviderModel.java:87
int getEvictionDay()
Definition: CacheableStorageProviderModel.java:117
CachePolicy getCachePolicy()
Definition: CacheableStorageProviderModel.java:54
static long dailyTimeout(int hour, int minute)
Definition: CacheableStorageProviderModel.java:220

◆ getMaxLifespan()

long org.keycloak.storage.CacheableStorageProviderModel.getMaxLifespan ( )
inlineinherited
73  {
74  if (maxLifespan < 0) {
75  String str = getConfig().getFirst(MAX_LIFESPAN);
76  if (str == null) return -1;
77  maxLifespan = Long.valueOf(str);
78  }
79  return maxLifespan;
80  }
transient long maxLifespan
Definition: CacheableStorageProviderModel.java:40
V getFirst(K key)
Definition: MultivaluedHashMap.java:86
MultivaluedHashMap< String, String > getConfig()
Definition: ComponentModel.java:71
static final String MAX_LIFESPAN
Definition: CacheableStorageProviderModel.java:32

◆ getName()

String org.keycloak.component.ComponentModel.getName ( )
inlineinherited
63  {
64  return name;
65  }
String name
Definition: ComponentModel.java:34

◆ getNote()

public<T> T org.keycloak.component.ComponentModel.getNote ( String  key)
inlinepackageinherited
127  {
128  return (T) notes.get(key);
129  }
transient ConcurrentHashMap< String, Object > notes
Definition: ComponentModel.java:40

◆ getParentId()

String org.keycloak.component.ComponentModel.getParentId ( )
inlineinherited
151  {
152  return parentId;
153  }
String parentId
Definition: ComponentModel.java:37

◆ getPriority()

int org.keycloak.component.PrioritizedComponentModel.getPriority ( )
inlineinherited
48  {
49  return parsePriority(this);
50 
51  }
static int parsePriority(ComponentModel component)
Definition: PrioritizedComponentModel.java:41

◆ getProviderId()

String org.keycloak.component.ComponentModel.getProviderId ( )
inlineinherited
135  {
136  return providerId;
137  }
String providerId
Definition: ComponentModel.java:35

◆ getProviderType()

String org.keycloak.component.ComponentModel.getProviderType ( )
inlineinherited
143  {
144  return providerType;
145  }
String providerType
Definition: ComponentModel.java:36

◆ getSubType()

String org.keycloak.component.ComponentModel.getSubType ( )
inlineinherited
159  {
160  return subType;
161  }
String subType
Definition: ComponentModel.java:38

◆ hasNote()

boolean org.keycloak.component.ComponentModel.hasNote ( String  key)
inlineinherited
123  {
124  return notes.containsKey(key);
125  }
transient ConcurrentHashMap< String, Object > notes
Definition: ComponentModel.java:40

◆ isEnabled()

boolean org.keycloak.storage.client.ClientStorageProviderModel.isEnabled ( )
inline
48  {
49  if (enabled == null) {
50  String val = getConfig().getFirst(ENABLED);
51  if (val == null) {
52  enabled = true;
53  } else {
54  enabled = Boolean.valueOf(val);
55  }
56  }
57  return enabled;
58 
59  }
V getFirst(K key)
Definition: MultivaluedHashMap.java:86
transient Boolean enabled
Definition: ClientStorageProviderModel.java:40
static final String ENABLED
Definition: ClientStorageProviderModel.java:30
MultivaluedHashMap< String, String > getConfig()
Definition: ComponentModel.java:71

◆ parsePriority()

static int org.keycloak.component.PrioritizedComponentModel.parsePriority ( ComponentModel  component)
inlinestaticinherited
41  {
42  String priority = component.getConfig().getFirst(PRIORITY);
43  if (priority == null) return 0;
44  return Integer.valueOf(priority);
45 
46  }
static final String PRIORITY
Definition: PrioritizedComponentModel.java:26

◆ put() [1/4]

void org.keycloak.component.ComponentModel.put ( String  key,
String  value 
)
inlineinherited
107  {
108  config.putSingle(key, value);
109  }
MultivaluedHashMap< String, String > config
Definition: ComponentModel.java:39
void putSingle(K key, V value)
Definition: MultivaluedHashMap.java:40

◆ put() [2/4]

void org.keycloak.component.ComponentModel.put ( String  key,
int  value 
)
inlineinherited
111  {
112  config.putSingle(key, Integer.toString(value));
113  }
MultivaluedHashMap< String, String > config
Definition: ComponentModel.java:39
void putSingle(K key, V value)
Definition: MultivaluedHashMap.java:40

◆ put() [3/4]

void org.keycloak.component.ComponentModel.put ( String  key,
long  value 
)
inlineinherited
115  {
116  config.putSingle(key, Long.toString(value));
117  }
MultivaluedHashMap< String, String > config
Definition: ComponentModel.java:39
void putSingle(K key, V value)
Definition: MultivaluedHashMap.java:40

◆ put() [4/4]

void org.keycloak.component.ComponentModel.put ( String  key,
boolean  value 
)
inlineinherited
119  {
120  config.putSingle(key, Boolean.toString(value));
121  }
MultivaluedHashMap< String, String > config
Definition: ComponentModel.java:39
void putSingle(K key, V value)
Definition: MultivaluedHashMap.java:40

◆ setCacheInvalidBefore()

void org.keycloak.storage.CacheableStorageProviderModel.setCacheInvalidBefore ( long  cacheInvalidBefore)
inlineinherited
141  {
144  }
transient long cacheInvalidBefore
Definition: CacheableStorageProviderModel.java:44
static final String CACHE_INVALID_BEFORE
Definition: CacheableStorageProviderModel.java:36
MultivaluedHashMap< String, String > getConfig()
Definition: ComponentModel.java:71
void putSingle(K key, V value)
Definition: MultivaluedHashMap.java:40

◆ setCachePolicy()

void org.keycloak.storage.CacheableStorageProviderModel.setCachePolicy ( CachePolicy  cachePolicy)
inlineinherited
63  {
64  this.cachePolicy = cachePolicy;
65  if (cachePolicy == null) {
66  getConfig().remove(CACHE_POLICY);
67 
68  } else {
70  }
71  }
transient CachePolicy cachePolicy
Definition: CacheableStorageProviderModel.java:39
static final String CACHE_POLICY
Definition: CacheableStorageProviderModel.java:31
MultivaluedHashMap< String, String > getConfig()
Definition: ComponentModel.java:71
void putSingle(K key, V value)
Definition: MultivaluedHashMap.java:40

◆ setConfig()

void org.keycloak.component.ComponentModel.setConfig ( MultivaluedHashMap< String, String >  config)
inlineinherited
75  {
76  this.config = config;
77  }
MultivaluedHashMap< String, String > config
Definition: ComponentModel.java:39

◆ setEnabled()

void org.keycloak.storage.client.ClientStorageProviderModel.setEnabled ( boolean  flag)
inline
42  {
43  enabled = flag;
44  getConfig().putSingle(ENABLED, Boolean.toString(flag));
45  }
transient Boolean enabled
Definition: ClientStorageProviderModel.java:40
static final String ENABLED
Definition: ClientStorageProviderModel.java:30
MultivaluedHashMap< String, String > getConfig()
Definition: ComponentModel.java:71
void putSingle(K key, V value)
Definition: MultivaluedHashMap.java:40

◆ setEvictionDay()

void org.keycloak.storage.CacheableStorageProviderModel.setEvictionDay ( int  evictionDay)
inlineinherited
126  {
127  if (evictionDay > 7 || evictionDay < 1) throw new IllegalArgumentException("Must be between 1 and 7");
128  this.evictionDay = evictionDay;
129  getConfig().putSingle(EVICTION_DAY, Integer.toString(evictionDay));
130  }
transient int evictionDay
Definition: CacheableStorageProviderModel.java:43
MultivaluedHashMap< String, String > getConfig()
Definition: ComponentModel.java:71
void putSingle(K key, V value)
Definition: MultivaluedHashMap.java:40
static final String EVICTION_DAY
Definition: CacheableStorageProviderModel.java:35

◆ setEvictionHour()

void org.keycloak.storage.CacheableStorageProviderModel.setEvictionHour ( int  evictionHour)
inlineinherited
96  {
97  if (evictionHour > 23 || evictionHour < 0) throw new IllegalArgumentException("Must be between 0 and 23");
99  getConfig().putSingle(EVICTION_HOUR, Integer.toString(evictionHour));
100  }
transient int evictionHour
Definition: CacheableStorageProviderModel.java:41
MultivaluedHashMap< String, String > getConfig()
Definition: ComponentModel.java:71
void putSingle(K key, V value)
Definition: MultivaluedHashMap.java:40
static final String EVICTION_HOUR
Definition: CacheableStorageProviderModel.java:33

◆ setEvictionMinute()

void org.keycloak.storage.CacheableStorageProviderModel.setEvictionMinute ( int  evictionMinute)
inlineinherited
111  {
112  if (evictionMinute > 59 || evictionMinute < 0) throw new IllegalArgumentException("Must be between 0 and 59");
114  getConfig().putSingle(EVICTION_MINUTE, Integer.toString(evictionMinute));
115  }
transient int evictionMinute
Definition: CacheableStorageProviderModel.java:42
MultivaluedHashMap< String, String > getConfig()
Definition: ComponentModel.java:71
void putSingle(K key, V value)
Definition: MultivaluedHashMap.java:40
static final String EVICTION_MINUTE
Definition: CacheableStorageProviderModel.java:34

◆ setId()

void org.keycloak.component.ComponentModel.setId ( String  id)
inlineinherited
59  {
60  this.id = id;
61  }
String id
Definition: ComponentModel.java:33

◆ setMaxLifespan()

void org.keycloak.storage.CacheableStorageProviderModel.setMaxLifespan ( long  maxLifespan)
inlineinherited
82  {
83  this.maxLifespan = maxLifespan;
84  getConfig().putSingle(MAX_LIFESPAN, Long.toString(maxLifespan));
85  }
transient long maxLifespan
Definition: CacheableStorageProviderModel.java:40
MultivaluedHashMap< String, String > getConfig()
Definition: ComponentModel.java:71
void putSingle(K key, V value)
Definition: MultivaluedHashMap.java:40
static final String MAX_LIFESPAN
Definition: CacheableStorageProviderModel.java:32

◆ setName()

void org.keycloak.component.ComponentModel.setName ( String  name)
inlineinherited
67  {
68  this.name = name;
69  }
String name
Definition: ComponentModel.java:34

◆ setNote()

void org.keycloak.component.ComponentModel.setNote ( String  key,
Object  object 
)
inlineinherited
131  {
132  notes.put(key, object);
133  }
transient ConcurrentHashMap< String, Object > notes
Definition: ComponentModel.java:40

◆ setParentId()

void org.keycloak.component.ComponentModel.setParentId ( String  parentId)
inlineinherited
155  {
156  this.parentId = parentId;
157  }
String parentId
Definition: ComponentModel.java:37

◆ setPriority()

void org.keycloak.component.PrioritizedComponentModel.setPriority ( int  priority)
inlineinherited
53  {
54  getConfig().putSingle("priority", Integer.toString(priority));
55  }
MultivaluedHashMap< String, String > getConfig()
Definition: ComponentModel.java:71
void putSingle(K key, V value)
Definition: MultivaluedHashMap.java:40

◆ setProviderId()

void org.keycloak.component.ComponentModel.setProviderId ( String  providerId)
inlineinherited
139  {
140  this.providerId = providerId;
141  }
String providerId
Definition: ComponentModel.java:35

◆ setProviderType()

void org.keycloak.component.ComponentModel.setProviderType ( String  providerType)
inlineinherited
147  {
148  this.providerType = providerType;
149  }
String providerType
Definition: ComponentModel.java:36

◆ setSubType()

void org.keycloak.component.ComponentModel.setSubType ( String  subType)
inlineinherited
163  {
164  this.subType = subType;
165  }
String subType
Definition: ComponentModel.java:38

◆ shouldInvalidate()

boolean org.keycloak.storage.CacheableStorageProviderModel.shouldInvalidate ( CachedObject  cached)
inlineinherited
183  {
184  boolean invalidate = false;
185  if (!isEnabled()) {
186  invalidate = true;
187  } else {
188  CacheableStorageProviderModel.CachePolicy policy = getCachePolicy();
189  if (policy != null) {
190  //String currentTime = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL).format(new Date(Time.currentTimeMillis()));
191  if (policy == CacheableStorageProviderModel.CachePolicy.NO_CACHE) {
192  invalidate = true;
193  } else if (cached.getCacheTimestamp() < getCacheInvalidBefore()) {
194  invalidate = true;
195  } else if (policy == CacheableStorageProviderModel.CachePolicy.MAX_LIFESPAN) {
196  if (cached.getCacheTimestamp() + getMaxLifespan() < Time.currentTimeMillis()) {
197  invalidate = true;
198  }
199  } else if (policy == CacheableStorageProviderModel.CachePolicy.EVICT_DAILY) {
200  long dailyBoundary = dailyEvictionBoundary(getEvictionHour(), getEvictionMinute());
201  if (cached.getCacheTimestamp() <= dailyBoundary) {
202  invalidate = true;
203  }
204  } else if (policy == CacheableStorageProviderModel.CachePolicy.EVICT_WEEKLY) {
205  int oneWeek = 7 * 24 * 60 * 60 * 1000;
207  long lastTimeout = weeklyTimeout - oneWeek;
208  //String timeout = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL).format(new Date(weeklyTimeout));
209  //String stamp = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL).format(new Date(cached.getCacheTimestamp()));
210  if (cached.getCacheTimestamp() <= lastTimeout) {
211  invalidate = true;
212  }
213  }
214  }
215  }
216  return invalidate;
217  }
CacheableStorageProviderModel()
Definition: CacheableStorageProviderModel.java:47
int getEvictionMinute()
Definition: CacheableStorageProviderModel.java:102
static long weeklyTimeout(int day, int hour, int minute)
Definition: CacheableStorageProviderModel.java:249
long getMaxLifespan()
Definition: CacheableStorageProviderModel.java:73
static long dailyEvictionBoundary(int hour, int minute)
Definition: CacheableStorageProviderModel.java:236
int getEvictionHour()
Definition: CacheableStorageProviderModel.java:87
int getEvictionDay()
Definition: CacheableStorageProviderModel.java:117
boolean isEnabled()
Definition: CacheableStorageProviderModel.java:151
CachePolicy getCachePolicy()
Definition: CacheableStorageProviderModel.java:54
long getCacheInvalidBefore()
Definition: CacheableStorageProviderModel.java:132

◆ weeklyTimeout()

static long org.keycloak.storage.CacheableStorageProviderModel.weeklyTimeout ( int  day,
int  hour,
int  minute 
)
inlinestaticinherited
249  {
250  Calendar cal = Calendar.getInstance();
251  Calendar cal2 = Calendar.getInstance();
252  cal.setTimeInMillis(Time.currentTimeMillis());
253  cal2.setTimeInMillis(Time.currentTimeMillis());
254  cal2.set(Calendar.HOUR_OF_DAY, hour);
255  cal2.set(Calendar.MINUTE, minute);
256  cal2.set(Calendar.DAY_OF_WEEK, day);
257  if (cal2.getTimeInMillis() < cal.getTimeInMillis()) {
258  int add = (7 * 24 * 60 * 60 * 1000);
259  cal2.add(Calendar.MILLISECOND, add);
260  }
261 
262  return cal2.getTimeInMillis();
263  }

メンバ詳解

◆ CACHE_INVALID_BEFORE

final String org.keycloak.storage.CacheableStorageProviderModel.CACHE_INVALID_BEFORE = "cacheInvalidBefore"
staticinherited

◆ CACHE_POLICY

final String org.keycloak.storage.CacheableStorageProviderModel.CACHE_POLICY = "cachePolicy"
staticinherited

◆ comparator

Comparator<ComponentModel> org.keycloak.component.PrioritizedComponentModel.comparator
staticinherited
初期値:
= new Comparator<ComponentModel>() {
@Override
public int compare(ComponentModel o1, ComponentModel o2) {
return parsePriority(o1) - parsePriority(o2);
}
}

◆ ENABLED

final String org.keycloak.storage.client.ClientStorageProviderModel.ENABLED = "enabled"
static

◆ enabled

transient Boolean org.keycloak.storage.client.ClientStorageProviderModel.enabled
private

◆ EVICTION_DAY

final String org.keycloak.storage.CacheableStorageProviderModel.EVICTION_DAY = "evictionDay"
staticinherited

◆ EVICTION_HOUR

final String org.keycloak.storage.CacheableStorageProviderModel.EVICTION_HOUR = "evictionHour"
staticinherited

◆ EVICTION_MINUTE

final String org.keycloak.storage.CacheableStorageProviderModel.EVICTION_MINUTE = "evictionMinute"
staticinherited

◆ MAX_LIFESPAN

final String org.keycloak.storage.CacheableStorageProviderModel.MAX_LIFESPAN = "maxLifespan"
staticinherited

◆ PRIORITY

final String org.keycloak.component.PrioritizedComponentModel.PRIORITY = "priority"
staticinherited

このクラス詳解は次のファイルから抽出されました: