portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wea...@apache.org
Subject cvs commit: jakarta-jetspeed-2/components/security/src/java/org/apache/jetspeed/security/impl GroupManagerImpl.java BaseSecurityImpl.java UserManagerImpl.java PermissionManagerImpl.java RoleManagerImpl.java
Date Thu, 27 May 2004 19:44:50 GMT
weaver      2004/05/27 12:44:50

  Modified:    components/security/src/java/org/apache/jetspeed/security/impl
                        GroupManagerImpl.java BaseSecurityImpl.java
                        UserManagerImpl.java PermissionManagerImpl.java
                        RoleManagerImpl.java
  Log:
  see JS2-40: <http://nagoya.apache.org/jira/browse/JS2-40>
  
  Revision  Changes    Path
  1.5       +7 -9      jakarta-jetspeed-2/components/security/src/java/org/apache/jetspeed/security/impl/GroupManagerImpl.java
  
  Index: GroupManagerImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/security/src/java/org/apache/jetspeed/security/impl/GroupManagerImpl.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- GroupManagerImpl.java	8 May 2004 16:17:13 -0000	1.4
  +++ GroupManagerImpl.java	27 May 2004 19:44:50 -0000	1.5
  @@ -23,17 +23,15 @@
   
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  -
  -import org.apache.jetspeed.components.persistence.store.PersistenceStore;
  -import org.apache.jetspeed.components.persistence.store.PersistenceStoreContainer;
   import org.apache.jetspeed.components.persistence.store.Filter;
  +import org.apache.jetspeed.components.persistence.store.PersistenceStore;
   import org.apache.jetspeed.security.Group;
   import org.apache.jetspeed.security.GroupManager;
   import org.apache.jetspeed.security.GroupPrincipal;
   import org.apache.jetspeed.security.SecurityException;
   import org.apache.jetspeed.security.om.JetspeedGroupPrincipal;
  -import org.apache.jetspeed.security.om.impl.JetspeedGroupPrincipalImpl;
   import org.apache.jetspeed.security.om.JetspeedUserPrincipal;
  +import org.apache.jetspeed.security.om.impl.JetspeedGroupPrincipalImpl;
   import org.apache.jetspeed.util.ArgUtil;
   
   /**
  @@ -50,14 +48,14 @@
   {
       private static final Log log = LogFactory.getLog(GroupManagerImpl.class);
   
  +    
       /**
  -     * <p>Constructor providing access to the persistence component.</p>
  +     * @param persistenceStore
        */
  -    public GroupManagerImpl(PersistenceStoreContainer storeContainer, String keyStoreName)
  +    public GroupManagerImpl( PersistenceStore persistenceStore )
       {
  -        super(storeContainer, keyStoreName);
  -    }
  -
  +        super(persistenceStore);
  +   }
       /**
        * @see org.apache.jetspeed.security.GroupManager#addGroup(java.lang.String)
        */
  
  
  
  1.2       +13 -22    jakarta-jetspeed-2/components/security/src/java/org/apache/jetspeed/security/impl/BaseSecurityImpl.java
  
  Index: BaseSecurityImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/security/src/java/org/apache/jetspeed/security/impl/BaseSecurityImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BaseSecurityImpl.java	10 Mar 2004 06:07:47 -0000	1.1
  +++ BaseSecurityImpl.java	27 May 2004 19:44:50 -0000	1.2
  @@ -23,20 +23,19 @@
   
   import javax.security.auth.Subject;
   
  -import org.apache.jetspeed.components.persistence.store.PersistenceStore;
  -import org.apache.jetspeed.components.persistence.store.PersistenceStoreContainer;
   import org.apache.jetspeed.components.persistence.store.Filter;
  +import org.apache.jetspeed.components.persistence.store.PersistenceStore;
   import org.apache.jetspeed.security.Group;
  +import org.apache.jetspeed.security.GroupPrincipal;
   import org.apache.jetspeed.security.Role;
  +import org.apache.jetspeed.security.RolePrincipal;
   import org.apache.jetspeed.security.User;
  -import org.apache.jetspeed.security.GroupPrincipal;
   import org.apache.jetspeed.security.UserPrincipal;
  -import org.apache.jetspeed.security.RolePrincipal;
   import org.apache.jetspeed.security.om.JetspeedGroupPrincipal;
  -import org.apache.jetspeed.security.om.impl.JetspeedGroupPrincipalImpl;
   import org.apache.jetspeed.security.om.JetspeedRolePrincipal;
  -import org.apache.jetspeed.security.om.impl.JetspeedRolePrincipalImpl;
   import org.apache.jetspeed.security.om.JetspeedUserPrincipal;
  +import org.apache.jetspeed.security.om.impl.JetspeedGroupPrincipalImpl;
  +import org.apache.jetspeed.security.om.impl.JetspeedRolePrincipalImpl;
   import org.apache.jetspeed.security.om.impl.JetspeedUserPrincipalImpl;
   
   /**
  @@ -46,23 +45,19 @@
   public class BaseSecurityImpl
   {
   
  -    /** The persistence store container. */
  -    PersistenceStoreContainer storeContainer;
  -
  -    /** The store name. */
  -    String jetspeedStoreName;
  +    PersistenceStore persistenceStore;
   
       /**
        * <p>Constructor providing access to the persistence component.</p>
        */
  -    public BaseSecurityImpl(PersistenceStoreContainer storeContainer, String keyStoreName)
  +    public BaseSecurityImpl(PersistenceStore persistenceStore)
       {
  -        if (storeContainer == null)
  +        if (persistenceStore == null)
           {
  -            throw new IllegalArgumentException("storeContainer cannot be null for BaseSecurityImpl");
  +            throw new IllegalArgumentException("persistenceStore cannot be null for BaseSecurityImpl");
           }
  -        this.storeContainer = storeContainer;
  -        this.jetspeedStoreName = keyStoreName;
  +        
  +       this.persistenceStore = persistenceStore;
       }
   
       /**
  @@ -334,11 +329,7 @@
        */
       PersistenceStore getPersistenceStore()
       {
  -        PersistenceStore store = storeContainer.getStoreForThread(jetspeedStoreName);
  -        if (!store.getTransaction().isOpen())
  -        {
  -            store.getTransaction().begin();
  -        }
  -        return store;
  +     
  +        return persistenceStore;
       }
   }
  
  
  
  1.5       +6 -8      jakarta-jetspeed-2/components/security/src/java/org/apache/jetspeed/security/impl/UserManagerImpl.java
  
  Index: UserManagerImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/security/src/java/org/apache/jetspeed/security/impl/UserManagerImpl.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- UserManagerImpl.java	5 May 2004 18:31:49 -0000	1.4
  +++ UserManagerImpl.java	27 May 2004 19:44:50 -0000	1.5
  @@ -21,20 +21,17 @@
   import java.util.prefs.BackingStoreException;
   import java.util.prefs.Preferences;
   
  -
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  -
   import org.apache.jetspeed.components.persistence.store.PersistenceStore;
  -import org.apache.jetspeed.components.persistence.store.PersistenceStoreContainer;
   import org.apache.jetspeed.security.SecurityException;
   import org.apache.jetspeed.security.User;
   import org.apache.jetspeed.security.UserManager;
   import org.apache.jetspeed.security.UserPrincipal;
   import org.apache.jetspeed.security.om.JetspeedCredential;
   import org.apache.jetspeed.security.om.JetspeedUserPrincipal;
  -import org.apache.jetspeed.security.om.impl.JetspeedUserPrincipalImpl;
   import org.apache.jetspeed.security.om.impl.JetspeedCredentialImpl;
  +import org.apache.jetspeed.security.om.impl.JetspeedUserPrincipalImpl;
   import org.apache.jetspeed.util.ArgUtil;
   
   /**
  @@ -46,14 +43,15 @@
   {
       private static final Log log = LogFactory.getLog(UserManagerImpl.class);
   
  +  
       /**
  -     * <p>Constructor providing access to the persistence component.</p>
  +     * @param persistenceStore
        */
  -    public UserManagerImpl(PersistenceStoreContainer storeContainer, String keyStoreName)
  +    public UserManagerImpl( PersistenceStore persistenceStore )
       {
  -        super(storeContainer, keyStoreName);
  -    }
  +        super(persistenceStore);
   
  +    }
       /**
        * @see org.apache.jetspeed.security.UserManager#authenticate(java.lang.String, java.lang.String)
        */
  
  
  
  1.3       +10 -20    jakarta-jetspeed-2/components/security/src/java/org/apache/jetspeed/security/impl/PermissionManagerImpl.java
  
  Index: PermissionManagerImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/security/src/java/org/apache/jetspeed/security/impl/PermissionManagerImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PermissionManagerImpl.java	8 May 2004 16:17:13 -0000	1.2
  +++ PermissionManagerImpl.java	27 May 2004 19:44:50 -0000	1.3
  @@ -15,20 +15,18 @@
   package org.apache.jetspeed.security.impl;
   
   import java.lang.reflect.Constructor;
  -import java.sql.Timestamp;
   import java.security.Permission;
   import java.security.Permissions;
   import java.security.Principal;
  +import java.sql.Timestamp;
   import java.util.ArrayList;
   import java.util.Collection;
   import java.util.Iterator;
   
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  -
  -import org.apache.jetspeed.components.persistence.store.PersistenceStore;
  -import org.apache.jetspeed.components.persistence.store.PersistenceStoreContainer;
   import org.apache.jetspeed.components.persistence.store.Filter;
  +import org.apache.jetspeed.components.persistence.store.PersistenceStore;
   import org.apache.jetspeed.security.PermissionManager;
   import org.apache.jetspeed.security.SecurityException;
   import org.apache.jetspeed.security.SecurityHelper;
  @@ -55,23 +53,19 @@
   {
       private static final Log log = LogFactory.getLog(PermissionManagerImpl.class);
   
  -    /** The persistence store container. */
  -    PersistenceStoreContainer storeContainer;
  -
  -    /** The store name. */
  -    String jetspeedStoreName;
  +    PersistenceStore persistenceStore;
   
       /**
        * <p>Constructor providing access to the persistence component.</p>
        */
  -    public PermissionManagerImpl(PersistenceStoreContainer storeContainer, String keyStoreName)
  +    public PermissionManagerImpl(PersistenceStore persistenceStore)
       {
  -        if (storeContainer == null)
  +        if (persistenceStore == null)
           {
  -            throw new IllegalArgumentException("storeContainer cannot be null for BaseSecurityImpl");
  +            throw new IllegalArgumentException("persistenceStore cannot be null for BaseSecurityImpl");
           }
  -        this.storeContainer = storeContainer;
  -        this.jetspeedStoreName = keyStoreName;
  +        
  +        this.persistenceStore = persistenceStore;
       }
   
       /**
  @@ -399,12 +393,8 @@
        */
       PersistenceStore getPersistenceStore()
       {
  -        PersistenceStore store = storeContainer.getStoreForThread(jetspeedStoreName);
  -        if (!store.getTransaction().isOpen())
  -        {
  -            store.getTransaction().begin();
  -        }
  -        return store;
  +    
  +        return persistenceStore;
       }
   
   }
  
  
  
  1.4       +8 -8      jakarta-jetspeed-2/components/security/src/java/org/apache/jetspeed/security/impl/RoleManagerImpl.java
  
  Index: RoleManagerImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/security/src/java/org/apache/jetspeed/security/impl/RoleManagerImpl.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RoleManagerImpl.java	8 May 2004 16:17:13 -0000	1.3
  +++ RoleManagerImpl.java	27 May 2004 19:44:50 -0000	1.4
  @@ -23,18 +23,16 @@
   
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  -
  -import org.apache.jetspeed.components.persistence.store.PersistenceStore;
  -import org.apache.jetspeed.components.persistence.store.PersistenceStoreContainer;
   import org.apache.jetspeed.components.persistence.store.Filter;
  +import org.apache.jetspeed.components.persistence.store.PersistenceStore;
   import org.apache.jetspeed.security.Role;
   import org.apache.jetspeed.security.RoleManager;
   import org.apache.jetspeed.security.RolePrincipal;
   import org.apache.jetspeed.security.SecurityException;
   import org.apache.jetspeed.security.om.JetspeedGroupPrincipal;
   import org.apache.jetspeed.security.om.JetspeedRolePrincipal;
  -import org.apache.jetspeed.security.om.impl.JetspeedRolePrincipalImpl;
   import org.apache.jetspeed.security.om.JetspeedUserPrincipal;
  +import org.apache.jetspeed.security.om.impl.JetspeedRolePrincipalImpl;
   import org.apache.jetspeed.util.ArgUtil;
   
   /**
  @@ -51,14 +49,16 @@
   {
       private static final Log log = LogFactory.getLog(RoleManagerImpl.class);
   
  +  
  +
       /**
  -     * <p>Constructor providing access to the persistence component.</p>
  +     * @param persistenceStore
        */
  -    public RoleManagerImpl(PersistenceStoreContainer storeContainer, String keyStoreName)
  +    public RoleManagerImpl( PersistenceStore persistenceStore )
       {
  -        super(storeContainer, keyStoreName);
  +        super(persistenceStore);
       }
  -
  +    
       /**
        * @see org.apache.jetspeed.security.RoleManager#addRole(java.lang.String)
        */
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message