[portal-commits] JBoss Portal SVN: r5831 - trunk/identity/src/main/org/jboss/portal/identity2

portal-commits at lists.jboss.org portal-commits at lists.jboss.org
Wed Dec 13 10:16:54 EST 2006


Author: bdaw
Date: 2006-12-13 10:16:44 -0500 (Wed, 13 Dec 2006)
New Revision: 5831

Modified:
   trunk/identity/src/main/org/jboss/portal/identity2/IdentityContextImpl.java
   trunk/identity/src/main/org/jboss/portal/identity2/IdentityServiceControllerImpl.java
   trunk/identity/src/main/org/jboss/portal/identity2/MembershipModule.java
   trunk/identity/src/main/org/jboss/portal/identity2/Role.java
   trunk/identity/src/main/org/jboss/portal/identity2/User.java
   trunk/identity/src/main/org/jboss/portal/identity2/UserModule.java
   trunk/identity/src/main/org/jboss/portal/identity2/UserProfileModule.java
Log:
identity interfaces updates

Modified: trunk/identity/src/main/org/jboss/portal/identity2/IdentityContextImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity2/IdentityContextImpl.java	2006-12-13 15:14:50 UTC (rev 5830)
+++ trunk/identity/src/main/org/jboss/portal/identity2/IdentityContextImpl.java	2006-12-13 15:16:44 UTC (rev 5831)
@@ -35,6 +35,8 @@
  */
 public class IdentityContextImpl extends AbstractJBossService implements IdentityContext
 {
+   //private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(IdentityContextImpl.class);
+
    private Map registry;
 
    public IdentityContextImpl()
@@ -59,6 +61,7 @@
          {
             throw new IdentityException("Name: " + name + " already registered.");
          }
+         if (log.isDebugEnabled()) log.debug("registering object: " + name + " ; " + object.getClass());
          registry.put(name, object);
       }
    }
@@ -73,6 +76,8 @@
       {
          if(registry.containsKey(name))
          {
+            if (log.isDebugEnabled()) log.debug("unregistering object: " + name);
+
             registry.remove(name);
          }
       }

Modified: trunk/identity/src/main/org/jboss/portal/identity2/IdentityServiceControllerImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity2/IdentityServiceControllerImpl.java	2006-12-13 15:14:50 UTC (rev 5830)
+++ trunk/identity/src/main/org/jboss/portal/identity2/IdentityServiceControllerImpl.java	2006-12-13 15:16:44 UTC (rev 5831)
@@ -24,7 +24,7 @@
 import org.jboss.portal.jems.as.system.AbstractJBossService;
 import org.jboss.portal.common.util.JNDI;
 import org.jboss.portal.identity.IdentityException;
-import org.jboss.portal.identity2.config.IdentityConfigurationMetaDataFactory;
+import org.jboss.portal.identity2.config.metadata.IdentityConfigurationMetaDataFactory;
 import org.jboss.portal.identity2.config.metadata.IdentityConfigurationMetaData;
 import org.jboss.portal.identity2.config.metadata.ModuleMetaData;
 import org.jboss.portal.identity2.config.metadata.ConfigOptionMetaData;
@@ -32,6 +32,7 @@
 import org.jboss.portal.identity2.config.metadata.OptionsGroupMetaData;
 import org.jboss.portal.identity2.config.metadata.OptionsGroupOptionMetaData;
 import org.jboss.portal.identity2.config.metadata.DatasourceMetaData;
+import org.jboss.portal.identity2.config.metadata.ConfigurationParser;
 import org.jboss.portal.identity2.service.IdentityModuleService;
 import org.jboss.portal.identity2.service.IdentityConfigurationService;
 import org.jboss.xb.binding.Unmarshaller;
@@ -41,7 +42,6 @@
 import org.jboss.kernel.spi.dependency.KernelControllerContext;
 import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
 import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
-import org.jboss.beans.metadata.plugins.AbstractParameterMetaData;
 import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData;
 
 import javax.management.ObjectName;
@@ -109,8 +109,8 @@
       //TODO: make a dtd for config files.
 
       //parse config files
-      IdentityConfigurationMetaData meta = parseConfiguration(configFile);
-      IdentityConfigurationMetaData defaultMeta = parseConfiguration(defaultConfigFile);
+      IdentityConfigurationMetaData meta = ConfigurationParser.parseIdentityConfiguration(configFile);
+      IdentityConfigurationMetaData defaultMeta = ConfigurationParser.parseIdentityConfiguration(defaultConfigFile);
 
       KernelControllerContext identityKernelContext;
       try
@@ -248,6 +248,7 @@
             {
                String propertyKey = (String)iterator1.next();
                String propertyValue = (String)optionMap.get(propertyKey);
+               if (log.isDebugEnabled()) log.debug("adding parameter: " + propertyKey + " ; " + propertyValue);
                AbstractPropertyMetaData propertyBMD = new AbstractPropertyMetaData(propertyKey, propertyValue);
                dsBMD.addProperty(propertyBMD);
             }
@@ -322,6 +323,7 @@
             {
                String propertyKey = (String)iterator1.next();
                String propertyValue = (String)optionMap.get(propertyKey);
+               if (log.isDebugEnabled()) log.debug("adding parameter: " + propertyKey + " ; " + propertyValue);
                propertyBMD = new AbstractPropertyMetaData(propertyKey, propertyValue);
                moduleBMD.addProperty(propertyBMD);
             }
@@ -361,35 +363,8 @@
    }
 
 
-   private IdentityConfigurationMetaData parseConfiguration(String configFile) throws IdentityException
-   {
-      ClassLoader tcl = Thread.currentThread().getContextClassLoader();
-      IdentityConfigurationMetaData meta;
-      try
-      {
-         log.info("Processing portal identity configuration");
-         log.debug("config file: " + configFile);
-         URL config = tcl.getResource(configFile);
-         InputStream in = config.openStream();
-         // create unmarshaller
-         Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+   
 
-         // create an instance of ObjectModelFactory
-         ObjectModelFactory factory = new IdentityConfigurationMetaDataFactory();
-
-         // let the object model factory to create an instance of Map and populate it with data from XML
-         meta = (IdentityConfigurationMetaData)unmarshaller.unmarshal(in, factory, null);
-
-         // close the XML stream
-         in.close();
-      }
-      catch (Exception e)
-      {
-         throw new IdentityException("Cannot parse configuration file", e);
-      }
-      return meta;
-   }
-
    /**
     * updates module with proper defaults
     *

Modified: trunk/identity/src/main/org/jboss/portal/identity2/MembershipModule.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity2/MembershipModule.java	2006-12-13 15:14:50 UTC (rev 5830)
+++ trunk/identity/src/main/org/jboss/portal/identity2/MembershipModule.java	2006-12-13 15:16:44 UTC (rev 5831)
@@ -36,6 +36,8 @@
 public interface MembershipModule
 {
 
+   //TODO: add isUserInRole method - it could gain better performance
+
    /**
     * Return the set of role objects that a given user has.
     *

Modified: trunk/identity/src/main/org/jboss/portal/identity2/Role.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity2/Role.java	2006-12-13 15:14:50 UTC (rev 5830)
+++ trunk/identity/src/main/org/jboss/portal/identity2/Role.java	2006-12-13 15:16:44 UTC (rev 5831)
@@ -32,14 +32,14 @@
 public interface Role
 {
    /** The role identifier. */
-   Object getId();
+   public Object getId();
 
    /** The role name used in security rules. This name can not be modified */
-   String getName();
+   public String getName();
 
    /** The role display name used on screens. This name can be modified */
-   String getDisplayName();
+   public String getDisplayName();
 
    /** */
-   void setDisplayName(String name);
+   public void setDisplayName(String name);
 }

Modified: trunk/identity/src/main/org/jboss/portal/identity2/User.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity2/User.java	2006-12-13 15:14:50 UTC (rev 5830)
+++ trunk/identity/src/main/org/jboss/portal/identity2/User.java	2006-12-13 15:16:44 UTC (rev 5831)
@@ -61,20 +61,26 @@
    String INFO_USER_REGISTRATION_DATE = "portal.user.registration-date";
 
    String INFO_USER_ENABLED = "portal.user.enabled";
-   String INFO_USER_EMAIL_REAL = "portal.user.realEmail";
+   String INFO_USER_EMAIL_REAL = "portal.user.email.real";
 
 
 
 
    /** The user identifier. */
-   Object getId();
+   public Object getId();
 
    /** The user name. */
-   String getUserName();
+   public String getUserName();
 
-   /** Set the password. */
-   void updatePassword(String password);
+   /** Set the password using proper encoding. */
+   public void updatePassword(String password);
 
+   /** Set the password value directly */
+   public void setPassword(String password);
+
+   /** Returns password value */
+   public String getPassword();
+
    /** Return true if the password is valid. */
-   boolean validatePassword(String password);
+   public boolean validatePassword(String password);
 }

Modified: trunk/identity/src/main/org/jboss/portal/identity2/UserModule.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity2/UserModule.java	2006-12-13 15:14:50 UTC (rev 5830)
+++ trunk/identity/src/main/org/jboss/portal/identity2/UserModule.java	2006-12-13 15:16:44 UTC (rev 5831)
@@ -66,8 +66,7 @@
     * @param userName
     * @return the user
     */
-   //TODO: remove realEmail from the signature
-   User createUser(String userName, String password, String realEmail) throws IdentityException, IllegalArgumentException;
+   User createUser(String userName, String password) throws IdentityException, IllegalArgumentException;
 
    /**
     * Remove a user.

Modified: trunk/identity/src/main/org/jboss/portal/identity2/UserProfileModule.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity2/UserProfileModule.java	2006-12-13 15:14:50 UTC (rev 5830)
+++ trunk/identity/src/main/org/jboss/portal/identity2/UserProfileModule.java	2006-12-13 15:16:44 UTC (rev 5831)
@@ -23,6 +23,7 @@
 package org.jboss.portal.identity2;
 
 import org.jboss.portal.identity.IdentityException;
+import org.jboss.portal.identity2.info.ProfileInfo;
 
 import java.util.Map;
 
@@ -39,4 +40,6 @@
 
    public Map getProperties(User user) throws IdentityException, IllegalArgumentException;
 
+   public ProfileInfo getProfileInfo() throws IdentityException;
+
 }




More information about the portal-commits mailing list