Skip to content

Commit f755d5b

Browse files
gaynor@illinois.edugaynor@illinois.edu
authored andcommitted
5.4.2 release
1 parent 24fd5f2 commit f755d5b

969 files changed

Lines changed: 9009 additions & 6028 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.idea/workspace.xml

Lines changed: 973 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ several libraries, e.g. This is how the storage library would be referenced
88
<dependency>
99
<groupId>edu.uiuc.ncsa.security</groupId>
1010
<artifactId>storage</artifactId>
11-
<version>5.3-SNAPSHOT</version>
11+
<version>5.4.2</version>
1212
<scope>compile</scope>
1313
</dependency>
1414
```
@@ -53,7 +53,7 @@ project does not currently use `$NCSA_DEV_OUTPUT`.
5353
5454
# Rolling a release
5555

56-
The critical part is to replace the SNAPSHOT tag (e.g. 5.3-SNAPSHOT)
56+
The critical part is to replace the SNAPSHOT tag (e.g. 5.4.2)
5757
globally with your preferred version. Note that this tag will also be found in
5858
java files (so the system is aware of the current release version), so this
5959
change does not merely affect the pom.xml files. You should also be sure before

core/src/main/java/edu/uiuc/ncsa/security/core/cache/Cleanup.java

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public class Cleanup<K, V> extends MyThread {
3333
* If this set true, then any failures cause the cleanup to stop.<br/><br/>
3434
* If false, then this will attempt to remove all elements. Failures are logged in the
3535
* {@link #getFailures()} list.
36+
*
3637
* @return
3738
*/
3839
// Fixes https://github.com/ncsa/security-lib/issues/27
@@ -45,6 +46,7 @@ public void setFailOnError(boolean failOnError) {
4546
}
4647

4748
boolean failOnError = false;
49+
4850
public Cleanup(MyLoggingFacade logger, String name) {
4951
super(name, logger);
5052
}
@@ -71,13 +73,15 @@ public void setEnabledLocking(boolean enabledLocking) {
7173
public void info(List<V> removed) {
7274
info("removed:" + removed.size() + ", remaining:" + getMap().size());
7375
}
76+
7477
Store store;
7578

7679
/**
7780
* List of failures. Each entry is for the form
7881
* <pre>
7982
* id: message
8083
* </pre>
84+
*
8185
* @return
8286
*/
8387
public List<String> getFailures() {
@@ -94,11 +98,12 @@ public void setStore(Store store) {
9498
this.store = store;
9599
setMap(store);
96100
}
101+
97102
public List<V> age() {
98-
if(!isEnabledLocking() || isTestMode()){
103+
if (!isEnabledLocking() || isTestMode()) {
99104
return oldAge();
100105
}
101-
if(getStore().containsKey(lockID)){
106+
if (getStore().containsKey(lockID)) {
102107
info("Locked store for " + getName() + " at " + new Date());
103108
return new ArrayList<>();
104109
}
@@ -107,16 +112,17 @@ public List<V> age() {
107112
getStore().save(lock);
108113
try {
109114
return oldAge();
110-
}finally {
115+
} finally {
111116
// finally block executes even after a return.
112117
info("removing lock for " + getName() + " at " + new Date());
113118
getStore().remove(lockID);
114119
info("removed lock for " + getName());
115-
if(0 < getFailures().size()) {
120+
if (0 < getFailures().size()) {
116121
warn("cleanup failed to remove the following items: " + getFailures());
117122
}
118123
}
119124
}
125+
120126
/**
121127
* Clean out old entries by aging the elements, i.e., apply the retention policies.
122128
* Returns a list of the entries removed
@@ -133,23 +139,23 @@ protected List<V> oldAge() {
133139

134140
// copy the object's sorted list or we will get a concurrent modification exception
135141
for (K key : getSortedKeys()) {
136-
if(key.equals(lockID)){
142+
if (key.equals(lockID)) {
137143
continue;
138144
}
139145
V co = getMap().get(key);
140146
for (RetentionPolicy rp : getRetentionPolicies()) {
141147
// see if we should bother in the first place...
142148
if (rp.applies()) {
143149
if (!rp.retain(key, co)) {
144-
if(!isTestMode()){
150+
if (!isTestMode()) {
145151
debug("removing " + key);
146152
// Fixes https://github.com/ncsa/security-lib/issues/27
147153
try {
148154
getMap().remove(key);
149155
linkedList.add(co);
150-
}catch(Throwable t){
156+
} catch (Throwable t) {
151157
failures.add(key + ": " + t.getMessage());
152-
if(failOnError){
158+
if (failOnError) {
153159
throw t;
154160
}
155161
}
@@ -216,7 +222,7 @@ public void run() {
216222
try {
217223
Date nextRun = new Date();
218224
long nextCleanup = getNextSleepInterval();
219-
if(nextCleanup <=0){
225+
if (nextCleanup <= 0) {
220226
// this disables cleanup.
221227
warn("Cleanup disabled for " + getName() + ". Exiting...");
222228
setStopThread(true); //just in case
@@ -225,11 +231,15 @@ public void run() {
225231
nextRun.setTime(nextRun.getTime() + nextCleanup);
226232
info("next cleanup for " + getName() + " scheduled for " + nextRun);
227233
sleep(nextCleanup);
228-
234+
if (logger != null) {
235+
if (logger.getLogger() != null) {
236+
logger.getLogger().getLevel(); // tries to poke logging to keep it awake.
237+
}
238+
}
229239

230240
if (getMap() == null) {
231241
info("cleanup for " + getName() + " no entries, skipped at " + (new Date()));
232-
}else{
242+
} else {
233243
info("cleanup for " + getName() + " starting at " + (new Date()));
234244
try {
235245
List<V> removed = age();

docs/alt-index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2-
<!-- Generated by Apache Maven Doxia Site Renderer 1.11.1 from src/site/xhtml/alt-index.xhtml at 2023-05-24 -->
2+
<!-- Generated by Apache Maven Doxia Site Renderer 1.11.1 from src/site/xhtml/alt-index.xhtml at 2023-12-06 -->
33
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
44
<head>
55
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
@@ -23,9 +23,9 @@
2323
</div>
2424
<div id="breadcrumbs">
2525
<div class="xleft">
26-
<span id="publishDate">Last Published: 2023-05-24</span>
26+
<span id="publishDate">Last Published: 2023-12-06</span>
2727
</div>
28-
<div class="xright"> <span id="projectVersion">Version: 5.3-SNAPSHOT</span>
28+
<div class="xright"> <span id="projectVersion">Version: 5.4.2</span>
2929
</div>
3030
<div class="clear">
3131
<hr/>

0 commit comments

Comments
 (0)