You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by ol...@apache.org on 2012/04/06 11:59:32 UTC
svn commit: r1310268 [32/42] - in /archiva/redback/redback-core/trunk: ./
redback-authentication/ redback-authentication/redback-authentication-api/
redback-authentication/redback-authentication-api/src/
redback-authentication/redback-authentication-ap...
Added: archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/Resource.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/Resource.java?rev=1310268&view=auto
==============================================================================
--- archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/Resource.java (added)
+++ archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/Resource.java Fri Apr 6 09:58:14 2012
@@ -0,0 +1,99 @@
+package org.codehaus.plexus.redback.rbac;
+
+/*
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Resource
+ *
+ * Resources are things that can be paired up with operations inside of a
+ * permission.
+ *
+ * Rbac doesn't strictly specify what a resource (or Object) is, so there are a
+ * couple of variations planned for resources.
+ *
+ * Initially the resource is simply a string representaton of whatever you desire
+ * to match up to an operation. Eventually we want to support different types of
+ * expression evaluation for these resources, like a tuple resource. *-* where
+ * wildcards can be used on the resource definition to streamline the assigning of
+ * permissions for _large_ sets of things.
+ *
+ * @author Jesse McConnell <jm...@apache.org>
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public interface Resource
+{
+ /**
+ * Resource identifier refering to all objects.
+ */
+ public static final String GLOBAL = "*";
+
+ /**
+ * Resource identifier refering to no objects.
+ */
+ public static final String NULL = "-";
+
+ /**
+ * Get The string identifier for an operation.
+ *
+ * NOTE: This field is considered the Primary Key for this object.
+ */
+ public String getIdentifier();
+
+ /**
+ * true if the identifer is a pattern that is to be evaluated, for
+ * example x.* could match x.a or x.b and x.** could match x.foo
+ *
+ * Jesse: See {@link #setPattern(boolean)}
+ *
+ */
+ public boolean isPattern();
+
+ /**
+ * Set The string identifier for an operation.
+ *
+ * NOTE: This field is considered the Primary Key for this object.
+ *
+ * @param identifier
+ */
+ public void setIdentifier( String identifier );
+
+ /**
+ * true if the identifer is a pattern that is to be evaluated, for
+ * example x.* could match x.a or x.b and x.** could match x.foo
+ *
+ * TODO is this even a good idea?
+ * TODO we could look for a character like '*' or a string starting with "%/" to indicate if this is a pattern or not.
+ *
+ * @param pattern
+ */
+ public void setPattern( boolean pattern );
+
+ /**
+ * Test to see if the object is a permanent object or not.
+ *
+ * @return true if the object is permanent.
+ */
+ public boolean isPermanent();
+
+ /**
+ * Set flag indicating if the object is a permanent object or not.
+ *
+ * @param permanent true if the object is permanent.
+ */
+ public void setPermanent( boolean permanent );
+}
\ No newline at end of file
Propchange: archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/Resource.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/Resource.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/Role.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/Role.java?rev=1310268&view=auto
==============================================================================
--- archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/Role.java (added)
+++ archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/Role.java Fri Apr 6 09:58:14 2012
@@ -0,0 +1,144 @@
+package org.codehaus.plexus.redback.rbac;
+
+/*
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.List;
+
+/**
+ * Role
+ * <p/>
+ * A role is assignable to a user and effectively grants that user all of the
+ * permissions that are present in that role. A role can also contain other roles
+ * which add the permissions in those roles to the available permissions for authorization.
+ * <p/>
+ * A role can contain any number of permissions
+ * A role can contain any number of other roles
+ * A role can be assigned to any number of users
+ *
+ * @author Jesse McConnell <jm...@apache.org>
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public interface Role
+{
+
+ /**
+ * Method addPermission
+ *
+ * @param permission
+ */
+ void addPermission( Permission permission );
+
+ /**
+ * Method addChildRoleName
+ *
+ * @param name the name of the child role.
+ */
+ void addChildRoleName( String name );
+
+ /**
+ * Method getChildRoleNames
+ */
+ List<String> getChildRoleNames();
+
+ /**
+ * Convienence method to see if Role has Child Roles.
+ *
+ * @return true if child roles exists and has any roles being tracked.
+ */
+ boolean hasChildRoles();
+
+ /**
+ * Long description of the role.
+ */
+ String getDescription();
+
+ /**
+ * Get the name.
+ * <p/>
+ * NOTE: This field is considered the Primary Key for this object.
+ */
+ String getName();
+
+ /**
+ * Method getPermissions
+ */
+ List<Permission> getPermissions();
+
+ /**
+ * true if this role is available to be assigned to a user
+ */
+ boolean isAssignable();
+
+ /**
+ * Method removePermission
+ *
+ * @param permission
+ */
+ void removePermission( Permission permission );
+
+ /**
+ * true if this role is available to be assigned to a user
+ *
+ * @param assignable
+ */
+ void setAssignable( boolean assignable );
+
+ /**
+ * The names of the roles that will inherit the permissions of this role
+ *
+ * @param names the list of names of other roles.
+ */
+ void setChildRoleNames( List<String> names );
+
+ /**
+ * Set the Description
+ *
+ * @param description
+ */
+ void setDescription( String description );
+
+ /**
+ * Set Name
+ * <p/>
+ * NOTE: This field is considered the Primary Key for this object.
+ *
+ * @param name
+ */
+ void setName( String name );
+
+ /**
+ * Set Permissions
+ *
+ * @param permissions
+ */
+ void setPermissions( List<Permission> permissions );
+
+ /**
+ * Test to see if the object is a permanent object or not.
+ *
+ * @return true if the object is permanent.
+ */
+ boolean isPermanent();
+
+ /**
+ * Set flag indicating if the object is a permanent object or not.
+ *
+ * @param permanent true if the object is permanent.
+ */
+ void setPermanent( boolean permanent );
+}
\ No newline at end of file
Propchange: archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/Role.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/Role.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/TemplatedRole.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/TemplatedRole.java?rev=1310268&view=auto
==============================================================================
--- archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/TemplatedRole.java (added)
+++ archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/TemplatedRole.java Fri Apr 6 09:58:14 2012
@@ -0,0 +1,86 @@
+package org.codehaus.plexus.redback.rbac;
+
+/*
+ * Copyright 2005-2006 The Codehaus.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+/**
+ * TemplatedRole
+ *
+ * @author <a href="hisidro@exist.com">Henry Isidro</a>
+ */
+public class TemplatedRole
+{
+ private Role role;
+
+ private String templateNamePrefix;
+
+ private String delimiter;
+
+ public TemplatedRole(Role role, String templateNamePrefix, String delimeter)
+ {
+ this.role = role;
+ this.templateNamePrefix = templateNamePrefix;
+ this.delimiter = delimeter;
+ }
+
+ public String getResource()
+ {
+ int index = role.getName().indexOf( getDelimiter() );
+
+ return role.getName().substring( index + 3);
+ }
+
+ public Role getRole()
+ {
+ return role;
+ }
+
+ public void setRole( Role role )
+ {
+ this.role = role;
+ }
+
+ public String getTemplateNamePrefix()
+ {
+ return templateNamePrefix;
+ }
+
+ public void setTemplateNamePrefix( String templateNamePrefix )
+ {
+ this.templateNamePrefix = templateNamePrefix;
+ }
+
+ public String getDelimiter()
+ {
+ return delimiter;
+ }
+
+ public void setDelimiter( String delimiter )
+ {
+ this.delimiter = delimiter;
+ }
+
+ public String getName()
+ {
+ return this.role.getName();
+ }
+
+ public void setName( String name )
+ {
+ this.role.setName( name );
+ }
+}
Propchange: archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/TemplatedRole.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/TemplatedRole.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/UserAssignment.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/UserAssignment.java?rev=1310268&view=auto
==============================================================================
--- archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/UserAssignment.java (added)
+++ archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/UserAssignment.java Fri Apr 6 09:58:14 2012
@@ -0,0 +1,109 @@
+package org.codehaus.plexus.redback.rbac;
+
+import java.util.List;
+
+/*
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * UserAssignment - This the mapping object that takes the principal for a user and associates it with a
+ * set of Roles.
+ *
+ * This is the many to many mapping object needed by persistence stores.
+ *
+ * @author Jesse McConnell <jm...@apache.org>
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ * @todo expand on javadoc
+ */
+public interface UserAssignment
+{
+
+
+ /**
+ * The principal for the User that the set of roles is associated with.
+ *
+ * NOTE: This field is considered the Primary Key for this object.
+ *
+ * @return the principal for the User.
+ */
+ String getPrincipal();
+
+ /**
+ * Get the roles for this user.
+ *
+ * @return List of <{@link String}> objects representing the Role Names.
+ */
+ List<String> getRoleNames();
+
+ /**
+ * Add a rolename to this assignment.
+ *
+ * @param role the role.
+ */
+ void addRoleName( Role role );
+
+ /**
+ * Add a rolename to this assignment.
+ *
+ * @param roleName the role name.
+ */
+ void addRoleName( String roleName );
+
+ /**
+ * Remove a rolename from this assignment.
+ *
+ * @param role the role who's name is to be removed.
+ */
+ void removeRoleName( Role role );
+
+ /**
+ * Remove a role name from this assignment.
+ *
+ * @param roleName the role name to be removed.
+ */
+ void removeRoleName( String roleName );
+
+ /**
+ * Set the user principal object for this association.
+ *
+ * NOTE: This field is considered the Primary Key for this object.
+ *
+ * @param principal
+ */
+ void setPrincipal( String principal );
+
+ /**
+ * Set the roles names for this user.
+ *
+ * @param roles the List of <{@link String}> objects representing the Role Names.
+ */
+ void setRoleNames( List<String> roles );
+
+ /**
+ * Test to see if the object is a permanent object or not.
+ *
+ * @return true if the object is permanent.
+ */
+ boolean isPermanent();
+
+ /**
+ * Set flag indicating if the object is a permanent object or not.
+ *
+ * @param permanent true if the object is permanent.
+ */
+ void setPermanent( boolean permanent );
+}
\ No newline at end of file
Propchange: archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/UserAssignment.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-model/src/main/java/org/codehaus/plexus/redback/rbac/UserAssignment.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/pom.xml
URL: http://svn.apache.org/viewvc/archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/pom.xml?rev=1310268&view=auto
==============================================================================
--- archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/pom.xml (added)
+++ archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/pom.xml Fri Apr 6 09:58:14 2012
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright 2006 The Codehaus.
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.codehaus.redback</groupId>
+ <artifactId>redback-rbac</artifactId>
+ <version>1.5-SNAPSHOT</version>
+ </parent>
+ <artifactId>redback-rbac-providers</artifactId>
+ <name>Redback :: RBAC Providers</name>
+ <packaging>pom</packaging>
+ <modules>
+ <module>redback-rbac-jdo</module>
+ <module>redback-rbac-memory</module>
+ <module>redback-rbac-cached</module>
+ <!--
+ <module>redback-rbac-xstream</module>
+ <module>redback-rbac-ldap</module>
+ -->
+ </modules>
+</project>
Propchange: archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-cached/pom.xml
URL: http://svn.apache.org/viewvc/archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-cached/pom.xml?rev=1310268&view=auto
==============================================================================
--- archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-cached/pom.xml (added)
+++ archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-cached/pom.xml Fri Apr 6 09:58:14 2012
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright 2006 The Codehaus.
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.codehaus.redback</groupId>
+ <artifactId>redback-rbac-providers</artifactId>
+ <version>1.5-SNAPSHOT</version>
+ </parent>
+ <artifactId>redback-rbac-cached</artifactId>
+ <name>Redback :: RBAC Provider :: Cached</name>
+ <dependencies>
+ <dependency>
+ <groupId>org.codehaus.redback</groupId>
+ <artifactId>redback-system</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.redback</groupId>
+ <artifactId>redback-authorization-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.redback</groupId>
+ <artifactId>redback-rbac-model</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.redback.components.cache</groupId>
+ <artifactId>spring-cache-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.redback.components.cache</groupId>
+ <artifactId>spring-cache-ehcache</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.ehcache</groupId>
+ <artifactId>ehcache-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context-support</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>jsr250-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.redback</groupId>
+ <artifactId>redback-rbac-jdo</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.redback</groupId>
+ <artifactId>redback-rbac-memory</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.redback</groupId>
+ <artifactId>redback-rbac-tests</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
Propchange: archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-cached/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-cached/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/main/java/org/codehaus/plexus/redback/rbac/cached/CachedRbacManager.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/main/java/org/codehaus/plexus/redback/rbac/cached/CachedRbacManager.java?rev=1310268&view=auto
==============================================================================
--- archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/main/java/org/codehaus/plexus/redback/rbac/cached/CachedRbacManager.java (added)
+++ archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/main/java/org/codehaus/plexus/redback/rbac/cached/CachedRbacManager.java Fri Apr 6 09:58:14 2012
@@ -0,0 +1,877 @@
+package org.codehaus.plexus.redback.rbac.cached;
+
+/*
+ * Copyright 2001-2006 The Codehaus.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.codehaus.plexus.cache.Cache;
+import org.codehaus.plexus.redback.rbac.Operation;
+import org.codehaus.plexus.redback.rbac.Permission;
+import org.codehaus.plexus.redback.rbac.RBACManager;
+import org.codehaus.plexus.redback.rbac.RBACManagerListener;
+import org.codehaus.plexus.redback.rbac.RbacManagerException;
+import org.codehaus.plexus.redback.rbac.RbacObjectInvalidException;
+import org.codehaus.plexus.redback.rbac.RbacObjectNotFoundException;
+import org.codehaus.plexus.redback.rbac.Resource;
+import org.codehaus.plexus.redback.rbac.Role;
+import org.codehaus.plexus.redback.rbac.UserAssignment;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * CachedRbacManager is a wrapped RBACManager with caching.
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+@Service( "rBACManager#cached" )
+public class CachedRbacManager
+ implements RBACManager, RBACManagerListener
+{
+
+ private Logger log = LoggerFactory.getLogger( getClass() );
+
+ @Inject
+ @Named( value = "rBACManager#jdo" )
+ private RBACManager rbacImpl;
+
+ @Inject
+ @Named( value = "cache#operations" )
+ private Cache operationsCache;
+
+ @Inject
+ @Named( value = "cache#permissions" )
+ private Cache permissionsCache;
+
+ @Inject
+ @Named( value = "cache#resources" )
+ private Cache resourcesCache;
+
+ @Inject
+ @Named( value = "cache#roles" )
+ private Cache rolesCache;
+
+ @Inject
+ @Named( value = "cache#userAssignments" )
+ private Cache userAssignmentsCache;
+
+ @Inject
+ @Named( value = "cache#userPermissions" )
+ private Cache userPermissionsCache;
+
+ @Inject
+ @Named( value = "cache#effectiveRoleSet" )
+ private Cache effectiveRoleSetCache;
+
+ public void addChildRole( Role role, Role childRole )
+ throws RbacObjectInvalidException, RbacManagerException
+ {
+ try
+ {
+ this.rbacImpl.addChildRole( role, childRole );
+ }
+ finally
+ {
+ invalidateCachedRole( role );
+ invalidateCachedRole( childRole );
+ }
+ }
+
+ public void addListener( RBACManagerListener listener )
+ {
+ this.rbacImpl.addListener( listener );
+ }
+
+ public Operation createOperation( String name )
+ throws RbacManagerException
+ {
+ operationsCache.remove( name );
+ return this.rbacImpl.createOperation( name );
+ }
+
+ public Permission createPermission( String name )
+ throws RbacManagerException
+ {
+ permissionsCache.remove( name );
+ return this.rbacImpl.createPermission( name );
+ }
+
+ public Permission createPermission( String name, String operationName, String resourceIdentifier )
+ throws RbacManagerException
+ {
+ permissionsCache.remove( name );
+ return this.rbacImpl.createPermission( name, operationName, resourceIdentifier );
+ }
+
+ public Resource createResource( String identifier )
+ throws RbacManagerException
+ {
+ resourcesCache.remove( identifier );
+ return this.rbacImpl.createResource( identifier );
+ }
+
+ public Role createRole( String name )
+ {
+ rolesCache.remove( name );
+ return this.rbacImpl.createRole( name );
+ }
+
+ public UserAssignment createUserAssignment( String principal )
+ throws RbacManagerException
+ {
+ invalidateCachedUserAssignment( principal );
+ return this.rbacImpl.createUserAssignment( principal );
+ }
+
+ public void eraseDatabase()
+ {
+ try
+ {
+ this.rbacImpl.eraseDatabase();
+ }
+ finally
+ {
+ // FIXME cleanup
+ //EhcacheUtils.clearAllCaches( log() );
+ }
+ }
+
+ /**
+ * @see org.codehaus.plexus.redback.rbac.RBACManager#getAllAssignableRoles()
+ */
+ public List<Role> getAllAssignableRoles()
+ throws RbacManagerException, RbacObjectNotFoundException
+ {
+ log.debug( "NOT CACHED - .getAllAssignableRoles()" );
+ return this.rbacImpl.getAllAssignableRoles();
+ }
+
+ public List<Operation> getAllOperations()
+ throws RbacManagerException
+ {
+ log.debug( "NOT CACHED - .getAllOperations()" );
+ return this.rbacImpl.getAllOperations();
+ }
+
+ public List<Permission> getAllPermissions()
+ throws RbacManagerException
+ {
+ log.debug( "NOT CACHED - .getAllPermissions()" );
+ return this.rbacImpl.getAllPermissions();
+ }
+
+ public List<Resource> getAllResources()
+ throws RbacManagerException
+ {
+ log.debug( "NOT CACHED - .getAllResources()" );
+ return this.rbacImpl.getAllResources();
+ }
+
+ public List<Role> getAllRoles()
+ throws RbacManagerException
+ {
+ log.debug( "NOT CACHED - .getAllRoles()" );
+ return this.rbacImpl.getAllRoles();
+ }
+
+ public List<UserAssignment> getAllUserAssignments()
+ throws RbacManagerException
+ {
+ log.debug( "NOT CACHED - .getAllUserAssignments()" );
+ return this.rbacImpl.getAllUserAssignments();
+ }
+
+ /**
+ * @see org.codehaus.plexus.redback.rbac.RBACManager#getAssignedPermissionMap(java.lang.String)
+ */
+ @SuppressWarnings( "unchecked" )
+ public Map getAssignedPermissionMap( String principal )
+ throws RbacObjectNotFoundException, RbacManagerException
+ {
+ Object el = userPermissionsCache.get( principal );
+
+ if ( el != null )
+ {
+ //log.debug( "using cached user permission map" );
+ return (Map) el;
+ }
+ else
+ {
+ log.debug( "building user permission map" );
+ Map userPermMap = this.rbacImpl.getAssignedPermissionMap( principal );
+ userPermissionsCache.put( principal, userPermMap );
+ return userPermMap;
+ }
+ }
+
+ public Set<Permission> getAssignedPermissions( String principal )
+ throws RbacObjectNotFoundException, RbacManagerException
+ {
+ log.debug( "NOT CACHED - .getAssignedPermissions(String)" );
+ return this.rbacImpl.getAssignedPermissions( principal );
+ }
+
+ public Collection<Role> getAssignedRoles( String principal )
+ throws RbacObjectNotFoundException, RbacManagerException
+ {
+ log.debug( "NOT CACHED - .getAssignedRoles(String)" );
+ return this.rbacImpl.getAssignedRoles( principal );
+ }
+
+ public Collection<Role> getAssignedRoles( UserAssignment userAssignment )
+ throws RbacObjectNotFoundException, RbacManagerException
+ {
+ log.debug( "NOT CACHED - .getAssignedRoles(UserAssignment)" );
+ return this.rbacImpl.getAssignedRoles( userAssignment );
+ }
+
+ public Map<String, Role> getChildRoles( Role role )
+ throws RbacManagerException
+ {
+ log.debug( "NOT CACHED - .getChildRoles(Role)" );
+ return this.rbacImpl.getChildRoles( role );
+ }
+
+ public Map<String, Role> getParentRoles( Role role )
+ throws RbacManagerException
+ {
+ log.debug( "NOT CACHED - .getParentRoles(Role)" );
+ return this.rbacImpl.getParentRoles( role );
+ }
+
+ public Collection<Role> getEffectivelyAssignedRoles( String principal )
+ throws RbacObjectNotFoundException, RbacManagerException
+ {
+ log.debug( "NOT CACHED - .getEffectivelyAssignedRoles(String)" );
+ return this.rbacImpl.getEffectivelyAssignedRoles( principal );
+ }
+
+ public Collection<Role> getEffectivelyUnassignedRoles( String principal )
+ throws RbacManagerException, RbacObjectNotFoundException
+ {
+ log.debug( "NOT CACHED - .getEffectivelyUnassignedRoles(String)" );
+ return this.rbacImpl.getEffectivelyUnassignedRoles( principal );
+ }
+
+ @SuppressWarnings( "unchecked" )
+ public Set<Role> getEffectiveRoles( Role role )
+ throws RbacObjectNotFoundException, RbacManagerException
+ {
+ Set<Role> el = (Set<Role>) effectiveRoleSetCache.get( role.getName() );
+
+ if ( el != null )
+ {
+ log.debug( "using cached effective role set" );
+ return el;
+ }
+ else
+ {
+ log.debug( "building effective role set" );
+ Set<Role> effectiveRoleSet = this.rbacImpl.getEffectiveRoles( role );
+ effectiveRoleSetCache.put( role.getName(), effectiveRoleSet );
+ return effectiveRoleSet;
+ }
+ }
+
+ public Resource getGlobalResource()
+ throws RbacManagerException
+ {
+ /* this is very light */
+ log.debug( "NOT CACHED - .getGlobalResource()" );
+ return this.rbacImpl.getGlobalResource();
+ }
+
+ public Operation getOperation( String operationName )
+ throws RbacObjectNotFoundException, RbacManagerException
+ {
+ Object el = operationsCache.get( operationName );
+ if ( el != null )
+ {
+ return (Operation) el;
+ }
+ else
+ {
+ Operation operation = this.rbacImpl.getOperation( operationName );
+ operationsCache.put( operationName, operation );
+ return operation;
+ }
+ }
+
+ public Permission getPermission( String permissionName )
+ throws RbacObjectNotFoundException, RbacManagerException
+ {
+ Object el = permissionsCache.get( permissionName );
+ if ( el != null )
+ {
+ return (Permission) el;
+ }
+ else
+ {
+ Permission permission = this.rbacImpl.getPermission( permissionName );
+ permissionsCache.put( permissionName, permission );
+ return permission;
+ }
+ }
+
+ public Resource getResource( String resourceIdentifier )
+ throws RbacObjectNotFoundException, RbacManagerException
+ {
+ Object el = resourcesCache.get( resourceIdentifier );
+ if ( el != null )
+ {
+ return (Resource) el;
+ }
+ else
+ {
+ Resource resource = this.rbacImpl.getResource( resourceIdentifier );
+ resourcesCache.put( resourceIdentifier, resource );
+ return resource;
+ }
+ }
+
+ public Role getRole( String roleName )
+ throws RbacObjectNotFoundException, RbacManagerException
+ {
+ Object el = rolesCache.get( roleName );
+ if ( el != null )
+ {
+ return (Role) el;
+ }
+ else
+ {
+ Role role = this.rbacImpl.getRole( roleName );
+ rolesCache.put( roleName, role );
+ return role;
+ }
+ }
+
+ public Map<String, Role> getRoles( Collection<String> roleNames )
+ throws RbacObjectNotFoundException, RbacManagerException
+ {
+ log.debug( "NOT CACHED - .getRoles(Collection)" );
+ return this.rbacImpl.getRoles( roleNames );
+ }
+
+ public Collection<Role> getUnassignedRoles( String principal )
+ throws RbacManagerException, RbacObjectNotFoundException
+ {
+ log.debug( "NOT CACHED - .getUnassignedRoles(String)" );
+ return this.rbacImpl.getUnassignedRoles( principal );
+ }
+
+ public UserAssignment getUserAssignment( String principal )
+ throws RbacObjectNotFoundException, RbacManagerException
+ {
+ Object el = userAssignmentsCache.get( principal );
+ if ( el != null )
+ {
+ return (UserAssignment) el;
+ }
+ else
+ {
+ UserAssignment userAssignment = this.rbacImpl.getUserAssignment( principal );
+ userAssignmentsCache.put( principal, userAssignment );
+ return userAssignment;
+ }
+ }
+
+ public List<UserAssignment> getUserAssignmentsForRoles( Collection<String> roleNames )
+ throws RbacManagerException
+ {
+ log.debug( "NOT CACHED - .getUserAssignmentsForRoles(Collection)" );
+ return this.rbacImpl.getUserAssignmentsForRoles( roleNames );
+ }
+
+ public boolean operationExists( Operation operation )
+ {
+ if ( operation == null )
+ {
+ return false;
+ }
+
+ if ( operationsCache.hasKey( operation.getName() ) )
+ {
+ return true;
+ }
+
+ return this.rbacImpl.operationExists( operation );
+ }
+
+ public boolean operationExists( String name )
+ {
+ if ( operationsCache.hasKey( name ) )
+ {
+ return true;
+ }
+
+ return this.rbacImpl.operationExists( name );
+ }
+
+ public boolean permissionExists( Permission permission )
+ {
+ if ( permission == null )
+ {
+ return false;
+ }
+
+ if ( permissionsCache.hasKey( permission.getName() ) )
+ {
+ return true;
+ }
+
+ return this.rbacImpl.permissionExists( permission );
+ }
+
+ public boolean permissionExists( String name )
+ {
+ if ( permissionsCache.hasKey( name ) )
+ {
+ return true;
+ }
+
+ return this.rbacImpl.permissionExists( name );
+ }
+
+ public void rbacInit( boolean freshdb )
+ {
+ if ( rbacImpl instanceof RBACManagerListener )
+ {
+ ( (RBACManagerListener) this.rbacImpl ).rbacInit( freshdb );
+ }
+ // lookup all Cache and clear all ?
+ this.resourcesCache.clear();
+ this.operationsCache.clear();
+ this.permissionsCache.clear();
+ this.rolesCache.clear();
+ this.userAssignmentsCache.clear();
+ this.userPermissionsCache.clear();
+ }
+
+ public void rbacPermissionRemoved( Permission permission )
+ {
+ if ( rbacImpl instanceof RBACManagerListener )
+ {
+ ( (RBACManagerListener) this.rbacImpl ).rbacPermissionRemoved( permission );
+ }
+
+ invalidateCachedPermission( permission );
+ }
+
+ public void rbacPermissionSaved( Permission permission )
+ {
+ if ( rbacImpl instanceof RBACManagerListener )
+ {
+ ( (RBACManagerListener) this.rbacImpl ).rbacPermissionSaved( permission );
+ }
+
+ invalidateCachedPermission( permission );
+ }
+
+ public void rbacRoleRemoved( Role role )
+ {
+ if ( rbacImpl instanceof RBACManagerListener )
+ {
+ ( (RBACManagerListener) this.rbacImpl ).rbacRoleRemoved( role );
+ }
+
+ invalidateCachedRole( role );
+ }
+
+ public void rbacRoleSaved( Role role )
+ {
+ if ( rbacImpl instanceof RBACManagerListener )
+ {
+ ( (RBACManagerListener) this.rbacImpl ).rbacRoleSaved( role );
+ }
+
+ invalidateCachedRole( role );
+ }
+
+ public void rbacUserAssignmentRemoved( UserAssignment userAssignment )
+ {
+ if ( rbacImpl instanceof RBACManagerListener )
+ {
+ ( (RBACManagerListener) this.rbacImpl ).rbacUserAssignmentRemoved( userAssignment );
+ }
+
+ invalidateCachedUserAssignment( userAssignment );
+ }
+
+ public void rbacUserAssignmentSaved( UserAssignment userAssignment )
+ {
+ if ( rbacImpl instanceof RBACManagerListener )
+ {
+ ( (RBACManagerListener) this.rbacImpl ).rbacUserAssignmentSaved( userAssignment );
+ }
+
+ invalidateCachedUserAssignment( userAssignment );
+ }
+
+ public void removeListener( RBACManagerListener listener )
+ {
+ this.rbacImpl.removeListener( listener );
+ }
+
+ public void removeOperation( Operation operation )
+ throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
+ {
+ invalidateCachedOperation( operation );
+ this.rbacImpl.removeOperation( operation );
+ }
+
+ public void removeOperation( String operationName )
+ throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
+ {
+ operationsCache.remove( operationName );
+ this.rbacImpl.removeOperation( operationName );
+ }
+
+ public void removePermission( Permission permission )
+ throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
+ {
+ invalidateCachedPermission( permission );
+ this.rbacImpl.removePermission( permission );
+ }
+
+ public void removePermission( String permissionName )
+ throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
+ {
+ permissionsCache.remove( permissionName );
+ this.rbacImpl.removePermission( permissionName );
+ }
+
+ public void removeResource( Resource resource )
+ throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
+ {
+ invalidateCachedResource( resource );
+ this.rbacImpl.removeResource( resource );
+ }
+
+ public void removeResource( String resourceIdentifier )
+ throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
+ {
+ resourcesCache.remove( resourceIdentifier );
+ this.rbacImpl.removeResource( resourceIdentifier );
+ }
+
+ public void removeRole( Role role )
+ throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
+ {
+ invalidateCachedRole( role );
+ this.rbacImpl.removeRole( role );
+ }
+
+ public void removeRole( String roleName )
+ throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
+ {
+ rolesCache.remove( roleName );
+ this.rbacImpl.removeRole( roleName );
+ }
+
+ public void removeUserAssignment( String principal )
+ throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
+ {
+ invalidateCachedUserAssignment( principal );
+ this.rbacImpl.removeUserAssignment( principal );
+ }
+
+ public void removeUserAssignment( UserAssignment userAssignment )
+ throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
+ {
+ invalidateCachedUserAssignment( userAssignment );
+ this.rbacImpl.removeUserAssignment( userAssignment );
+ }
+
+ public boolean resourceExists( Resource resource )
+ {
+ if ( resourcesCache.hasKey( resource.getIdentifier() ) )
+ {
+ return true;
+ }
+
+ return this.rbacImpl.resourceExists( resource );
+ }
+
+ public boolean resourceExists( String identifier )
+ {
+ if ( resourcesCache.hasKey( identifier ) )
+ {
+ return true;
+ }
+
+ return this.rbacImpl.resourceExists( identifier );
+ }
+
+ public boolean roleExists( Role role )
+ {
+ if ( rolesCache.hasKey( role.getName() ) )
+ {
+ return true;
+ }
+
+ return this.rbacImpl.roleExists( role );
+ }
+
+ public boolean roleExists( String name )
+ {
+ if ( rolesCache.hasKey( name ) )
+ {
+ return true;
+ }
+
+ return this.rbacImpl.roleExists( name );
+ }
+
+ public Operation saveOperation( Operation operation )
+ throws RbacObjectInvalidException, RbacManagerException
+ {
+ invalidateCachedOperation( operation );
+ return this.rbacImpl.saveOperation( operation );
+ }
+
+ public Permission savePermission( Permission permission )
+ throws RbacObjectInvalidException, RbacManagerException
+ {
+ invalidateCachedPermission( permission );
+ return this.rbacImpl.savePermission( permission );
+ }
+
+ public Resource saveResource( Resource resource )
+ throws RbacObjectInvalidException, RbacManagerException
+ {
+ invalidateCachedResource( resource );
+ return this.rbacImpl.saveResource( resource );
+ }
+
+ public Role saveRole( Role role )
+ throws RbacObjectInvalidException, RbacManagerException
+ {
+ /*
+ List assignments = this.rbacImpl.getUserAssignmentsForRoles( Collections.singletonList( role.getName() ) );
+
+ for ( Iterator i = assignments.iterator(); i.hasNext(); )
+ {
+ log.debug( "invalidating user assignment with role " + role.getName() );
+ invalidateCachedUserAssignment( (UserAssignment)i.next() );
+ }
+ */
+
+ /*
+ the above commented out section would try and invalidate just that user caches that are effected by
+ changes in the users permissions map due to role changes.
+
+ however the implementations of those do not take into account child role hierarchies so wipe all
+ user caches on role saving...which is a heavy handed way to solve the problem, but not going to
+ happen frequently for current applications so not a huge deal.
+ */
+ invalidateAllCachedUserAssignments();
+ invalidateCachedRole( role );
+ return this.rbacImpl.saveRole( role );
+ }
+
+ public void saveRoles( Collection<Role> roles )
+ throws RbacObjectInvalidException, RbacManagerException
+ {
+
+ for ( Role role : roles )
+ {
+ invalidateCachedRole( role );
+ }
+
+ /*
+ List assignments = this.rbacImpl.getUserAssignmentsForRoles( roles );
+
+ for ( Iterator i = assignments.iterator(); i.hasNext(); )
+ {
+ log.debug( "invalidating user assignment with roles" );
+ invalidateCachedUserAssignment( (UserAssignment)i.next() );
+ }
+ */
+ invalidateAllCachedUserAssignments();
+ this.rbacImpl.saveRoles( roles );
+ }
+
+ public UserAssignment saveUserAssignment( UserAssignment userAssignment )
+ throws RbacObjectInvalidException, RbacManagerException
+ {
+ invalidateCachedUserAssignment( userAssignment );
+ return this.rbacImpl.saveUserAssignment( userAssignment );
+ }
+
+ public boolean userAssignmentExists( String principal )
+ {
+ if ( userAssignmentsCache.hasKey( principal ) )
+ {
+ return true;
+ }
+
+ return this.rbacImpl.userAssignmentExists( principal );
+ }
+
+ public boolean userAssignmentExists( UserAssignment assignment )
+ {
+ if ( userAssignmentsCache.hasKey( assignment.getPrincipal() ) )
+ {
+ return true;
+ }
+
+ return this.rbacImpl.userAssignmentExists( assignment );
+ }
+
+ private void invalidateCachedRole( Role role )
+ {
+ if ( role != null )
+ {
+ rolesCache.remove( role.getName() );
+ // if a role changes we need to invalidate the entire effective role set cache
+ // since we have no concept of the heirarchy involved in the role sets
+ effectiveRoleSetCache.clear();
+ }
+
+ }
+
+ private void invalidateCachedOperation( Operation operation )
+ {
+ if ( operation != null )
+ {
+ operationsCache.remove( operation.getName() );
+ }
+ }
+
+ private void invalidateCachedPermission( Permission permission )
+ {
+ if ( permission != null )
+ {
+ permissionsCache.remove( permission.getName() );
+ }
+ }
+
+ private void invalidateCachedResource( Resource resource )
+ {
+ if ( resource != null )
+ {
+ resourcesCache.remove( resource.getIdentifier() );
+ }
+ }
+
+ private void invalidateCachedUserAssignment( UserAssignment userAssignment )
+ {
+ if ( userAssignment != null )
+ {
+ userAssignmentsCache.remove( userAssignment.getPrincipal() );
+ userPermissionsCache.remove( userAssignment.getPrincipal() );
+ }
+ }
+
+ private void invalidateCachedUserAssignment( String principal )
+ {
+ userAssignmentsCache.remove( principal );
+ userPermissionsCache.remove( principal );
+ }
+
+ private void invalidateAllCachedUserAssignments()
+ {
+ userAssignmentsCache.clear();
+ userPermissionsCache.clear();
+ }
+
+ public Cache getOperationsCache()
+ {
+ return operationsCache;
+ }
+
+ public void setOperationsCache( Cache operationsCache )
+ {
+ this.operationsCache = operationsCache;
+ }
+
+ public Cache getPermissionsCache()
+ {
+ return permissionsCache;
+ }
+
+ public void setPermissionsCache( Cache permissionsCache )
+ {
+ this.permissionsCache = permissionsCache;
+ }
+
+ public Cache getResourcesCache()
+ {
+ return resourcesCache;
+ }
+
+ public void setResourcesCache( Cache resourcesCache )
+ {
+ this.resourcesCache = resourcesCache;
+ }
+
+ public Cache getRolesCache()
+ {
+ return rolesCache;
+ }
+
+ public void setRolesCache( Cache rolesCache )
+ {
+ this.rolesCache = rolesCache;
+ }
+
+ public Cache getUserAssignmentsCache()
+ {
+ return userAssignmentsCache;
+ }
+
+ public void setUserAssignmentsCache( Cache userAssignmentsCache )
+ {
+ this.userAssignmentsCache = userAssignmentsCache;
+ }
+
+ public Cache getUserPermissionsCache()
+ {
+ return userPermissionsCache;
+ }
+
+ public void setUserPermissionsCache( Cache userPermissionsCache )
+ {
+ this.userPermissionsCache = userPermissionsCache;
+ }
+
+ public Cache getEffectiveRoleSetCache()
+ {
+ return effectiveRoleSetCache;
+ }
+
+ public void setEffectiveRoleSetCache( Cache effectiveRoleSetCache )
+ {
+ this.effectiveRoleSetCache = effectiveRoleSetCache;
+ }
+
+ public RBACManager getRbacImpl()
+ {
+ return rbacImpl;
+ }
+
+ public void setRbacImpl( RBACManager rbacImpl )
+ {
+ this.rbacImpl = rbacImpl;
+ }
+}
Propchange: archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/main/java/org/codehaus/plexus/redback/rbac/cached/CachedRbacManager.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/main/java/org/codehaus/plexus/redback/rbac/cached/CachedRbacManager.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/main/resources/META-INF/spring-context.xml
URL: http://svn.apache.org/viewvc/archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/main/resources/META-INF/spring-context.xml?rev=1310268&view=auto
==============================================================================
--- archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/main/resources/META-INF/spring-context.xml (added)
+++ archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/main/resources/META-INF/spring-context.xml Fri Apr 6 09:58:14 2012
@@ -0,0 +1,115 @@
+<?xml version="1.0"?>
+
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+ http://www.springframework.org/schema/context
+ http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+ default-lazy-init="true">
+
+ <context:annotation-config />
+ <context:component-scan
+ base-package="org.codehaus.plexus.redback.rbac.cached"/>
+
+ <bean name="cache#operations" class="org.codehaus.plexus.cache.ehcache.EhcacheCache"
+ init-method="initialize">
+ <property name="diskPersistent" value="false"/>
+ <property name="eternal" value="false"/>
+ <property name="maxElementsInMemory" value="1000"/>
+ <property name="memoryEvictionPolicy" value="LRU"/>
+ <property name="name" value="operations"/>
+ <property name="timeToIdleSeconds" value="1800"/>
+ <property name="timeToLiveSeconds" value="14400"/>
+ </bean>
+
+ <bean name="cache#permissions" class="org.codehaus.plexus.cache.ehcache.EhcacheCache"
+ init-method="initialize">
+ <property name="diskPersistent" value="false"/>
+ <property name="eternal" value="false"/>
+ <property name="maxElementsInMemory" value="1000"/>
+ <property name="memoryEvictionPolicy" value="LRU"/>
+ <property name="name" value="permissions"/>
+ <property name="timeToIdleSeconds" value="1800"/>
+ <property name="timeToLiveSeconds" value="14400"/>
+ </bean>
+
+ <bean name="cache#resources" class="org.codehaus.plexus.cache.ehcache.EhcacheCache"
+ init-method="initialize">
+ <property name="diskPersistent" value="false"/>
+ <property name="eternal" value="false"/>
+ <property name="maxElementsInMemory" value="1000"/>
+ <property name="memoryEvictionPolicy" value="LRU"/>
+ <property name="name" value="resources"/>
+ <property name="timeToIdleSeconds" value="1800"/>
+ <property name="timeToLiveSeconds" value="14400"/>
+ </bean>
+
+ <bean name="cache#roles" class="org.codehaus.plexus.cache.ehcache.EhcacheCache"
+ init-method="initialize">
+ <property name="diskPersistent" value="false"/>
+ <property name="eternal" value="false"/>
+ <property name="maxElementsInMemory" value="1000"/>
+ <property name="memoryEvictionPolicy" value="LRU"/>
+ <property name="name" value="roles"/>
+ <property name="timeToIdleSeconds" value="1800"/>
+ <property name="timeToLiveSeconds" value="14400"/>
+ </bean>
+
+ <bean name="cache#effectiveRoleSet" class="org.codehaus.plexus.cache.ehcache.EhcacheCache"
+ init-method="initialize">
+ <property name="diskPersistent" value="false"/>
+ <property name="eternal" value="false"/>
+ <property name="maxElementsInMemory" value="1000"/>
+ <property name="memoryEvictionPolicy" value="LRU"/>
+ <property name="name" value="effectiveRoleSet"/>
+ <property name="timeToIdleSeconds" value="1800"/>
+ <property name="timeToLiveSeconds" value="14400"/>
+ </bean>
+
+ <!-- ================================================================
+ Caches with Short Term entries
+ ================================================================ -->
+
+ <bean name="cache#userAssignments" class="org.codehaus.plexus.cache.ehcache.EhcacheCache"
+ init-method="initialize">
+ <property name="diskPersistent" value="false"/>
+ <property name="eternal" value="false"/>
+ <property name="maxElementsInMemory" value="1000"/>
+ <property name="memoryEvictionPolicy" value="LRU"/>
+ <property name="name" value="userAssignments"/>
+ <property name="timeToIdleSeconds" value="300"/>
+ <property name="timeToLiveSeconds" value="600"/>
+ </bean>
+
+ <bean name="cache#userPermissions" class="org.codehaus.plexus.cache.ehcache.EhcacheCache"
+ init-method="initialize">
+ <property name="diskPersistent" value="false"/>
+ <property name="eternal" value="false"/>
+ <property name="maxElementsInMemory" value="1000"/>
+ <property name="memoryEvictionPolicy" value="LRU"/>
+ <property name="name" value="userPermissions"/>
+ <property name="timeToIdleSeconds" value="300"/>
+ <property name="timeToLiveSeconds" value="600"/>
+ </bean>
+
+</beans>
\ No newline at end of file
Propchange: archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/main/resources/META-INF/spring-context.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/main/resources/META-INF/spring-context.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/test/java/org/codehaus/plexus/redback/rbac/cached/CachedRbacManagerPerformanceTest.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/test/java/org/codehaus/plexus/redback/rbac/cached/CachedRbacManagerPerformanceTest.java?rev=1310268&view=auto
==============================================================================
--- archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/test/java/org/codehaus/plexus/redback/rbac/cached/CachedRbacManagerPerformanceTest.java (added)
+++ archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/test/java/org/codehaus/plexus/redback/rbac/cached/CachedRbacManagerPerformanceTest.java Fri Apr 6 09:58:14 2012
@@ -0,0 +1,64 @@
+package org.codehaus.plexus.redback.rbac.cached;
+
+/*
+ * Copyright 2001-2006 The Codehaus.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import net.sf.ehcache.CacheManager;
+
+import org.codehaus.plexus.redback.rbac.RBACManager;
+import org.codehaus.plexus.redback.tests.AbstractRbacManagerPerformanceTestCase;
+import org.junit.After;
+import org.junit.Before;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+
+/**
+ * CachedRbacManagerPerformanceTest
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class CachedRbacManagerPerformanceTest
+ extends AbstractRbacManagerPerformanceTestCase
+{
+
+
+ @Inject
+ @Named( value = "rBACManager#cached" )
+ RBACManager rbacManager;
+
+ /**
+ * Creates a new RbacStore which contains no data.
+ */
+ @Before
+ public void setUp()
+ throws Exception
+ {
+ super.setUp();
+
+ RBACManager store = rbacManager;
+ assertTrue( store instanceof CachedRbacManager );
+ setRbacManager( store );
+ }
+
+ @After
+ public void tearDown()
+ throws Exception
+ {
+ super.tearDown();
+ }
+}
Propchange: archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/test/java/org/codehaus/plexus/redback/rbac/cached/CachedRbacManagerPerformanceTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/test/java/org/codehaus/plexus/redback/rbac/cached/CachedRbacManagerPerformanceTest.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/test/java/org/codehaus/plexus/redback/rbac/cached/CachedRbacManagerTest.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/test/java/org/codehaus/plexus/redback/rbac/cached/CachedRbacManagerTest.java?rev=1310268&view=auto
==============================================================================
--- archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/test/java/org/codehaus/plexus/redback/rbac/cached/CachedRbacManagerTest.java (added)
+++ archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/test/java/org/codehaus/plexus/redback/rbac/cached/CachedRbacManagerTest.java Fri Apr 6 09:58:14 2012
@@ -0,0 +1,69 @@
+package org.codehaus.plexus.redback.rbac.cached;
+
+/*
+ * Copyright 2001-2006 The Codehaus.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import net.sf.ehcache.CacheManager;
+import org.codehaus.plexus.redback.rbac.RBACManager;
+import org.codehaus.plexus.redback.tests.AbstractRbacManagerTestCase;
+import org.junit.Before;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+
+public class CachedRbacManagerTest
+ extends AbstractRbacManagerTestCase
+{
+
+ @Inject
+ @Named( value = "rBACManager#cached" )
+ RBACManager rbacManager;
+
+ /**
+ * Creates a new RbacStore which contains no data.
+ */
+ @Before
+ public void setUp()
+ throws Exception
+ {
+ /*
+ CacheManager.getInstance().removeCache( "usersCache" );
+ CacheManager.getInstance().removalAll();
+ CacheManager.getInstance().shutdown();
+ */
+ super.setUp();
+ CacheManager.getInstance().clearAll();
+ setRbacManager( rbacManager );
+
+ assertTrue( getRbacManager() instanceof CachedRbacManager );
+ }
+
+ public void tearDown()
+ throws Exception
+ {
+ super.tearDown();
+ }
+
+ @Override
+ public void testStoreInitialization()
+ throws Exception
+ {
+ CacheManager.getInstance().clearAll();
+ rbacManager.eraseDatabase();
+ //eventTracker.rbacInit( true );
+ super.testStoreInitialization();
+ }
+}
Propchange: archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/test/java/org/codehaus/plexus/redback/rbac/cached/CachedRbacManagerTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/test/java/org/codehaus/plexus/redback/rbac/cached/CachedRbacManagerTest.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/test/resources/spring-context.xml
URL: http://svn.apache.org/viewvc/archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/test/resources/spring-context.xml?rev=1310268&view=auto
==============================================================================
--- archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/test/resources/spring-context.xml (added)
+++ archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/test/resources/spring-context.xml Fri Apr 6 09:58:14 2012
@@ -0,0 +1,87 @@
+<?xml version="1.0"?>
+
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+ http://www.springframework.org/schema/context
+ http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+ default-lazy-init="false">
+
+ <bean name="jdoFactory#users" class="org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory">
+ <property name="driverName" value="org.hsqldb.jdbcDriver"/>
+ <property name="url" value="jdbc:hsqldb:mem:redback-users-tests" />
+ <property name="userName" value="sa"/>
+ <property name="password" value=""/>
+ <property name="persistenceManagerFactoryClass" value="org.jpox.PersistenceManagerFactoryImpl"/>
+ <property name="otherProperties">
+ <props>
+ <prop key="org.jpox.rdbms.dateTimezone">JDK_DEFAULT_TIMEZONE</prop>
+ <prop key="org.jpox.autoCreateTables">true</prop>
+ </props>
+ </property>
+ </bean>
+
+ <bean name="userConfiguration" class="org.codehaus.plexus.redback.configuration.UserConfiguration">
+ <property name="registry" ref="test-conf"/>
+ </bean>
+
+ <bean name="commons-configuration" class="org.codehaus.redback.components.registry.commons.CommonsConfigurationRegistry">
+ </bean>
+
+ <alias name="commons-configuration" alias="test-conf"/>
+
+ <bean name= "rBACManager#cached" class="org.codehaus.plexus.redback.rbac.cached.CachedRbacManager">
+ <property name="rbacImpl" ref="rBACManager#memory"/>
+ <property name="effectiveRoleSetCache" ref="cache#effectiveRoleSet"/>
+ <property name="operationsCache" ref="cache#operations"/>
+ <property name="permissionsCache" ref="cache#permissions"/>
+ <property name="resourcesCache" ref="cache#resources"/>
+ <property name="rolesCache" ref="cache#roles"/>
+ <property name="userAssignmentsCache" ref="cache#userAssignments"/>
+ <property name="userPermissionsCache" ref="cache#userPermissions"/>
+ </bean>
+
+ <bean name="cache#userAssignments" class="org.codehaus.plexus.cache.ehcache.EhcacheCache"
+ init-method="initialize">
+ <property name="diskPersistent" value="false"/>
+ <property name="eternal" value="false"/>
+ <property name="maxElementsInMemory" value="1000"/>
+ <property name="memoryEvictionPolicy" value="LRU"/>
+ <property name="name" value="userAssignments"/>
+ <property name="timeToIdleSeconds" value="300"/>
+ <property name="timeToLiveSeconds" value="600"/>
+ </bean>
+
+ <bean name="cache#userPermissions" class="org.codehaus.plexus.cache.ehcache.EhcacheCache"
+ init-method="initialize">
+ <property name="diskPersistent" value="false"/>
+ <property name="eternal" value="false"/>
+ <property name="maxElementsInMemory" value="1000"/>
+ <property name="memoryEvictionPolicy" value="LRU"/>
+ <property name="name" value="userPermissions"/>
+ <property name="timeToIdleSeconds" value="300"/>
+ <property name="timeToLiveSeconds" value="600"/>
+ </bean>
+
+
+</beans>
\ No newline at end of file
Propchange: archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/test/resources/spring-context.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/test/resources/spring-context.xml
------------------------------------------------------------------------------
svn:executable =
Propchange: archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-cached/src/test/resources/spring-context.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-jdo/pom.xml
URL: http://svn.apache.org/viewvc/archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-jdo/pom.xml?rev=1310268&view=auto
==============================================================================
--- archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-jdo/pom.xml (added)
+++ archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-jdo/pom.xml Fri Apr 6 09:58:14 2012
@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright 2006 The Codehaus.
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.codehaus.redback</groupId>
+ <artifactId>redback-rbac-providers</artifactId>
+ <version>1.5-SNAPSHOT</version>
+ </parent>
+ <artifactId>redback-rbac-jdo</artifactId>
+ <name>Redback :: RBAC Provider :: JDO</name>
+ <packaging>jar</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>org.codehaus.redback</groupId>
+ <artifactId>redback-rbac-model</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context-support</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>jsr250-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.redback</groupId>
+ <artifactId>redback-rbac-tests</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-utils</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.redback</groupId>
+ <artifactId>redback-common-jdo</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>net.java.dev.stax-utils</groupId>
+ <artifactId>stax-utils</artifactId>
+ <version>20060502</version>
+ <exclusions>
+ <exclusion>
+ <groupId>com.bea.xml</groupId>
+ <artifactId>jsr173-ri</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>javax.xml.stream</groupId>
+ <artifactId>stax-api</artifactId>
+ <version>1.0-2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.woodstox</groupId>
+ <artifactId>wstx-asl</artifactId>
+ <version>3.2.0</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>stax</groupId>
+ <artifactId>stax-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>jpox</groupId>
+ <artifactId>jpox-ehcache</artifactId>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>ehcache</groupId>
+ <artifactId>ehcache</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.modello</groupId>
+ <artifactId>modello-maven-plugin</artifactId>
+ <version>1.0-alpha-15</version>
+ <configuration>
+ <version>1.0.1</version>
+ <packageWithVersion>false</packageWithVersion>
+ <model>src/main/mdo/rbac-jdo.mdo</model>
+ </configuration>
+ <executions>
+ <execution>
+ <id>modello-java</id>
+ <goals>
+ <goal>java</goal>
+ <goal>jpox-metadata-class</goal>
+ <goal>jpox-jdo-mapping</goal>
+ <!-- TODO: Move these to plexus-security-authorization-rbac-model -->
+ <goal>stax-reader</goal>
+ <goal>stax-writer</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>jpox-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>enhance</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange: archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-jdo/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: archiva/redback/redback-core/trunk/redback-rbac/redback-rbac-providers/redback-rbac-jdo/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision