JBoss Portal SVN: r6183 - in trunk: core/src/main/org/jboss/portal/core/identity and 6 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-02-07 10:25:12 -0500 (Wed, 07 Feb 2007)
New Revision: 6183
Added:
trunk/core/src/main/org/jboss/portal/core/identity/
trunk/core/src/main/org/jboss/portal/core/identity/DashboardBridge.java
trunk/core/src/main/org/jboss/portal/core/identity/SecurityBridge.java
trunk/identity/src/main/org/jboss/portal/identity/service/IdentityEventManagerService.java
Removed:
trunk/identity/src/main/org/jboss/portal/identity/service/IdentityEventService.java
Modified:
trunk/core/src/main/org/jboss/portal/core/impl/model/CustomizationManagerService.java
trunk/core/src/main/org/jboss/portal/core/model/CustomizationManager.java
trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
trunk/identity/src/main/org/jboss/portal/identity/IdentityServiceControllerImpl.java
trunk/identity/src/main/org/jboss/portal/identity/auth/UserPrincipal.java
Log:
JBPORTAL-1237 : delete user does not delete dashboard settings for the user
Added: trunk/core/src/main/org/jboss/portal/core/identity/DashboardBridge.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/identity/DashboardBridge.java (rev 0)
+++ trunk/core/src/main/org/jboss/portal/core/identity/DashboardBridge.java 2007-02-07 15:25:12 UTC (rev 6183)
@@ -0,0 +1,91 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.core.identity;
+
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+import org.jboss.portal.identity.event.IdentityEventListener;
+import org.jboss.portal.identity.event.IdentityEvent;
+import org.jboss.portal.identity.event.IdentityEventEmitter;
+import org.jboss.portal.identity.event.UserDestroyedEvent;
+import org.jboss.portal.core.model.CustomizationManager;
+
+/**
+ * Use identity destroy events to destroy corresponding dashboards.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class DashboardBridge extends AbstractJBossService implements IdentityEventListener
+{
+
+ /** . */
+ private IdentityEventEmitter identityEventEmitter;
+
+ /** . */
+ private CustomizationManager customizationManager;
+
+ public IdentityEventEmitter getIdentityEventEmitter()
+ {
+ return identityEventEmitter;
+ }
+
+ public void setIdentityEventEmitter(IdentityEventEmitter identityEventEmitter)
+ {
+ this.identityEventEmitter = identityEventEmitter;
+ }
+
+ public CustomizationManager getCustomizationManager()
+ {
+ return customizationManager;
+ }
+
+ public void setCustomizationManager(CustomizationManager customizationManager)
+ {
+ this.customizationManager = customizationManager;
+ }
+
+ protected void startService() throws Exception
+ {
+ identityEventEmitter.addListener(this);
+ }
+
+ protected void stopService() throws Exception
+ {
+ identityEventEmitter.removeListener(this);
+ }
+
+ public void onEvent(IdentityEvent event)
+ {
+ if (event instanceof UserDestroyedEvent)
+ {
+ UserDestroyedEvent destroyedEvent = (UserDestroyedEvent)event;
+
+ //
+ log.debug("User (userName=" + destroyedEvent.getUserName() + ",id=" + destroyedEvent.getUserId() +
+ " ) is destroyed, will destroy its dashboard");
+
+ //
+ customizationManager.destroyDashboard(destroyedEvent.getUserName());
+ }
+ }
+}
Added: trunk/core/src/main/org/jboss/portal/core/identity/SecurityBridge.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/identity/SecurityBridge.java (rev 0)
+++ trunk/core/src/main/org/jboss/portal/core/identity/SecurityBridge.java 2007-02-07 15:25:12 UTC (rev 6183)
@@ -0,0 +1,98 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.core.identity;
+
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+import org.jboss.portal.identity.event.IdentityEventListener;
+import org.jboss.portal.identity.event.IdentityEventEmitter;
+import org.jboss.portal.identity.event.IdentityEvent;
+import org.jboss.portal.identity.event.UserDestroyedEvent;
+import org.jboss.security.auth.login.DynamicLoginConfigMBean;
+
+/**
+ * Use identity destroy events to destroy corresponding dashboards.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class SecurityBridge extends AbstractJBossService implements IdentityEventListener
+{
+
+ /** . */
+ private IdentityEventEmitter identityEventEmitter;
+
+ /** . */
+ private DynamicLoginConfigMBean dynamicLoginConfig;
+
+ public IdentityEventEmitter getIdentityEventEmitter()
+ {
+ return identityEventEmitter;
+ }
+
+ public void setIdentityEventEmitter(IdentityEventEmitter identityEventEmitter)
+ {
+ this.identityEventEmitter = identityEventEmitter;
+ }
+
+ public DynamicLoginConfigMBean getDynamicLoginConfig()
+ {
+ return dynamicLoginConfig;
+ }
+
+ public void setDynamicLoginConfig(DynamicLoginConfigMBean dynamicLoginConfig)
+ {
+ this.dynamicLoginConfig = dynamicLoginConfig;
+ }
+
+ protected void startService() throws Exception
+ {
+ identityEventEmitter.addListener(this);
+ }
+
+ protected void stopService() throws Exception
+ {
+ identityEventEmitter.removeListener(this);
+ }
+
+ public void onEvent(IdentityEvent event)
+ {
+ if (event instanceof UserDestroyedEvent)
+ {
+ final UserDestroyedEvent destroyedEvent = (UserDestroyedEvent)event;
+
+ //
+ log.debug("User (userName=" + destroyedEvent.getUserName() + ",id=" + destroyedEvent.getUserId() +
+ " ) is destroyed, will invalidate security manager cache instead ");
+
+ //
+ try
+ {
+ dynamicLoginConfig.flushAuthenticationCaches();
+ }
+ catch (Exception e)
+ {
+ log.warn("Error while flushing authentication cache", e);
+ }
+ }
+ }
+}
Modified: trunk/core/src/main/org/jboss/portal/core/impl/model/CustomizationManagerService.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/model/CustomizationManagerService.java 2007-02-07 13:46:53 UTC (rev 6182)
+++ trunk/core/src/main/org/jboss/portal/core/impl/model/CustomizationManagerService.java 2007-02-07 15:25:12 UTC (rev 6183)
@@ -34,6 +34,7 @@
import org.jboss.portal.core.model.portal.DuplicatePortalObjectException;
import org.jboss.portal.core.model.portal.PortalContainer;
import org.jboss.portal.core.model.portal.PortalObjectContainer;
+import org.jboss.portal.core.model.portal.NoSuchPortalObjectException;
import org.jboss.portal.core.impl.model.content.portlet.PortletContent;
import org.jboss.portal.core.model.content.Content;
import org.jboss.portal.security.spi.auth.PortalAuthorizationManagerFactory;
@@ -274,6 +275,19 @@
return dashboardPortal;
}
+ public void destroyDashboard(String userId)
+ {
+ try
+ {
+ PortalContainer dashboardContext = (PortalContainer)portalObjectContainer.getObject(dashboardContextObjectId);
+ dashboardContext.destroyChild(userId);
+ }
+ catch (NoSuchPortalObjectException e)
+ {
+ e.printStackTrace();
+ }
+ }
+
private String getUserId(User user)
{
return user.getUserName();
Modified: trunk/core/src/main/org/jboss/portal/core/model/CustomizationManager.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/model/CustomizationManager.java 2007-02-07 13:46:53 UTC (rev 6182)
+++ trunk/core/src/main/org/jboss/portal/core/model/CustomizationManager.java 2007-02-07 15:25:12 UTC (rev 6183)
@@ -72,4 +72,9 @@
* @return
*/
boolean isDashboard(PortalObject object, User user);
+
+ /**
+ * @param userId
+ */
+ void destroyDashboard(String userId);
}
Modified: trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-02-07 13:46:53 UTC (rev 6182)
+++ trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-02-07 15:25:12 UTC (rev 6183)
@@ -439,13 +439,22 @@
<!--Identity-->
<mbean
+ code="org.jboss.portal.identity.service.IdentityEventManagerService"
+ name="portal:service=IdentityEventManager"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+ <mbean
code="org.jboss.portal.identity.IdentityServiceControllerImpl"
name="portal:service=Module,type=IdentityServiceController"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
<depends>portal:service=Hibernate</depends>
- <!--<depends>jboss.jca:service=DataSourceBinding,name=@portal.datasource.name@</depends>-->
+ <depends
+ optional-attribute-name="IdentityEventBroadcaster"
+ proxy-type="attribute">portal:service=IdentityEventManager</depends>
<attribute name="JndiName">java:/portal/IdentityServiceController</attribute>
<attribute name="RegisterMBeans">true</attribute>
<attribute name="ConfigFile">conf/identity/identity-config.xml</attribute>
@@ -584,6 +593,34 @@
<attribute name="DashboardContextId">dashboard</attribute>
</mbean>
+ <!-- Integrate identity -->
+ <mbean
+ code="org.jboss.portal.core.identity.DashboardBridge"
+ name="portal:service=IdentityDashboardBridge"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends
+ optional-attribute-name="IdentityEventEmitter"
+ proxy-type="attribute">portal:service=IdentityEventManager</depends>
+ <depends
+ optional-attribute-name="CustomizationManager"
+ proxy-type="attribute">portal:service=CustomizationManager</depends>
+ </mbean>
+ <mbean
+ code="org.jboss.portal.core.identity.SecurityBridge"
+ name="portal:service=IdentitySecurityBridge"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends
+ optional-attribute-name="IdentityEventEmitter"
+ proxy-type="attribute">portal:service=IdentityEventManager</depends>
+ <depends
+ optional-attribute-name="DynamicLoginConfig"
+ proxy-type="attribute">portal:service=JAASLoginModule</depends>
+ </mbean>
+
<!-- Command factories -->
<mbean
code="org.jboss.portal.core.controller.command.mapper.DelegatingCommandFactoryService"
Modified: trunk/identity/src/main/org/jboss/portal/identity/IdentityServiceControllerImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/IdentityServiceControllerImpl.java 2007-02-07 13:46:53 UTC (rev 6182)
+++ trunk/identity/src/main/org/jboss/portal/identity/IdentityServiceControllerImpl.java 2007-02-07 15:25:12 UTC (rev 6183)
@@ -29,6 +29,7 @@
import org.jboss.portal.identity.IdentityContextImpl;
import org.jboss.portal.identity.IdentityServiceController;
import org.jboss.portal.identity.event.IdentityEventBroadcaster;
+import org.jboss.portal.identity.event.IdentityEvent;
import org.jboss.portal.identity.config.metadata.IdentityConfigurationMetaData;
import org.jboss.portal.identity.config.metadata.ModuleMetaData;
import org.jboss.portal.identity.config.metadata.ConfigOptionMetaData;
@@ -39,7 +40,6 @@
import org.jboss.portal.identity.config.metadata.ConfigurationParser;
import org.jboss.portal.identity.service.IdentityModuleService;
import org.jboss.portal.identity.service.IdentityConfigurationService;
-import org.jboss.portal.identity.service.IdentityEventService;
import org.jboss.kernel.Kernel;
import org.jboss.kernel.spi.dependency.KernelControllerContext;
import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
@@ -84,6 +84,8 @@
*/
protected List beans;
+
+
protected void startService() throws Exception
{
if (jndiName != null)
@@ -130,20 +132,24 @@
}
- //IdentityEventBroadcaster
- IdentityEventBroadcaster broadcaster = null;
- try
+ // IdentityEventBroadcaster
+ IdentityEventBroadcaster broadcaster = identityEventBroadcaster;
+ if(broadcaster == null)
{
- broadcaster = instantiateIdentityEventBroadcaster();
- if(broadcaster != null)
+ broadcaster = new IdentityEventBroadcaster()
{
- identityContext.register(broadcaster, IdentityContext.TYPE_IDENTITY_EVENT_BROADCASTER);
- }
- else
- {
- throw new NullPointerException();
- }
+ public void fireEvent(IdentityEvent event)
+ {
+ // Noop
+ }
+ };
}
+
+ //
+ try
+ {
+ identityContext.register(broadcaster, IdentityContext.TYPE_IDENTITY_EVENT_BROADCASTER);
+ }
catch (Throwable throwable)
{
throw new IdentityException("Unable to install IdentityEventBroadcaster", throwable);
@@ -550,18 +556,6 @@
}
- /**
- * Instantiates IdentityEventBroadcaster and register proper events in it
- * @return
- */
- private IdentityEventBroadcaster instantiateIdentityEventBroadcaster()
- {
- return new IdentityEventService();
- }
-
-
-
-
public IdentityContext getIdentityContext()
{
return identityContext;
Modified: trunk/identity/src/main/org/jboss/portal/identity/auth/UserPrincipal.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/auth/UserPrincipal.java 2007-02-07 13:46:53 UTC (rev 6182)
+++ trunk/identity/src/main/org/jboss/portal/identity/auth/UserPrincipal.java 2007-02-07 15:25:12 UTC (rev 6183)
@@ -52,4 +52,23 @@
{
return "PortalPrincipal[" + name + "]";
}
+
+ public boolean equals(Object o)
+ {
+ if (o == this)
+ {
+ return true;
+ }
+ if (o instanceof Principal)
+ {
+ Principal that = (Principal)o;
+ return name.equals(that.getName());
+ }
+ return false;
+ }
+
+ public int hashCode()
+ {
+ return name.hashCode();
+ }
}
Copied: trunk/identity/src/main/org/jboss/portal/identity/service/IdentityEventManagerService.java (from rev 6182, trunk/identity/src/main/org/jboss/portal/identity/service/IdentityEventService.java)
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/service/IdentityEventManagerService.java (rev 0)
+++ trunk/identity/src/main/org/jboss/portal/identity/service/IdentityEventManagerService.java 2007-02-07 15:25:12 UTC (rev 6183)
@@ -0,0 +1,74 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.identity.service;
+
+import org.jboss.portal.identity.event.IdentityEventBroadcaster;
+import org.jboss.portal.identity.event.IdentityEventListener;
+import org.jboss.portal.identity.event.IdentityEvent;
+import org.jboss.portal.identity.event.IdentityEventEmitter;
+import org.jboss.portal.common.util.CopyOnWriteRegistry;
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+
+import java.util.Iterator;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class IdentityEventManagerService extends AbstractJBossService implements IdentityEventBroadcaster, IdentityEventEmitter
+{
+
+ /** . */
+ private final CopyOnWriteRegistry listeners;
+
+ public IdentityEventManagerService()
+ {
+ listeners = new CopyOnWriteRegistry();
+ }
+
+ public void addListener(IdentityEventListener listener)
+ {
+ listeners.register(listener, listener);
+ }
+
+ public void removeListener(IdentityEventListener listener)
+ {
+ listeners.unregister(listener);
+ }
+
+ public void fireEvent(IdentityEvent event)
+ {
+ for (Iterator i = listeners.getRegistrations().iterator();i.hasNext();)
+ {
+ IdentityEventListener listener = (IdentityEventListener)i.next();
+ try
+ {
+ listener.onEvent(event);
+ }
+ catch (Exception e)
+ {
+ log.error("Listener " + listener + " threw an exception during event firing " + event, e);
+ }
+ }
+ }
+}
Deleted: trunk/identity/src/main/org/jboss/portal/identity/service/IdentityEventService.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/service/IdentityEventService.java 2007-02-07 13:46:53 UTC (rev 6182)
+++ trunk/identity/src/main/org/jboss/portal/identity/service/IdentityEventService.java 2007-02-07 15:25:12 UTC (rev 6183)
@@ -1,74 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.identity.service;
-
-import org.jboss.portal.identity.event.IdentityEventBroadcaster;
-import org.jboss.portal.identity.event.IdentityEventListener;
-import org.jboss.portal.identity.event.IdentityEvent;
-import org.jboss.portal.identity.event.IdentityEventEmitter;
-import org.jboss.portal.common.util.CopyOnWriteRegistry;
-import org.jboss.portal.jems.as.system.AbstractJBossService;
-
-import java.util.Iterator;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class IdentityEventService extends AbstractJBossService implements IdentityEventBroadcaster, IdentityEventEmitter
-{
-
- /** . */
- private final CopyOnWriteRegistry listeners;
-
- public IdentityEventService()
- {
- listeners = new CopyOnWriteRegistry();
- }
-
- public void addListener(IdentityEventListener listener)
- {
- listeners.register(listener, listener);
- }
-
- public void removeListener(IdentityEventListener listener)
- {
- listeners.unregister(listener);
- }
-
- public void fireEvent(IdentityEvent event)
- {
- for (Iterator i = listeners.getRegistrations().iterator();i.hasNext();)
- {
- IdentityEventListener listener = (IdentityEventListener)i.next();
- try
- {
- listener.onEvent(event);
- }
- catch (Exception e)
- {
- log.error("Listener " + listener + " threw an exception during event firing " + event, e);
- }
- }
- }
-}
19 years, 2 months
JBoss Portal SVN: r6182 - in trunk/wsrp/src: main/org/jboss/portal/wsrp/producer/config/impl and 2 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-02-07 08:46:53 -0500 (Wed, 07 Feb 2007)
New Revision: 6182
Added:
trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/producer-config.xml
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationServiceImpl.java
trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml
Log:
fixing wsrp test execution
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java 2007-02-07 01:38:37 UTC (rev 6181)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java 2007-02-07 13:46:53 UTC (rev 6182)
@@ -59,7 +59,8 @@
{
return new ProducerConfigurationImpl();
}
- throw new IllegalArgumentException("The processed file doesn't seem to have the proper format");
+ throw new IllegalArgumentException("The processed file doesn't seem to have the proper format, " +
+ "was expecting producer-configuration, instead got " + localName);
}
public Object newChild(ProducerConfigurationImpl producerConfiguration, UnmarshallingContext nav, String nsURI, String localName, Attributes attrs)
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationServiceImpl.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationServiceImpl.java 2007-02-07 01:38:37 UTC (rev 6181)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationServiceImpl.java 2007-02-07 13:46:53 UTC (rev 6182)
@@ -86,6 +86,7 @@
throw new Exception("The config " + configURL + " does not exist");
}
+ log.debug("About to parse producer configuration " + configURL);
Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
ObjectModelFactory factory = new ProducerConfigurationFactory();
configuration = (ProducerConfiguration)unmarshaller.unmarshal(configURL.openStream(), factory, null);
Modified: trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml 2007-02-07 01:38:37 UTC (rev 6181)
+++ trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml 2007-02-07 13:46:53 UTC (rev 6182)
@@ -164,17 +164,11 @@
proxy-type="attribute">portal:service=WebAppRegistry</depends>
</mbean>
- <!-- WSRP Producer implementation -->
- <mbean
- code="org.jboss.portal.wsrp.producer.WSRPProducerImpl"
- name="portal.wsrp:service=WSRPProducer"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <!-- Use DefaultRegistrationPolicy for registration -->
+ <mbean code="org.jboss.portal.registration.policies.DefaultRegistrationPolicy"
+ name="portal.wsrp:service=RegistrationPolicy" xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <depends optional-attribute-name="Invoker"
- proxy-type="attribute">portal:service=PortletInvoker,type=Stateful</depends>
- <attribute name="RemotableByDefault">true</attribute>
- <depends optional-attribute-name="RegistrationManager" proxy-type="attribute">portal.wsrp:service=RegistrationManager</depends>
</mbean>
<!-- Registration manager -->
@@ -186,13 +180,31 @@
<depends optional-attribute-name="PersistenceManager" proxy-type="attribute">portal.wsrp:service=PersistenceManager</depends>
</mbean>
- <!-- Use DefaultRegistrationPolicy for registration -->
- <mbean code="org.jboss.portal.registration.policies.DefaultRegistrationPolicy"
- name="portal.wsrp:service=RegistrationPolicy" xmbean-dd=""
+ <!-- Producer configuration service -->
+ <mbean code="org.jboss.portal.wsrp.producer.config.impl.ProducerConfigurationServiceImpl"
+ name="portal.wsrp:service=ProducerConfiguration" xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
+ <!-- User producer-config.xml instead of conf/config.xml because the configuration service will
+ retrieve the wrong configuration file. As the test-wsrp-producer.sar embeds portal-server.sar
+ it is the config file of the portal-server.sar that will be retrieved -->
+ <attribute name="ConfigLocation">producer-config.xml</attribute>
</mbean>
+ <!-- WSRP Producer implementation -->
+ <mbean
+ code="org.jboss.portal.wsrp.producer.WSRPProducerImpl"
+ name="portal.wsrp:service=WSRPProducer"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="Invoker"
+ proxy-type="attribute">portal:service=PortletInvoker,type=Stateful</depends>
+ <attribute name="RemotableByDefault">true</attribute>
+ <depends optional-attribute-name="RegistrationManager" proxy-type="attribute">portal.wsrp:service=RegistrationManager</depends>
+ <depends optional-attribute-name="ProducerConfigurationService" proxy-type="attribute">portal.wsrp:service=ProducerConfiguration</depends>
+ </mbean>
+
<!-- Persistence manager for registrations -->
<mbean code="org.jboss.portal.registration.impl.RegistrationPersistenceManagerImpl"
name="portal.wsrp:service=PersistenceManager" xmbean-dd=""
Added: trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/producer-config.xml
===================================================================
--- trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/producer-config.xml (rev 0)
+++ trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/producer-config.xml 2007-02-07 13:46:53 UTC (rev 6182)
@@ -0,0 +1,29 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<producer-configuration>
+ <registration-configuration fullServiceDescriptionRequiresRegistration="true">
+ <registration-property-validator>org.jboss.portal.registration.policies.DefaultRegistrationPropertyValidator</registration-property-validator>
+ </registration-configuration>
+</producer-configuration>
+
19 years, 2 months
JBoss Portal SVN: r6181 - in trunk/identity: src/main/org/jboss/portal/identity and 3 other directories.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-02-06 20:38:37 -0500 (Tue, 06 Feb 2007)
New Revision: 6181
Modified:
trunk/identity/build.xml
trunk/identity/src/main/org/jboss/portal/identity/IdentityContext.java
trunk/identity/src/main/org/jboss/portal/identity/IdentityServiceControllerImpl.java
trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserModuleImpl.java
trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserModuleImpl.java
trunk/identity/src/main/org/jboss/portal/identity/service/IdentityModuleService.java
trunk/identity/src/main/org/jboss/portal/identity/service/UserModuleService.java
Log:
- Integrate IdentityEventService and fireEvent() invocations into UserModule implementations
Modified: trunk/identity/build.xml
===================================================================
--- trunk/identity/build.xml 2007-02-07 00:24:23 UTC (rev 6180)
+++ trunk/identity/build.xml 2007-02-07 01:38:37 UTC (rev 6181)
@@ -454,8 +454,8 @@
<!--<test todir="${test.reports}" name="org.jboss.portal.test.identity.db.DBIdentityTestCase"/>-->
<!--<test todir="${test.reports}" name="org.jboss.portal.test.identity.UserProtoTestCase"/>-->
<!--<test todir="${test.reports}" name="org.jboss.portal.test.identity.ConfigurationTestCase"/>-->
- <!--<test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPSimpleUserModuleTestCase"/>-->
- <test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPSimpleRoleModuleTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPSimpleUserModuleTestCase"/>
+ <!--<test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPSimpleRoleModuleTestCase"/>-->
<!--<test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPStaticGroupMembershipModuleTestCase"/>-->
<!--<test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPStaticRoleMembershipModuleTestCase"/>-->
<!--<test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPUserProfileModuleTestCase"/>-->
Modified: trunk/identity/src/main/org/jboss/portal/identity/IdentityContext.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/IdentityContext.java 2007-02-07 00:24:23 UTC (rev 6180)
+++ trunk/identity/src/main/org/jboss/portal/identity/IdentityContext.java 2007-02-07 01:38:37 UTC (rev 6181)
@@ -41,7 +41,9 @@
public static final String TYPE_IDENTITY_CONFIGURATION = "IdentityConfiguration";
+ public static final String TYPE_IDENTITY_EVENT_BROADCASTER = "IdentityEventBroadcaster";
+
public void register(Object object, String name) throws IdentityException;
public void unregister(String name);
Modified: trunk/identity/src/main/org/jboss/portal/identity/IdentityServiceControllerImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/IdentityServiceControllerImpl.java 2007-02-07 00:24:23 UTC (rev 6180)
+++ trunk/identity/src/main/org/jboss/portal/identity/IdentityServiceControllerImpl.java 2007-02-07 01:38:37 UTC (rev 6181)
@@ -28,6 +28,7 @@
import org.jboss.portal.identity.IdentityContext;
import org.jboss.portal.identity.IdentityContextImpl;
import org.jboss.portal.identity.IdentityServiceController;
+import org.jboss.portal.identity.event.IdentityEventBroadcaster;
import org.jboss.portal.identity.config.metadata.IdentityConfigurationMetaData;
import org.jboss.portal.identity.config.metadata.ModuleMetaData;
import org.jboss.portal.identity.config.metadata.ConfigOptionMetaData;
@@ -38,6 +39,7 @@
import org.jboss.portal.identity.config.metadata.ConfigurationParser;
import org.jboss.portal.identity.service.IdentityModuleService;
import org.jboss.portal.identity.service.IdentityConfigurationService;
+import org.jboss.portal.identity.service.IdentityEventService;
import org.jboss.kernel.Kernel;
import org.jboss.kernel.spi.dependency.KernelControllerContext;
import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
@@ -70,6 +72,8 @@
private String defaultConfigFile;
+ private IdentityEventBroadcaster identityEventBroadcaster;
+
/**
* .
*/
@@ -122,9 +126,30 @@
}
catch (Throwable throwable)
{
- throw new IdentityException(throwable);
+ throw new IdentityException("Unable to install IdentityContext",throwable);
}
+
+ //IdentityEventBroadcaster
+ IdentityEventBroadcaster broadcaster = null;
+ try
+ {
+ broadcaster = instantiateIdentityEventBroadcaster();
+ if(broadcaster != null)
+ {
+ identityContext.register(broadcaster, IdentityContext.TYPE_IDENTITY_EVENT_BROADCASTER);
+ }
+ else
+ {
+ throw new NullPointerException();
+ }
+ }
+ catch (Throwable throwable)
+ {
+ throw new IdentityException("Unable to install IdentityEventBroadcaster", throwable);
+ }
+
+
//TODO:update meta options using defaultMeta options
//create detault modules set
@@ -489,7 +514,7 @@
* @param config
* @param defaults
*/
- public void updateOptionsWithDefaults(IdentityConfigurationService config, OptionsMetaData defaults)
+ private void updateOptionsWithDefaults(IdentityConfigurationService config, OptionsMetaData defaults)
{
//Map newGroups = new HashMap();
Map groups = defaults.getGroups();
@@ -525,7 +550,18 @@
}
+ /**
+ * Instantiates IdentityEventBroadcaster and register proper events in it
+ * @return
+ */
+ private IdentityEventBroadcaster instantiateIdentityEventBroadcaster()
+ {
+ return new IdentityEventService();
+ }
+
+
+
public IdentityContext getIdentityContext()
{
return identityContext;
@@ -581,4 +617,14 @@
{
this.registerMBeans = registerMBeans;
}
+
+ public IdentityEventBroadcaster getIdentityEventBroadcaster()
+ {
+ return identityEventBroadcaster;
+ }
+
+ public void setIdentityEventBroadcaster(IdentityEventBroadcaster identityEventBroadcaster)
+ {
+ this.identityEventBroadcaster = identityEventBroadcaster;
+ }
}
Modified: trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserModuleImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserModuleImpl.java 2007-02-07 00:24:23 UTC (rev 6180)
+++ trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserModuleImpl.java 2007-02-07 01:38:37 UTC (rev 6181)
@@ -166,6 +166,10 @@
//user.setRealEmail(realEmail);
Session session = getCurrentSession();
session.save(user);
+
+ //fire events
+ fireUserCreatedEvent(user.getId(), user.getUserName());
+
return user;
}
catch (HibernateException e)
@@ -189,12 +193,17 @@
{
Session session = getCurrentSession();
HibernateUserImpl user = (HibernateUserImpl)session.load(HibernateUserImpl.class, (Serializable)id);
+
+ String userName = user.getUserName();
if (user == null)
{
throw new NoSuchUserException("No such user " + id);
}
session.delete(user);
session.flush();
+
+ //fire events
+ fireUserDestroyedEvent(id, userName);
}
catch (HibernateException e)
{
Modified: trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserModuleImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserModuleImpl.java 2007-02-07 00:24:23 UTC (rev 6180)
+++ trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserModuleImpl.java 2007-02-07 01:38:37 UTC (rev 6181)
@@ -177,16 +177,13 @@
log.debug("creating ldap entry for: " + dn + "; " + attrs);
ctx.createSubcontext(dn, attrs);
}
-// catch (NoSuchAlgorithmException e)
-// {
-// throw new IdentityException("Failed to create user", e);
-// }
catch (Exception e)
{
throw new IdentityException("Failed to create user", e);
}
-
- return findUserByUserName(userName);
+ User u = findUserByUserName(userName);
+ fireUserCreatedEvent(u.getId(), u.getUserName());
+ return u;
}
//TODO: remove user assignments before?
@@ -195,6 +192,8 @@
LDAPUserImpl ldapu = (LDAPUserImpl)findUserById(id);
+ String userName = ldapu.getUserName();
+
if (ldapu == null)
{
throw new IdentityException("Cannot find user for removal");
@@ -216,7 +215,8 @@
throw new IdentityException("Failed to remove user: ", e);
}
-
+ //user was successfull removed so fire events
+ fireUserDestroyedEvent(id, userName);
}
Modified: trunk/identity/src/main/org/jboss/portal/identity/service/IdentityModuleService.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/service/IdentityModuleService.java 2007-02-07 00:24:23 UTC (rev 6180)
+++ trunk/identity/src/main/org/jboss/portal/identity/service/IdentityModuleService.java 2007-02-07 01:38:37 UTC (rev 6181)
@@ -25,6 +25,7 @@
import org.jboss.portal.identity.IdentityConfiguration;
import org.jboss.portal.common.util.JNDI;
import org.jboss.portal.identity.IdentityException;
+import org.jboss.portal.identity.event.IdentityEventBroadcaster;
import org.jboss.portal.jems.as.system.AbstractJBossService;
import java.util.Map;
@@ -126,6 +127,11 @@
}
}
+ protected IdentityEventBroadcaster getIdentityEventBroadcaster() throws IdentityException
+ {
+ return (IdentityEventBroadcaster)getIdentityContext().getObject(IdentityContext.TYPE_IDENTITY_EVENT_BROADCASTER);
+ }
+
public IdentityContext getIdentityContext()
{
return identityContext;
Modified: trunk/identity/src/main/org/jboss/portal/identity/service/UserModuleService.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/service/UserModuleService.java 2007-02-07 00:24:23 UTC (rev 6180)
+++ trunk/identity/src/main/org/jboss/portal/identity/service/UserModuleService.java 2007-02-07 01:38:37 UTC (rev 6181)
@@ -23,6 +23,10 @@
import org.jboss.portal.identity.UserModule;
import org.jboss.portal.identity.IdentityContext;
+import org.jboss.portal.identity.IdentityException;
+import org.jboss.portal.identity.event.IdentityEvent;
+import org.jboss.portal.identity.event.UserCreatedEvent;
+import org.jboss.portal.identity.event.UserDestroyedEvent;
/**
* @author <a href="mailto:boleslaw dot dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
@@ -36,4 +40,17 @@
{
super(IdentityContext.TYPE_USER_MODULE);
}
+
+ protected void fireUserCreatedEvent(Object userId, String userName) throws IdentityException
+ {
+ IdentityEvent event = new UserCreatedEvent(userId, userName);
+ getIdentityEventBroadcaster().fireEvent(event);
+ }
+
+ protected void fireUserDestroyedEvent(Object userId, String userName) throws IdentityException
+ {
+ IdentityEvent event = new UserDestroyedEvent(userId, userName);
+ getIdentityEventBroadcaster().fireEvent(event);
+ }
+
}
19 years, 2 months
JBoss Portal SVN: r6180 - docs/trunk/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-02-06 19:24:23 -0500 (Tue, 06 Feb 2007)
New Revision: 6180
Modified:
docs/trunk/referenceGuide/en/modules/identity.xml
Log:
some docs update on SSL and ExternalContext usage in identity
Modified: docs/trunk/referenceGuide/en/modules/identity.xml
===================================================================
--- docs/trunk/referenceGuide/en/modules/identity.xml 2007-02-07 00:10:58 UTC (rev 6179)
+++ docs/trunk/referenceGuide/en/modules/identity.xml 2007-02-07 00:24:23 UTC (rev 6180)
@@ -488,9 +488,72 @@
]]>
</programlisting>
+ <note>
+ Under <emphasis role="bold">PORTAL_SOURCES/identity/src/resources/example/</emphasis> you can find a sample ldif that
+ you can use to populate LDAP server and quickly start playing with it.
+ </note>
</sect1>
<sect1>
+ <title>Configuration of LDAP connection</title>
+ <sect2>
+ <title>SSL</title>
+ <para>The setup is very similar to the one described in LdapLoginModule <ulink url="http://www.jboss.org/wiki/Wiki.jsp?page=LdapLoginModule">wiki page</ulink></para>
+ <para>You need to modify your identity configuration file and add "protocol"</para>
+ <programlisting>
+ <![CDATA[
+ <datasource>
+ <name>LDAP</name>
+ <config>
+ ...
+ <option>
+ <name>protocol</name>
+ <value>ssl</value>
+ </option>
+ ...
+ </config>
+ </datasource>
+ ]]>
+ </programlisting>
+ <para>
+ Then you need to have LDAP server certificate imported into your keystore. You can use following command:
+ <programlisting>keytool -import -file ldapcert.der -keystore ldap.truststore</programlisting>
+ </para>
+ <para>
+ Now you need to change the settings to use the alternative truststore. That can be done in the properties-service.xml in deploy directory:
+ <programlisting>
+ <![CDATA[
+ <attribute name="Properties">
+ javax.net.ssl.trustStore=../some/path/to/ldap.truststore
+ javax.net.ssl.trustStorePassword=somepw
+ </attribute>
+ ]]>
+ </programlisting>
+ </para>
+ </sect2>
+ <sect2>
+ <title>ExternalContext</title>
+ <para>Instead of configuring your own connection you can use JNDI context federation mechanism in JBoss Application Server. Configuration of
+ ExternalContext is described in <ulink url="http://docs.jboss.com/jbossas/guides/j2eeguide/r2/en/html_single/#d0e6877">JBoss Application Server documentation</ulink></para>
+ <para>When you have ExternalContext configured you can use it in JBoss Portal by providing proper JNDI name in the configuration:
+ <programlisting>
+ <![CDATA[
+ <datasource>
+ <name>LDAP</name>
+ <config>
+ <option>
+ <name>externalContextJndiName</name>
+ <value>external/ldap/jboss</value>
+ </option>
+ </config>
+ </datasource>
+ ]]>
+ </programlisting>
+ <note>When using "externalContextJndiName" you don't need to specify any other option for this datasource</note>
+ </para>
+ </sect2>
+ </sect1>
+ <sect1>
<title>Identity configuration</title>
<para>At the beginning to understand identity configuration you need to understand how it is designed to work in portal.
Different identity services like UserModule, RoleModule and etc are just plain java classes that are instantiated and exposed
19 years, 2 months
JBoss Portal SVN: r6179 - in trunk/identity/src/main/org/jboss/portal/identity: ldap and 1 other directory.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-02-06 19:10:58 -0500 (Tue, 06 Feb 2007)
New Revision: 6179
Modified:
trunk/identity/src/main/org/jboss/portal/identity/IdentityConfiguration.java
trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPConnectionContext.java
trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserModule.java
Log:
- add SSL connections to LDAP and possibility to use ExternalContext
- some more flexible authentication of users
Modified: trunk/identity/src/main/org/jboss/portal/identity/IdentityConfiguration.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/IdentityConfiguration.java 2007-02-06 20:44:08 UTC (rev 6178)
+++ trunk/identity/src/main/org/jboss/portal/identity/IdentityConfiguration.java 2007-02-07 00:10:58 UTC (rev 6179)
@@ -60,6 +60,10 @@
public static final String CONNECTION_AUTHENTICATION = "authentication";
+ public static final String USER_PRINCIPAL_PREFIX = "principalDNPrefix";
+
+ public static final String USER_PRINCIPAL_SUFFIX = "principalDNSuffix";
+
public static final String USER_CONTAINER_DN = "userContainerDN";
public static final String USER_UID_ATTRIBUTE_ID = "uidAttributeID";
@@ -68,21 +72,35 @@
public static final String USER_EMAIL_ATTRIBUTE_ID = "emailAttributeID";
+ //TODO:
+ public static final String USER_BASE_FILTER = "userBaseFilter";
+
public static final String ROLE_CONTAINER_DN = "roleContainerDN";
public static final String ROLE_RID_ATTRIBUTE_ID = "ridAttributeID";
public static final String ROLE_DISPLAY_NAME_ATTRIBUTE_ID = "roleDisplayNameAttributeID";
+ //TODO:
+ public static final String ROLE_RECURSION = "roleRecursion";
+
+ //TODO:
+ public static final String ROLE_BASE_FILTER = "roleBaseFilter";
+
+ //TODO:
+ public static final String ROLE_CONTEXT_DN = "rolesCtxDN";
+
+
public static final String MEMBERSHIP_ATTRIBUTE_ID = "membershipAttributeID";
public static final String MEMBERSHIP_ATTRIBUTE_IS_DN = "membershipAttributeIsDN";
- public static final String HASH_ALGORITHM = "hashAlgorithm";
+ //TODO:
+ public static final String SEARCH_TIME_LIMIT = "searchTimeLimit";
- public static final String HASH_ENCODING = "hashEncoding";
+ //TODO:
+ public static final String SEARCH_SCOPE = "searchScope";
- public static final String ENCODE_PASSWORD_ON_UPDATE = "encodePasswordOnUpdate";
public Set getValues(String optionGroup, String option);
Modified: trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPConnectionContext.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPConnectionContext.java 2007-02-06 20:44:08 UTC (rev 6178)
+++ trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPConnectionContext.java 2007-02-07 00:10:58 UTC (rev 6179)
@@ -29,6 +29,7 @@
import javax.naming.Context;
import javax.naming.NamingException;
+import javax.naming.InitialContext;
import javax.naming.ldap.InitialLdapContext;
import java.util.Hashtable;
import java.util.Map;
@@ -64,6 +65,8 @@
private String port;
+ private String externalContextJndiName;
+
/*public LDAPConnectionContext(String name,
String url,
String context,
@@ -95,6 +98,10 @@
env.put(Context.SECURITY_AUTHENTICATION, this.getAuthentication());
env.put(Context.SECURITY_PRINCIPAL, this.getAdminDN());
env.put(Context.SECURITY_CREDENTIALS, this.getAdminPassword());
+ if (this.getProtocol() != null)
+ {
+ env.put(Context.SECURITY_PROTOCOL, this.getProtocol());
+ }
return env;
}
@@ -102,8 +109,18 @@
{
try
{
- Hashtable env = getEnvironment();
- return new InitialLdapContext(env, null);
+ //try to use external context
+ if (getExternalContextJndiName() != null)
+ {
+ InitialContext iniCtx = new InitialContext();
+ return (InitialLdapContext)iniCtx.lookup(getExternalContextJndiName());
+ }
+ //if not construct our own one using provided options
+ else
+ {
+ Hashtable env = getEnvironment();
+ return new InitialLdapContext(env, null);
+ }
}
catch (NamingException e)
{
@@ -147,7 +164,8 @@
.append(", Context factory: ").append(getContextFactory())
.append(", Admin user: ").append(getAdminDN())
.append(", Admin password: ").append(getAdminPassword())
- .append(", Authentication: ").append(getAuthentication());
+ .append(", Authentication: ").append(getAuthentication())
+ .append(", Protocol: ").append(getProtocol());
return str.toString();
}
@@ -259,4 +277,15 @@
{
this.port = port;
}
+
+ public String getExternalContextJndiName()
+ {
+ return externalContextJndiName;
+ }
+
+ public void setExternalContextJndiName(String externalContextJndiName)
+ {
+ this.externalContextJndiName = externalContextJndiName;
+ }
+
}
Modified: trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserModule.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserModule.java 2007-02-06 20:44:08 UTC (rev 6178)
+++ trunk/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserModule.java 2007-02-07 00:10:58 UTC (rev 6179)
@@ -95,7 +95,28 @@
public boolean validatePassword(LDAPUserImpl ldapu, String password) throws IdentityException
{
Hashtable env =getConnectionContext().getEnvironment();
- env.put(Context.SECURITY_PRINCIPAL, ldapu.getDn());
+
+ //will use user DN to bind checking the password
+ String principal = ldapu.getDn();
+
+ //if principalDNPreffix or principalDNSuffix is set will use them to construct principal name
+ if (getPrincipalPreffix() != null || getPrincipalSuffix() != null)
+ {
+ String preffix = getPrincipalPreffix();
+ if (preffix == null)
+ {
+ preffix = "";
+ }
+ String suffix = getPrincipalSuffix();
+ if (suffix == null)
+ {
+ suffix = "";
+ }
+
+ principal = preffix + ldapu.getUserName() + suffix;
+ }
+
+ env.put(Context.SECURITY_PRINCIPAL, principal);
env.put(Context.SECURITY_CREDENTIALS, password);
try
{
@@ -219,28 +240,6 @@
return uid;
}
- protected String getHashAlgorightm()
- {
- try
- {
- return getIdentityConfiguration().getValue(IdentityConfiguration.HASH_ALGORITHM);
- }
- catch(Exception e)
- {
- return null;
- }
- }
-
- protected String getHashEncoding() throws IdentityException
- {
- String enc = getIdentityConfiguration().getValue(IdentityConfiguration.HASH_ENCODING);
- if (enc == null)
- {
- return "hex";
- }
- return enc;
- }
-
protected LDAPConnectionContext getConnectionContext() throws IdentityException
{
if (connectionContext == null)
@@ -261,6 +260,18 @@
return cont;
}
+ protected String getPrincipalPreffix() throws IdentityException
+ {
+ return getIdentityConfiguration().getValue(IdentityConfiguration.USER_PRINCIPAL_PREFIX);
+ //return p;
+ }
+
+ protected String getPrincipalSuffix() throws IdentityException
+ {
+ return getIdentityConfiguration().getValue(IdentityConfiguration.USER_PRINCIPAL_SUFFIX);
+ //return p;
+ }
+
protected String getPasswordAttributeId() throws IdentityException
{
String passwd = getIdentityConfiguration().getValue(IdentityConfiguration.USER_PASSWORD_ATTRIBUTE_ID);
19 years, 2 months
JBoss Portal SVN: r6178 - in trunk/cms: src/main/org/jboss/portal/test/cms and 1 other directory.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2007-02-06 15:44:08 -0500 (Tue, 06 Feb 2007)
New Revision: 6178
Modified:
trunk/cms/build.xml
trunk/cms/src/main/org/jboss/portal/test/cms/TestRepositoryBootStrap.java
Log:
fixing this test case to do proper cleanup
Modified: trunk/cms/build.xml
===================================================================
--- trunk/cms/build.xml 2007-02-06 20:14:01 UTC (rev 6177)
+++ trunk/cms/build.xml 2007-02-06 20:44:08 UTC (rev 6178)
@@ -456,6 +456,8 @@
<target name="reports" depends="init">
<mkdir dir="${build.reports}"/>
+ <mkdir dir="${build.reports}/html"/>
+ <property name="test.reports" value="${module.output}/tests"/>
<junitreport todir="${build.reports}">
<fileset dir="${test.reports}">
<include name="TEST-*.xml"/>
@@ -463,4 +465,5 @@
<report format="frames" todir="${build.reports}/html"/>
</junitreport>
</target>
+
</project>
Modified: trunk/cms/src/main/org/jboss/portal/test/cms/TestRepositoryBootStrap.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/test/cms/TestRepositoryBootStrap.java 2007-02-06 20:14:01 UTC (rev 6177)
+++ trunk/cms/src/main/org/jboss/portal/test/cms/TestRepositoryBootStrap.java 2007-02-06 20:44:08 UTC (rev 6178)
@@ -23,55 +23,26 @@
package org.jboss.portal.test.cms;
import junit.framework.TestSuite;
-import org.jboss.portal.cms.impl.jcr.JCRCMS;
import org.jboss.portal.cms.util.RepositoryUtil;
-import org.jboss.portal.common.util.CLLoader;
-import org.jboss.portal.common.util.LoaderResource;
-import org.jboss.portal.common.util.XML;
import javax.jcr.Session;
-import java.util.Locale;
-import java.util.Map;
+import org.jboss.portal.test.cms.commands.AbstractCommandTestCase;
+
/**
* Tests JCRCMS Service
*
* @author Roy Russo : roy at jboss dot org
*/
-public class TestRepositoryBootStrap extends AbstractCMSTestCase
+public class TestRepositoryBootStrap extends AbstractCommandTestCase
{
public TestRepositoryBootStrap()
{
}
- private JCRCMS service;
-
- public void setUp() throws Exception
- {
- super.setUp();
- LoaderResource res = new CLLoader().getResource("jcr/repository.xml");
-
- service = new JCRCMS();
- service.setDoChecking(true);
- service.setDefaultLocale(Locale.ENGLISH.getDisplayName());
- service.setDefaultContentLocation("default-content/default");
-
- service.setConfig(res.asDocument(XML.getDocumentBuilderFactory().newDocumentBuilder()).getDocumentElement());
- service.setRepositoryName("repo");
- service.setHomeDir("repo");
- service.start();
- }
-
- public void tearDown() throws Exception
- {
- service.stop();
- }
-
public void testService() throws Exception
{
- service.createContent();
-
assertTrue(service.contentExists());
Session session = RepositoryUtil.login(service.getRepository(), "anonid", "");
assertTrue("Default folder does not exist.", session.itemExists("/default"));
19 years, 2 months
JBoss Portal SVN: r6177 - trunk/build.
by portal-commits@lists.jboss.org
Author: prabhat.jha(a)jboss.com
Date: 2007-02-06 15:14:01 -0500 (Tue, 06 Feb 2007)
New Revision: 6177
Modified:
trunk/build/distrib.xml
Log:
fixed to resolve JBPORTAL-1221
Modified: trunk/build/distrib.xml
===================================================================
--- trunk/build/distrib.xml 2007-02-06 14:41:31 UTC (rev 6176)
+++ trunk/build/distrib.xml 2007-02-06 20:14:01 UTC (rev 6177)
@@ -136,8 +136,7 @@
<copy file="${source.dir}-docs/readmeFiles/jboss-portal-bin.README" todir="@{todir}"/>
<copy todir="@{todir}/docs/portal/licenses">
<fileset dir="output/docs/licenses"/>
- </copy>
- <mkdir dir="@{todir}/server/default/deploy"/>
+ </copy>
</sequential>
</macrodef>
19 years, 2 months
JBoss Portal SVN: r6176 - in trunk/identity/src/resources: example and 1 other directory.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-02-06 09:41:31 -0500 (Tue, 06 Feb 2007)
New Revision: 6176
Added:
trunk/identity/src/resources/example/
trunk/identity/src/resources/example/portal-sample.ldif
Log:
- example ldif to test portal and LDAP
Added: trunk/identity/src/resources/example/portal-sample.ldif
===================================================================
--- trunk/identity/src/resources/example/portal-sample.ldif (rev 0)
+++ trunk/identity/src/resources/example/portal-sample.ldif 2007-02-06 14:41:31 UTC (rev 6176)
@@ -0,0 +1,133 @@
+dn: o=portal,dc=my-domain,dc=com
+objectclass: top
+objectclass: organization
+o: portal
+
+dn: ou=People,o=portal,dc=my-domain,dc=com
+objectclass: top
+objectclass: organizationalUnit
+ou: People
+
+
+dn: uid=admin,ou=People,o=portal,dc=my-domain,dc=com
+objectclass: top
+objectclass: inetOrgPerson
+objectclass: person
+uid: admin
+cn: Java Duke
+sn: Duke
+userPassword: admin
+mail: email(a)email.com
+
+dn: uid=user,ou=People,o=portal,dc=my-domain,dc=com
+objectclass: top
+objectclass: inetOrgPerson
+objectclass: person
+uid: user
+cn: user
+sn: Portal User
+userPassword: user
+mail: email(a)email.com
+
+dn: uid=jduke,ou=People,o=portal,dc=my-domain,dc=com
+objectclass: top
+objectclass: inetOrgPerson
+objectclass: person
+uid: jduke
+cn: Java Duke
+sn: Duke
+userPassword: theduke
+mail: email(a)email.com
+
+dn: uid=jduke1,ou=People,o=portal,dc=my-domain,dc=com
+objectclass: top
+objectclass: inetOrgPerson
+objectclass: person
+uid: jduke1
+cn: Java Duke1
+sn: Duke1
+userPassword: theduke
+mail: email(a)email.com
+
+
+dn: uid=jduke2,ou=People,o=portal,dc=my-domain,dc=com
+objectclass: top
+objectclass: inetOrgPerson
+objectclass: person
+uid: jduke2
+cn: Java Duke2
+sn: Duke2
+userPassword: theduke
+mail: email(a)email.com
+
+dn: uid=jduke3,ou=People,o=portal,dc=my-domain,dc=com
+objectclass: top
+objectclass: inetOrgPerson
+objectclass: person
+uid: jduke3
+cn: Java Duke3
+sn: Duke3
+userPassword: theduke
+mail: email(a)email.com
+
+dn: uid=jduke4,ou=People,o=portal,dc=my-domain,dc=com
+objectclass: top
+objectclass: inetOrgPerson
+objectclass: person
+uid: jduke4
+cn: Java Duke4
+sn: Duke4
+userPassword: theduke
+mail: email(a)email.com
+
+dn: ou=Roles,o=portal,dc=my-domain,dc=com
+objectclass: top
+objectclass: organizationalUnit
+ou: Roles
+
+dn: cn=Admin,ou=Roles,o=portal,dc=my-domain,dc=com
+objectClass: top
+objectClass: groupOfNames
+cn: Admin
+description: Portal admin role
+member: uid=admin,ou=People,o=portal,dc=my-domain,dc=com
+
+dn: cn=User,ou=Roles,o=portal,dc=my-domain,dc=com
+objectClass: top
+objectClass: groupOfNames
+cn: User
+description: Portal user role
+member: uid=admin,ou=People,o=portal,dc=my-domain,dc=com
+member: uid=user,ou=People,o=portal,dc=my-domain,dc=com
+member: uid=jduke,ou=People,o=portal,dc=my-domain,dc=com
+member: uid=jduke1,ou=People,o=portal,dc=my-domain,dc=com
+member: uid=jduke2,ou=People,o=portal,dc=my-domain,dc=com
+member: uid=jduke3,ou=People,o=portal,dc=my-domain,dc=com
+member: uid=jduke4,ou=People,o=portal,dc=my-domain,dc=com
+member: uid=jduke5,ou=People,o=portal,dc=my-domain,dc=com
+
+
+dn: cn=Echo,ou=Roles,o=portal,dc=my-domain,dc=com
+objectClass: top
+objectClass: groupOfNames
+cn: Echo
+description: the JBossAdmin group
+member: uid=jduke1,ou=People,o=portal,dc=my-domain,dc=com
+member: uid=jduke3,ou=People,o=portal,dc=my-domain,dc=com
+member: uid=jduke4,ou=People,o=portal,dc=my-domain,dc=com
+
+dn: cn=Echo1,ou=Roles,o=portal,dc=my-domain,dc=com
+objectClass: top
+objectClass: groupOfNames
+cn: Echo1
+description: the JBossAdmin group 2
+member: uid=jduke2,ou=People,o=portal,dc=my-domain,dc=com
+member: uid=jduke3,ou=People,o=portal,dc=my-domain,dc=com
+member: uid=jduke5,ou=People,o=portal,dc=my-domain,dc=com
+
+dn: cn=TheDuke,ou=Roles,o=portal,dc=my-domain,dc=com
+objectClass: groupOfNames
+objectClass: top
+cn: TheDuke
+description: TheDuke role context
+member: uid=jduke,ou=People,o=portal,dc=my-domain,dc=com
\ No newline at end of file
19 years, 2 months
JBoss Portal SVN: r6175 - in trunk/identity/src/main/org/jboss/portal/identity: event and 1 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-02-06 09:22:19 -0500 (Tue, 06 Feb 2007)
New Revision: 6175
Added:
trunk/identity/src/main/org/jboss/portal/identity/event/
trunk/identity/src/main/org/jboss/portal/identity/event/IdentityEvent.java
trunk/identity/src/main/org/jboss/portal/identity/event/IdentityEventBroadcaster.java
trunk/identity/src/main/org/jboss/portal/identity/event/IdentityEventEmitter.java
trunk/identity/src/main/org/jboss/portal/identity/event/IdentityEventListener.java
trunk/identity/src/main/org/jboss/portal/identity/event/UserCreatedEvent.java
trunk/identity/src/main/org/jboss/portal/identity/event/UserDestroyedEvent.java
trunk/identity/src/main/org/jboss/portal/identity/service/IdentityEventService.java
Log:
added trivial eventing stuff for identity, not yet wired anywhere
Added: trunk/identity/src/main/org/jboss/portal/identity/event/IdentityEvent.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/event/IdentityEvent.java (rev 0)
+++ trunk/identity/src/main/org/jboss/portal/identity/event/IdentityEvent.java 2007-02-06 14:22:19 UTC (rev 6175)
@@ -0,0 +1,33 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.identity.event;
+
+/**
+ * Generic identity event.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class IdentityEvent
+{
+}
Added: trunk/identity/src/main/org/jboss/portal/identity/event/IdentityEventBroadcaster.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/event/IdentityEventBroadcaster.java (rev 0)
+++ trunk/identity/src/main/org/jboss/portal/identity/event/IdentityEventBroadcaster.java 2007-02-06 14:22:19 UTC (rev 6175)
@@ -0,0 +1,39 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.identity.event;
+
+/**
+ * Interface that allow event firing.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface IdentityEventBroadcaster
+{
+ /**
+ * Fire an event.
+ *
+ * @param event the event to fire
+ */
+ void fireEvent(IdentityEvent event);
+}
Added: trunk/identity/src/main/org/jboss/portal/identity/event/IdentityEventEmitter.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/event/IdentityEventEmitter.java (rev 0)
+++ trunk/identity/src/main/org/jboss/portal/identity/event/IdentityEventEmitter.java 2007-02-06 14:22:19 UTC (rev 6175)
@@ -0,0 +1,46 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.identity.event;
+
+/**
+ * Interface that allows registration management of identity event listeners.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface IdentityEventEmitter
+{
+ /**
+ * Add a listener.
+ *
+ * @param listener the listener
+ */
+ void addListener(IdentityEventListener listener);
+
+ /**
+ * Remove a listener.
+ *
+ * @param listener the listener
+ */
+ void removeListener(IdentityEventListener listener);
+}
Added: trunk/identity/src/main/org/jboss/portal/identity/event/IdentityEventListener.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/event/IdentityEventListener.java (rev 0)
+++ trunk/identity/src/main/org/jboss/portal/identity/event/IdentityEventListener.java 2007-02-06 14:22:19 UTC (rev 6175)
@@ -0,0 +1,39 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.identity.event;
+
+/**
+ * An event listener.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface IdentityEventListener
+{
+ /**
+ * Fire event on the listener.
+ *
+ * @param event the identity event
+ */
+ void onEvent(IdentityEvent event);
+}
Added: trunk/identity/src/main/org/jboss/portal/identity/event/UserCreatedEvent.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/event/UserCreatedEvent.java (rev 0)
+++ trunk/identity/src/main/org/jboss/portal/identity/event/UserCreatedEvent.java 2007-02-06 14:22:19 UTC (rev 6175)
@@ -0,0 +1,66 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.identity.event;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class UserCreatedEvent extends IdentityEvent
+{
+
+ /** . */
+ private final Object userId;
+
+ /** . */
+ private final String userName;
+
+ public UserCreatedEvent(Object userId, String userName)
+ {
+ if (userId == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (userName == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.userId = userId;
+ this.userName = userName;
+ }
+
+ public Object getUserId()
+ {
+ return userId;
+ }
+
+ public String getUserName()
+ {
+ return userName;
+ }
+
+ public String toString()
+ {
+ return "UserCreatedEvent[userId=" + userId + ",userName=" + userName + "]";
+ }
+}
Added: trunk/identity/src/main/org/jboss/portal/identity/event/UserDestroyedEvent.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/event/UserDestroyedEvent.java (rev 0)
+++ trunk/identity/src/main/org/jboss/portal/identity/event/UserDestroyedEvent.java 2007-02-06 14:22:19 UTC (rev 6175)
@@ -0,0 +1,66 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.identity.event;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class UserDestroyedEvent extends IdentityEvent
+{
+
+ /** . */
+ private final Object userId;
+
+ /** . */
+ private final String userName;
+
+ public UserDestroyedEvent(Object userId, String userName)
+ {
+ if (userId == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (userName == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.userId = userId;
+ this.userName = userName;
+ }
+
+ public Object getUserId()
+ {
+ return userId;
+ }
+
+ public String getUserName()
+ {
+ return userName;
+ }
+
+ public String toString()
+ {
+ return "UserDestroyedEvent[userId=" + userId + ",userName=" + userName + "]";
+ }
+}
Added: trunk/identity/src/main/org/jboss/portal/identity/service/IdentityEventService.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/service/IdentityEventService.java (rev 0)
+++ trunk/identity/src/main/org/jboss/portal/identity/service/IdentityEventService.java 2007-02-06 14:22:19 UTC (rev 6175)
@@ -0,0 +1,74 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.identity.service;
+
+import org.jboss.portal.identity.event.IdentityEventBroadcaster;
+import org.jboss.portal.identity.event.IdentityEventListener;
+import org.jboss.portal.identity.event.IdentityEvent;
+import org.jboss.portal.identity.event.IdentityEventEmitter;
+import org.jboss.portal.common.util.CopyOnWriteRegistry;
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+
+import java.util.Iterator;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class IdentityEventService extends AbstractJBossService implements IdentityEventBroadcaster, IdentityEventEmitter
+{
+
+ /** . */
+ private final CopyOnWriteRegistry listeners;
+
+ public IdentityEventService()
+ {
+ listeners = new CopyOnWriteRegistry();
+ }
+
+ public void addListener(IdentityEventListener listener)
+ {
+ listeners.register(listener, listener);
+ }
+
+ public void removeListener(IdentityEventListener listener)
+ {
+ listeners.unregister(listener);
+ }
+
+ public void fireEvent(IdentityEvent event)
+ {
+ for (Iterator i = listeners.getRegistrations().iterator();i.hasNext();)
+ {
+ IdentityEventListener listener = (IdentityEventListener)i.next();
+ try
+ {
+ listener.onEvent(event);
+ }
+ catch (Exception e)
+ {
+ log.error("Listener " + listener + " threw an exception during event firing " + event, e);
+ }
+ }
+ }
+}
19 years, 2 months
JBoss Portal SVN: r6174 - in trunk/cms: src/resources/test/jcr and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-02-06 09:01:30 -0500 (Tue, 06 Feb 2007)
New Revision: 6174
Modified:
trunk/cms/build.xml
trunk/cms/src/resources/test/jcr/repository.xml
Log:
really have to switch back to hibernate PM as JBossCache PM make the DB matrix test fails.
Modified: trunk/cms/build.xml
===================================================================
--- trunk/cms/build.xml 2007-02-06 11:19:51 UTC (rev 6173)
+++ trunk/cms/build.xml 2007-02-06 14:01:30 UTC (rev 6174)
@@ -453,4 +453,14 @@
</x-classpath>
</execute-tests>
</target>
+
+ <target name="reports" depends="init">
+ <mkdir dir="${build.reports}"/>
+ <junitreport todir="${build.reports}">
+ <fileset dir="${test.reports}">
+ <include name="TEST-*.xml"/>
+ </fileset>
+ <report format="frames" todir="${build.reports}/html"/>
+ </junitreport>
+ </target>
</project>
Modified: trunk/cms/src/resources/test/jcr/repository.xml
===================================================================
--- trunk/cms/src/resources/test/jcr/repository.xml 2007-02-06 11:19:51 UTC (rev 6173)
+++ trunk/cms/src/resources/test/jcr/repository.xml 2007-02-06 14:01:30 UTC (rev 6174)
@@ -66,7 +66,7 @@
-->
<!-- HibernatePersistentManager: uses RDBMS + Hibernate for storage -->
- <PersistenceManager class="org.jboss.portal.cms.hibernate.state.JBossCachePersistenceManager">
+ <PersistenceManager class="org.jboss.portal.cms.hibernate.state.HibernatePersistenceManager">
<param name="schemaObjectPrefix" value="WSP"/>
<param name="JNDIName" value="java:/SessionFactory"/>
<param name="externalBLOBs" value="false"/>
@@ -113,7 +113,7 @@
-->
<!-- HibernatePersistentManager: uses RDBMS + Hibernate for storage -->
- <PersistenceManager class="org.jboss.portal.cms.hibernate.state.JBossCachePersistenceManager">
+ <PersistenceManager class="org.jboss.portal.cms.hibernate.state.HibernatePersistenceManager">
<param name="schemaObjectPrefix" value="Version"/>
<param name="JNDIName" value="java:/SessionFactory"/>
<param name="externalBLOBs" value="false"/>
19 years, 2 months