From ac29dbbca6b1a0d24167e41c9c7e1a177caa6331 Mon Sep 17 00:00:00 2001 From: Martin Schreier Date: Mon, 3 Jan 2022 20:26:19 +0100 Subject: [PATCH] Switching to generics for cache implementation --- .../src/test/resources/spring-context.xml | 2 ++ .../services/DefaultRoleManagementService.java | 2 +- .../archiva/redback/keys/AuthenticationKey.java | 3 ++- .../main/resources/META-INF/spring-context.xml | 4 +++- .../src/test/resources/spring-context.xml | 4 +++- .../apache/archiva/redback/rbac/Operation.java | 4 +++- .../apache/archiva/redback/rbac/Permission.java | 4 +++- .../apache/archiva/redback/rbac/Resource.java | 4 +++- .../org/apache/archiva/redback/rbac/Role.java | 3 ++- .../archiva/redback/rbac/UserAssignment.java | 3 ++- .../main/resources/META-INF/spring-context.xml | 16 ++++++++++++++++ .../src/test/resources/spring-context.xml | 4 ++++ .../main/resources/META-INF/spring-context.xml | 2 ++ .../src/test/resources/spring-context.xml | 3 +++ .../main/resources/META-INF/spring-context.xml | 2 ++ .../src/test/resources/spring-context.xml | 2 ++ .../main/resources/META-INF/spring-context.xml | 4 ++++ 17 files changed, 57 insertions(+), 9 deletions(-) diff --git a/redback-authorization/redback-authorization-providers/redback-authorization-rbac/src/test/resources/spring-context.xml b/redback-authorization/redback-authorization-providers/redback-authorization-rbac/src/test/resources/spring-context.xml index 24445868..8ba1268f 100644 --- a/redback-authorization/redback-authorization-providers/redback-authorization-rbac/src/test/resources/spring-context.xml +++ b/redback-authorization/redback-authorization-providers/redback-authorization-rbac/src/test/resources/spring-context.xml @@ -39,6 +39,8 @@ + + diff --git a/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/DefaultRoleManagementService.java b/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/DefaultRoleManagementService.java index 900829e3..d0c36a8a 100644 --- a/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/DefaultRoleManagementService.java +++ b/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/DefaultRoleManagementService.java @@ -473,7 +473,7 @@ public class DefaultRoleManagementService try { org.apache.archiva.redback.rbac.Role rbacRole = rbacManager.getRole( roleName ); - rbacRole.setDescription( description ); + rbacRole.setDescription( description == null ? "" : description); rbacManager.saveRole( rbacRole ); } catch ( RbacManagerException e ) diff --git a/redback-keys/redback-keys-api/src/main/java/org/apache/archiva/redback/keys/AuthenticationKey.java b/redback-keys/redback-keys-api/src/main/java/org/apache/archiva/redback/keys/AuthenticationKey.java index 241cba0e..393b3495 100644 --- a/redback-keys/redback-keys-api/src/main/java/org/apache/archiva/redback/keys/AuthenticationKey.java +++ b/redback-keys/redback-keys-api/src/main/java/org/apache/archiva/redback/keys/AuthenticationKey.java @@ -19,6 +19,7 @@ package org.apache.archiva.redback.keys; * under the License. */ +import java.io.Serializable; import java.util.Date; /** @@ -29,7 +30,7 @@ import java.util.Date; * @author Joakim Erdfelt * */ -public interface AuthenticationKey +public interface AuthenticationKey extends Serializable { Date getDateCreated(); diff --git a/redback-keys/redback-keys-providers/redback-keys-cached/src/main/resources/META-INF/spring-context.xml b/redback-keys/redback-keys-providers/redback-keys-cached/src/main/resources/META-INF/spring-context.xml index e81c27d9..98767354 100644 --- a/redback-keys/redback-keys-providers/redback-keys-cached/src/main/resources/META-INF/spring-context.xml +++ b/redback-keys/redback-keys-providers/redback-keys-cached/src/main/resources/META-INF/spring-context.xml @@ -33,11 +33,13 @@ + + - + diff --git a/redback-keys/redback-keys-providers/redback-keys-cached/src/test/resources/spring-context.xml b/redback-keys/redback-keys-providers/redback-keys-cached/src/test/resources/spring-context.xml index bae49675..c787844c 100644 --- a/redback-keys/redback-keys-providers/redback-keys-cached/src/test/resources/spring-context.xml +++ b/redback-keys/redback-keys-providers/redback-keys-cached/src/test/resources/spring-context.xml @@ -39,11 +39,13 @@ + + - + diff --git a/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/Operation.java b/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/Operation.java index 4fa9da80..dd754641 100644 --- a/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/Operation.java +++ b/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/Operation.java @@ -16,6 +16,8 @@ package org.apache.archiva.redback.rbac; * limitations under the License. */ +import java.io.Serializable; + /** * Operation * @@ -27,7 +29,7 @@ package org.apache.archiva.redback.rbac; * @author Joakim Erdfelt * */ -public interface Operation +public interface Operation extends Serializable { diff --git a/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/Permission.java b/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/Permission.java index f0bcf4b9..b080aaa5 100644 --- a/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/Permission.java +++ b/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/Permission.java @@ -16,6 +16,8 @@ package org.apache.archiva.redback.rbac; * limitations under the License. */ +import java.io.Serializable; + /** * Permission * @@ -28,7 +30,7 @@ package org.apache.archiva.redback.rbac; * @author Joakim Erdfelt * */ -public interface Permission +public interface Permission extends Serializable { /** diff --git a/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/Resource.java b/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/Resource.java index 9ec08767..f1778e26 100644 --- a/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/Resource.java +++ b/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/Resource.java @@ -16,6 +16,8 @@ package org.apache.archiva.redback.rbac; * limitations under the License. */ +import java.io.Serializable; + /** * Resource * @@ -37,7 +39,7 @@ package org.apache.archiva.redback.rbac; * @author Joakim Erdfelt * */ -public interface Resource +public interface Resource extends Serializable { /** * Resource identifier refering to all objects. diff --git a/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/Role.java b/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/Role.java index f389d82e..168e8ea1 100644 --- a/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/Role.java +++ b/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/Role.java @@ -18,6 +18,7 @@ package org.apache.archiva.redback.rbac; import org.apache.commons.lang3.StringUtils; +import java.io.Serializable; import java.util.List; /** @@ -36,7 +37,7 @@ import java.util.List; * @author Martin Stockhammer * */ -public interface Role +public interface Role extends Serializable { /** diff --git a/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/UserAssignment.java b/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/UserAssignment.java index 5d1b9741..314b31e1 100644 --- a/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/UserAssignment.java +++ b/redback-rbac/redback-rbac-model/src/main/java/org/apache/archiva/redback/rbac/UserAssignment.java @@ -1,5 +1,6 @@ package org.apache.archiva.redback.rbac; +import java.io.Serializable; import java.util.List; /* @@ -29,7 +30,7 @@ import java.util.List; * * TODO expand on javadoc */ -public interface UserAssignment +public interface UserAssignment extends Serializable { diff --git a/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/main/resources/META-INF/spring-context.xml b/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/main/resources/META-INF/spring-context.xml index 33541b8c..2e8db906 100644 --- a/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/main/resources/META-INF/spring-context.xml +++ b/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/main/resources/META-INF/spring-context.xml @@ -33,6 +33,8 @@ + + @@ -44,6 +46,8 @@ + + @@ -55,6 +59,8 @@ + + @@ -66,6 +72,8 @@ + + @@ -77,6 +85,8 @@ + + @@ -88,6 +98,8 @@ + + @@ -103,6 +115,8 @@ + + @@ -114,6 +128,8 @@ + + diff --git a/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/test/resources/spring-context.xml b/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/test/resources/spring-context.xml index 6fb402ac..c78ea75e 100755 --- a/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/test/resources/spring-context.xml +++ b/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/test/resources/spring-context.xml @@ -53,6 +53,8 @@ + + @@ -64,6 +66,8 @@ + + diff --git a/redback-rbac/redback-rbac-providers/redback-rbac-ldap/src/main/resources/META-INF/spring-context.xml b/redback-rbac/redback-rbac-providers/redback-rbac-ldap/src/main/resources/META-INF/spring-context.xml index 731ff221..69397e32 100644 --- a/redback-rbac/redback-rbac-providers/redback-rbac-ldap/src/main/resources/META-INF/spring-context.xml +++ b/redback-rbac/redback-rbac-providers/redback-rbac-ldap/src/main/resources/META-INF/spring-context.xml @@ -33,6 +33,8 @@ + + diff --git a/redback-rbac/redback-rbac-providers/redback-rbac-ldap/src/test/resources/spring-context.xml b/redback-rbac/redback-rbac-providers/redback-rbac-ldap/src/test/resources/spring-context.xml index ddf426e0..2c118217 100755 --- a/redback-rbac/redback-rbac-providers/redback-rbac-ldap/src/test/resources/spring-context.xml +++ b/redback-rbac/redback-rbac-providers/redback-rbac-ldap/src/test/resources/spring-context.xml @@ -100,6 +100,9 @@ + + + diff --git a/redback-users/redback-users-providers/redback-users-cached/src/main/resources/META-INF/spring-context.xml b/redback-users/redback-users-providers/redback-users-cached/src/main/resources/META-INF/spring-context.xml index fce2e307..e5ff62ea 100644 --- a/redback-users/redback-users-providers/redback-users-cached/src/main/resources/META-INF/spring-context.xml +++ b/redback-users/redback-users-providers/redback-users-cached/src/main/resources/META-INF/spring-context.xml @@ -33,6 +33,8 @@ + + diff --git a/redback-users/redback-users-providers/redback-users-cached/src/test/resources/spring-context.xml b/redback-users/redback-users-providers/redback-users-cached/src/test/resources/spring-context.xml index 23ba2869..d8b08783 100644 --- a/redback-users/redback-users-providers/redback-users-cached/src/test/resources/spring-context.xml +++ b/redback-users/redback-users-providers/redback-users-cached/src/test/resources/spring-context.xml @@ -39,6 +39,8 @@ + + diff --git a/redback-users/redback-users-providers/redback-users-ldap/src/main/resources/META-INF/spring-context.xml b/redback-users/redback-users-providers/redback-users-ldap/src/main/resources/META-INF/spring-context.xml index 996107d2..d342e32a 100644 --- a/redback-users/redback-users-providers/redback-users-ldap/src/main/resources/META-INF/spring-context.xml +++ b/redback-users/redback-users-providers/redback-users-ldap/src/main/resources/META-INF/spring-context.xml @@ -34,6 +34,8 @@ + + @@ -47,6 +49,8 @@ + +