Author: sohil.shah(a)jboss.com
Date: 2010-06-05 13:23:09 -0400 (Sat, 05 Jun 2010)
New Revision: 1127
Added:
authz/gatein/authz-plugin/trunk/client/
authz/gatein/authz-plugin/trunk/client/pom.xml
authz/gatein/authz-plugin/trunk/client/src/
authz/gatein/authz-plugin/trunk/client/src/main/
authz/gatein/authz-plugin/trunk/client/src/main/java/
authz/gatein/authz-plugin/trunk/client/src/main/java/org/
authz/gatein/authz-plugin/trunk/client/src/main/java/org/jboss/
authz/gatein/authz-plugin/trunk/client/src/main/java/org/jboss/gatein/
authz/gatein/authz-plugin/trunk/client/src/main/java/org/jboss/gatein/authz/
authz/gatein/authz-plugin/trunk/client/src/main/java/org/jboss/gatein/authz/client/
authz/gatein/authz-plugin/trunk/client/src/main/java/org/jboss/gatein/authz/client/SecurityClient.java
authz/gatein/authz-plugin/trunk/client/src/main/resources/
authz/gatein/authz-plugin/trunk/client/src/main/resources/conf/
authz/gatein/authz-plugin/trunk/client/src/main/resources/conf/gatein-authz-configuration.xml
authz/gatein/authz-plugin/trunk/client/src/main/resources/conf/portal/
authz/gatein/authz-plugin/trunk/client/src/main/resources/conf/portal/gatein-authz-configuration.xml
authz/gatein/authz-plugin/trunk/client/src/test/
authz/gatein/authz-plugin/trunk/client/src/test/java/
authz/gatein/authz-plugin/trunk/client/src/test/java/org/
authz/gatein/authz-plugin/trunk/client/src/test/java/org/jboss/
authz/gatein/authz-plugin/trunk/client/src/test/java/org/jboss/gatein/
authz/gatein/authz-plugin/trunk/client/src/test/java/org/jboss/gatein/authz/
authz/gatein/authz-plugin/trunk/client/src/test/java/org/jboss/gatein/authz/client/
authz/gatein/authz-plugin/trunk/client/src/test/java/org/jboss/gatein/authz/client/TestClientBootstrap.java
authz/gatein/authz-plugin/trunk/client/src/test/resources/
authz/gatein/authz-plugin/trunk/client/src/test/resources/log4j.properties
Modified:
authz/gatein/authz-plugin/trunk/.classpath
authz/gatein/authz-plugin/trunk/pom.xml
Log:
Creating the Client Stack
Modified: authz/gatein/authz-plugin/trunk/.classpath
===================================================================
--- authz/gatein/authz-plugin/trunk/.classpath 2010-06-05 17:07:55 UTC (rev 1126)
+++ authz/gatein/authz-plugin/trunk/.classpath 2010-06-05 17:23:09 UTC (rev 1127)
@@ -2,6 +2,8 @@
<classpath>
<classpathentry kind="src" path="service/src/main/java"/>
<classpathentry kind="src" path="service/src/test/java"/>
+ <classpathentry kind="src" path="client/src/main/java"/>
+ <classpathentry kind="src" path="client/src/test/java"/>
<classpathentry kind="src" path="tools/src/main/java"/>
<classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con"
path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
Added: authz/gatein/authz-plugin/trunk/client/pom.xml
===================================================================
--- authz/gatein/authz-plugin/trunk/client/pom.xml (rev 0)
+++ authz/gatein/authz-plugin/trunk/client/pom.xml 2010-06-05 17:23:09 UTC (rev 1127)
@@ -0,0 +1,60 @@
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.gatein.authz</groupId>
+ <artifactId>gatein-authz-plugin</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.jboss.gatein.authz.client</groupId>
+ <artifactId>client</artifactId>
+ <name>client</name>
+ <packaging>jar</packaging>
+ <version>1.0-SNAPSHOT</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.gatein.authz.tools</groupId>
+ <artifactId>tools</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.commons</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.cache</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.command</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.container</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.ext.cache.impl.jboss.v3</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>1.5.6</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>picocontainer</groupId>
+ <artifactId>picocontainer</artifactId>
+ </dependency>
+
+ </dependencies>
+</project>
\ No newline at end of file
Added:
authz/gatein/authz-plugin/trunk/client/src/main/java/org/jboss/gatein/authz/client/SecurityClient.java
===================================================================
---
authz/gatein/authz-plugin/trunk/client/src/main/java/org/jboss/gatein/authz/client/SecurityClient.java
(rev 0)
+++
authz/gatein/authz-plugin/trunk/client/src/main/java/org/jboss/gatein/authz/client/SecurityClient.java 2010-06-05
17:23:09 UTC (rev 1127)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * 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.client;
+
+import java.net.URL;
+
+import org.exoplatform.container.PortalContainer;
+import org.jboss.gatein.authz.tools.ContainerBuilder;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public final class SecurityClient
+{
+ public SecurityClient()
+ {
+
+ }
+
+ public void start()
+ {
+ //TODO: log message using GateIn Logging Framework
+ URL rootURL =
getClass().getResource("/conf/gatein-authz-configuration.xml");
+ URL portalURL =
getClass().getResource("/conf/portal/gatein-authz-configuration.xml");
+ new ContainerBuilder().withRoot(rootURL).withPortal(portalURL).build();
+ }
+
+ public void stop()
+ {
+
+ }
+
+ public PortalContainer getContainer()
+ {
+ return PortalContainer.getInstance();
+ }
+}
Added:
authz/gatein/authz-plugin/trunk/client/src/main/resources/conf/gatein-authz-configuration.xml
===================================================================
---
authz/gatein/authz-plugin/trunk/client/src/main/resources/conf/gatein-authz-configuration.xml
(rev 0)
+++
authz/gatein/authz-plugin/trunk/client/src/main/resources/conf/gatein-authz-configuration.xml 2010-06-05
17:23:09 UTC (rev 1127)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS. 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.
+ -->
+<configuration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd
http://www.exoplaform.org/xml/ns/kernel_1_1.xsd"
+
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
+</configuration>
\ No newline at end of file
Added:
authz/gatein/authz-plugin/trunk/client/src/main/resources/conf/portal/gatein-authz-configuration.xml
===================================================================
---
authz/gatein/authz-plugin/trunk/client/src/main/resources/conf/portal/gatein-authz-configuration.xml
(rev 0)
+++
authz/gatein/authz-plugin/trunk/client/src/main/resources/conf/portal/gatein-authz-configuration.xml 2010-06-05
17:23:09 UTC (rev 1127)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS. 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.
+ -->
+<configuration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd
http://www.exoplaform.org/xml/ns/kernel_1_1.xsd"
+
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
+</configuration>
\ No newline at end of file
Added:
authz/gatein/authz-plugin/trunk/client/src/test/java/org/jboss/gatein/authz/client/TestClientBootstrap.java
===================================================================
---
authz/gatein/authz-plugin/trunk/client/src/test/java/org/jboss/gatein/authz/client/TestClientBootstrap.java
(rev 0)
+++
authz/gatein/authz-plugin/trunk/client/src/test/java/org/jboss/gatein/authz/client/TestClientBootstrap.java 2010-06-05
17:23:09 UTC (rev 1127)
@@ -0,0 +1,55 @@
+/******************************************************************************
+ * 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.client;
+
+import org.exoplatform.container.PortalContainer;
+import junit.framework.TestCase;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class TestClientBootstrap extends TestCase
+{
+ private SecurityClient securityClient;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ this.securityClient = new SecurityClient();
+ this.securityClient.start();
+ }
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ this.securityClient.stop();
+ }
+
+
+ public void testBootstrap() throws Exception
+ {
+ PortalContainer clientContainer = this.securityClient.getContainer();
+ assertNotNull(clientContainer);
+ }
+}
Added: authz/gatein/authz-plugin/trunk/client/src/test/resources/log4j.properties
===================================================================
--- authz/gatein/authz-plugin/trunk/client/src/test/resources/log4j.properties
(rev 0)
+++ authz/gatein/authz-plugin/trunk/client/src/test/resources/log4j.properties 2010-06-05
17:23:09 UTC (rev 1127)
@@ -0,0 +1,8 @@
+# Set root category priority to INFO and its only appender to CONSOLE.
+log4j.rootCategory=INFO, CONSOLE
+
+# CONSOLE is set to be a ConsoleAppender using a PatternLayout.
+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+log4j.appender.CONSOLE.Threshold=INFO
+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE.layout.ConversionPattern=- %m%n
Modified: authz/gatein/authz-plugin/trunk/pom.xml
===================================================================
--- authz/gatein/authz-plugin/trunk/pom.xml 2010-06-05 17:07:55 UTC (rev 1126)
+++ authz/gatein/authz-plugin/trunk/pom.xml 2010-06-05 17:23:09 UTC (rev 1127)
@@ -10,6 +10,7 @@
<modules>
<module>service</module>
+ <module>client</module>
<module>tools</module>
</modules>