JBoss Identity SVN: r1130 - in authz/gatein/authz-plugin/trunk/service/src: main/java/org/jboss/gatein/authz/service/agent/enforcement and 4 other directories.
by jboss-identity-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2010-06-05 16:14:48 -0400 (Sat, 05 Jun 2010)
New Revision: 1130
Added:
authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/agent/enforcement/LocalEnforcementPointComponent.java
authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/agent/provisioning/
authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/agent/provisioning/LocalPolicyProvisionerComponent.java
authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/agent/services/LocalEventObserverComponent.java
Modified:
authz/gatein/authz-plugin/trunk/service/src/main/resources/conf/gatein-authz-configuration.xml
authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/service/TestKernelStartup.java
Log:
Integrating the Agent Stack
Added: authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/agent/enforcement/LocalEnforcementPointComponent.java
===================================================================
--- authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/agent/enforcement/LocalEnforcementPointComponent.java (rev 0)
+++ authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/agent/enforcement/LocalEnforcementPointComponent.java 2010-06-05 20:14:48 UTC (rev 1130)
@@ -0,0 +1,73 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2010, 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.gatein.authz.service.agent.enforcement;
+
+import org.exoplatform.container.xml.InitParams;
+import org.picocontainer.Startable;
+
+import org.jboss.security.authz.agent.enforcement.LocalEnforcementPoint;
+
+import org.jboss.gatein.authz.service.PolicyServerComponent;
+import org.jboss.gatein.authz.service.agent.services.EnforcementStateGeneratorComponent;
+
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class LocalEnforcementPointComponent implements Startable
+{
+ private final InitParams params;
+ private LocalEnforcementPoint enforcementPoint;
+
+ public LocalEnforcementPointComponent(InitParams params,PolicyServerComponent policyServer, EnforcementStateGeneratorComponent stateComponent,
+ EnforcementCacheComponent enforcementCache)
+ {
+ this.params = params;
+
+ this.enforcementPoint = new LocalEnforcementPoint();
+ this.enforcementPoint.setPolicyServer(policyServer.getPolicyServer());
+ this.enforcementPoint.setStateGenerator(stateComponent.getEnforcementStateGenerator());
+ this.enforcementPoint.setEnforcementCache(enforcementCache.getEnforcementCache());
+ }
+
+ @Override
+ public void start()
+ {
+ }
+
+ @Override
+ public void stop()
+ {
+ }
+
+ public String getName()
+ {
+ return this.params.getValueParam("name").getValue();
+ }
+ //--------------------------------------------------------------------------------------------------------------------------------------------------------
+ public LocalEnforcementPoint getEnforcementPoint()
+ {
+ return this.enforcementPoint;
+ }
+}
Added: authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/agent/provisioning/LocalPolicyProvisionerComponent.java
===================================================================
--- authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/agent/provisioning/LocalPolicyProvisionerComponent.java (rev 0)
+++ authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/agent/provisioning/LocalPolicyProvisionerComponent.java 2010-06-05 20:14:48 UTC (rev 1130)
@@ -0,0 +1,71 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2010, 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.gatein.authz.service.agent.provisioning;
+
+import org.exoplatform.container.xml.InitParams;
+import org.picocontainer.Startable;
+
+import org.jboss.security.authz.agent.provisioning.LocalPolicyProvisioner;
+
+import org.jboss.gatein.authz.service.PolicyServerComponent;
+import org.jboss.gatein.authz.service.agent.services.PolicyComposerComponent;
+
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class LocalPolicyProvisionerComponent implements Startable
+{
+ private final InitParams params;
+ private LocalPolicyProvisioner policyProvisioner;
+
+ public LocalPolicyProvisionerComponent(InitParams params,PolicyServerComponent policyServer, PolicyComposerComponent policyComposer)
+ {
+ this.params = params;
+
+ this.policyProvisioner = new LocalPolicyProvisioner();
+ this.policyProvisioner.setPolicyServer(policyServer.getPolicyServer());
+ this.policyProvisioner.setPolicyComposer(policyComposer.getPolicyComposer());
+ }
+
+ @Override
+ public void start()
+ {
+ }
+
+ @Override
+ public void stop()
+ {
+ }
+
+ public String getName()
+ {
+ return this.params.getValueParam("name").getValue();
+ }
+ //--------------------------------------------------------------------------------------------------------------------------------------------------------
+ public LocalPolicyProvisioner getPolicyProvisioner()
+ {
+ return this.policyProvisioner;
+ }
+}
Added: authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/agent/services/LocalEventObserverComponent.java
===================================================================
--- authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/agent/services/LocalEventObserverComponent.java (rev 0)
+++ authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/agent/services/LocalEventObserverComponent.java 2010-06-05 20:14:48 UTC (rev 1130)
@@ -0,0 +1,72 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2010, 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.gatein.authz.service.agent.services;
+
+import org.exoplatform.container.xml.InitParams;
+import org.picocontainer.Startable;
+
+import org.jboss.security.authz.agent.services.LocalEventObserver;
+
+import org.jboss.gatein.authz.service.agent.enforcement.EnforcementCacheComponent;
+import org.jboss.gatein.authz.service.event.LocalEventBusComponent;
+
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class LocalEventObserverComponent implements Startable
+{
+ private final InitParams params;
+ private LocalEventObserver eventObserver;
+
+ public LocalEventObserverComponent(InitParams params,LocalEventBusComponent eventBus, EnforcementCacheComponent enforcementCache)
+ {
+ this.params = params;
+ this.eventObserver = new LocalEventObserver();
+ this.eventObserver.setEventBus(eventBus.getEventBus());
+ this.eventObserver.setEnforcementCache(enforcementCache.getEnforcementCache());
+ }
+
+ @Override
+ public void start()
+ {
+ this.eventObserver.start();
+ }
+
+ @Override
+ public void stop()
+ {
+ this.eventObserver.stop();
+ }
+
+ public String getName()
+ {
+ return this.params.getValueParam("name").getValue();
+ }
+ //--------------------------------------------------------------------------------------------------------------------------------------------------------
+ public LocalEventObserver getEventObserver()
+ {
+ return this.eventObserver;
+ }
+}
Modified: authz/gatein/authz-plugin/trunk/service/src/main/resources/conf/gatein-authz-configuration.xml
===================================================================
--- authz/gatein/authz-plugin/trunk/service/src/main/resources/conf/gatein-authz-configuration.xml 2010-06-05 19:08:51 UTC (rev 1129)
+++ authz/gatein/authz-plugin/trunk/service/src/main/resources/conf/gatein-authz-configuration.xml 2010-06-05 20:14:48 UTC (rev 1130)
@@ -105,4 +105,34 @@
</value-param>
</init-params>
</component>
+
+ <component>
+ <type>org.jboss.gatein.authz.service.agent.services.LocalEventObserverComponent</type>
+ <init-params>
+ <value-param>
+ <name>name</name>
+ <value>/agent/ServerEventObserver</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <component>
+ <type>org.jboss.gatein.authz.service.agent.enforcement.LocalEnforcementPointComponent</type>
+ <init-params>
+ <value-param>
+ <name>name</name>
+ <value>/agent/LocalEnforcementPoint</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <component>
+ <type>org.jboss.gatein.authz.service.agent.provisioning.LocalPolicyProvisionerComponent</type>
+ <init-params>
+ <value-param>
+ <name>name</name>
+ <value>/agent/LocalPolicyProvisioner</value>
+ </value-param>
+ </init-params>
+ </component>
</configuration>
\ No newline at end of file
Modified: authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/service/TestKernelStartup.java
===================================================================
--- authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/service/TestKernelStartup.java 2010-06-05 19:08:51 UTC (rev 1129)
+++ authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/service/TestKernelStartup.java 2010-06-05 20:14:48 UTC (rev 1130)
@@ -63,7 +63,7 @@
}
- public void testStartup() throws Exception
+ public void testPolicyServiceBootstrap() throws Exception
{
PortalContainer portal = this.securityService.getContainer();