JBoss Portal SVN: r12762 - in branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal: test/core/model/portal and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-02-01 10:16:39 -0500 (Sun, 01 Feb 2009)
New Revision: 12762
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectTestCase.java
Log:
- JBPORTAL-2281: Ported performance improvements to 2.6 branch
Modified: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java 2009-02-01 03:56:00 UTC (rev 12761)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java 2009-02-01 15:16:39 UTC (rev 12762)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, 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. *
@@ -20,8 +20,17 @@
* 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.impl.model.portal;
+import org.apache.log4j.Logger;
+import org.jboss.portal.common.NotYetImplemented;
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.core.model.portal.DuplicatePortalObjectException;
+import org.jboss.portal.core.model.portal.NoSuchPortalObjectException;
+import org.jboss.portal.core.model.portal.PortalObject;
+import org.jboss.portal.core.model.portal.PortalObjectId;
+
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -31,18 +40,11 @@
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;
+import java.util.SortedMap;
import java.util.SortedSet;
import java.util.TreeMap;
import java.util.TreeSet;
-import org.apache.log4j.Logger;
-import org.jboss.portal.common.NotYetImplemented;
-import org.jboss.portal.common.i18n.LocalizedString;
-import org.jboss.portal.core.model.portal.DuplicatePortalObjectException;
-import org.jboss.portal.core.model.portal.NoSuchPortalObjectException;
-import org.jboss.portal.core.model.portal.PortalObject;
-import org.jboss.portal.core.model.portal.PortalObjectId;
-
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision$
@@ -74,8 +76,6 @@
private ObjectNode objectNode;
// Runtime fields
-
- private Map childrenMap;
private Map properties;
private Map unmodifiableProperties;
private SortedSet accessedChildren;
@@ -91,7 +91,6 @@
this.listener = null;
//
- this.childrenMap = null;
this.properties = null;
this.unmodifiableProperties = null;
this.accessedChildren = null;
@@ -117,8 +116,6 @@
this.objectNode = objectNode;
}
- //
-
public PortalObjectId getId()
{
return objectNode.getPath();
@@ -140,13 +137,12 @@
{
return objectNode.getName();
}
-
+
public void setDisplayNames(Map displayNames)
{
this.displayNames = displayNames;
}
-
-
+
public Map getDisplayNames()
{
return displayNames;
@@ -160,7 +156,7 @@
}
displayNames = new HashMap();
-
+
Map map = displayName.getValues();
Iterator it = map.values().iterator();
while (it.hasNext())
@@ -169,7 +165,7 @@
displayNames.put(value.getLocale(), value.getString());
}
}
-
+
public LocalizedString getDisplayName()
{
if (displayNames != null)
@@ -202,13 +198,14 @@
private class ChildrenCollection implements Collection
{
-
/** . */
private final int mask;
+ private final SortedMap children;
- public ChildrenCollection(int mask)
+ public ChildrenCollection(int mask, Map children)
{
this.mask = mask;
+ this.children = new TreeMap(children);
}
public void clear()
@@ -253,30 +250,36 @@
public boolean isEmpty()
{
- return objectNode.getChildren().isEmpty();
+ return children.isEmpty();
}
public int size()
{
- if (mask == ALL_TYPES_MASK)
+ if (mask != ALL_TYPES_MASK)
{
- return objectNode.getChildren().size();
- }
- else
- {
int count = 0;
- for (Iterator i = iterator(); i.hasNext();)
+
+ for (Object object : children.values())
{
- i.next();
- count++;
+ ObjectNode childNode = (ObjectNode)object;
+ PortalObjectImpl childObject = childNode.getObject();
+ if (isMatchingMask(childObject, mask))
+ {
+ count++;
+ }
}
+
return count;
}
+ else
+ {
+ return children.size();
+ }
}
public Object[] toArray()
{
- return toArray(new Object[0]);
+ return toArray(new Object[size()]);
}
public Iterator iterator()
@@ -286,40 +289,39 @@
public Object[] toArray(Object a[])
{
- ArrayList tmp = new ArrayList(objectNode.getChildren().size());
-
- //
- Set accessedChildren = getAccessedChildren();
-
- //
- for (Iterator i = iterator(); i.hasNext();)
+ ArrayList tmp = new ArrayList(children.size());
+ for (Object child : this)
{
- PortalObject childObject = (PortalObject)i.next();
+ // no need to add to accessedChildren here as it's already done by ChildrenIterator.next()...
+ tmp.add(child);
+ }
- //
- accessedChildren.add(childObject);
+ return tmp.toArray(a);
+ }
- //
- tmp.add(childObject);
+ @Override
+ public String toString()
+ {
+ StringBuilder sb = new StringBuilder(512);
+ sb.append("[");
+ for (Object o : this)
+ {
+ sb.append(" ").append(o);
}
- return tmp.toArray(a);
+ sb.append(" ]");
+ return sb.toString();
}
private class ChildrenIterator implements Iterator
{
-
- /** . */
private final Iterator iterator;
- /** . */
private PortalObject nextChild = null;
public ChildrenIterator()
{
// Make sure the children are sorted for consistent ordering downstream
- Map childrenMap = new TreeMap(objectNode.getChildren());
- Collection children = childrenMap.values();
- iterator = children.iterator();
+ iterator = children.values().iterator();
}
public void remove()
@@ -335,7 +337,7 @@
{
ObjectNode childNode = (ObjectNode)iterator.next();
PortalObjectImpl childObject = childNode.getObject();
- if (mask == ALL_TYPES_MASK || (childObject.getMask() & mask) != 0)
+ if (isMatchingMask(childObject, mask))
{
nextChild = childObject;
}
@@ -368,32 +370,17 @@
}
}
+ private boolean isMatchingMask(PortalObjectImpl object, int mask)
+ {
+ return (mask == ALL_TYPES_MASK || (object.getMask() & mask) != 0);
+ }
+
public Collection getChildren(int wantedMask)
{
- /// Correct eventually the mask
+ // Correct eventually the mask
final int mask = wantedMask & ALL_TYPES_MASK;
- // Compute the lookup cache key
- Integer key = new Integer(mask);
-
- //
- Collection children = null;
- if (childrenMap == null)
- {
- childrenMap = new HashMap();
- }
- else
- {
- children = (Collection)childrenMap.get(key);
- }
-
- //
- if (children == null)
- {
- children = new ChildrenCollection(mask);
- childrenMap.put(key, children);
- }
- return children;
+ return new ChildrenCollection(mask, objectNode.getChildren());
}
public String getListener()
Modified: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java 2009-02-01 03:56:00 UTC (rev 12761)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java 2009-02-01 15:16:39 UTC (rev 12762)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, 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. *
@@ -20,6 +20,7 @@
* 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.test.core.model.portal;
import junit.framework.TestSuite;
@@ -130,7 +131,7 @@
duplicate = true;
}
assertTrue(duplicate);
-
+
TransactionAssert.commitTransaction();
}
@@ -144,9 +145,9 @@
n1.createPage("default");
TransactionAssert.commitTransaction();
-
+
boolean rollback = false;
-
+
TransactionAssert.beginTransaction();
try
{
@@ -361,11 +362,6 @@
TransactionAssert.commitTransaction();
}
- public void testPortalNode() throws Exception
- {
-
- }
-
public void testRecreate() throws Exception
{
PortalObjectId defaultId = PortalObjectId.parse("/default", PortalObjectPath.CANONICAL_FORMAT);
@@ -443,16 +439,6 @@
TransactionAssert.commitTransaction();
}
-// private void constructPortalObjects() throws Exception
-// {
-// Context root = container.getContext();
-// assertNotNull(root);
-// Portal portal = root.createPortal("default");
-// assertNotNull(portal);
-// Page page = portal.createPage("default");
-// assertNotNull(page);
-// }
-
private static class PortalObjectComparator implements Comparator
{
public int compare(Object o1, Object o2)
Modified: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectTestCase.java 2009-02-01 03:56:00 UTC (rev 12761)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectTestCase.java 2009-02-01 15:16:39 UTC (rev 12762)
@@ -147,7 +147,10 @@
}
}
- /*public void testPerformanceGetChildren() throws DuplicatePortalObjectException, NoSuchPortalObjectException
+ /*
+ // This is commented out because this test is meant to test performance and takes a long time
+ // TODO: Should be moved to a performance test suite
+ public void testPerformanceToArray() throws NoSuchPortalObjectException, DuplicatePortalObjectException
{
Portal portal;
Page page;
@@ -155,6 +158,41 @@
long time = System.currentTimeMillis();
TransactionAssert.beginTransaction();
root.destroyChild(p_1.getName());
+ portal = root.createPortal("portal");
+ page = portal.createPage("page");
+ int nbPages = 200;
+ int nbWindows = 100;
+ for(int j = 0; j < nbPages; j++)
+ {
+ page.createPage("page" + j);
+ }
+ for (int k = 0; k < nbWindows; k++)
+ {
+ page.createWindow("window" + k, ContentType.PORTLET, "foo" + k);
+ }
+ TransactionAssert.commitTransaction();
+ System.out.println("Creation time = " + (System.currentTimeMillis() - time));
+
+ time = System.currentTimeMillis();
+ for (int i = 0; i < 100000; i++)
+ {
+ assertEquals(nbWindows, page.getChildren(PortalObject.WINDOW_MASK).toArray().length);
+ assertEquals(nbPages, page.getChildren(PortalObject.PAGE_MASK).toArray().length);
+ }
+ System.out.println("Tests time = " + (System.currentTimeMillis() - time));
+ }*/
+
+ /*
+ // This is commented out because this test is meant to test performance and takes a long time
+ // TODO: Should be moved to a performance test suite
+ public void testPerformanceGetChildren() throws DuplicatePortalObjectException, NoSuchPortalObjectException
+ {
+ Portal portal;
+ Page page;
+
+ long time = System.currentTimeMillis();
+ TransactionAssert.beginTransaction();
+ root.destroyChild(p_1.getName());
int nbPortals = 5;
int nbPages = 20;
int nbWindows = 20;
@@ -199,4 +237,4 @@
}
System.out.println("Tests time = " + (System.currentTimeMillis() - time));
}*/
-}
+}
\ No newline at end of file
15 years, 3 months
JBoss Portal SVN: r12761 - in modules/authorization/trunk: policy-server and 6 other directories.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2009-01-31 22:56:00 -0500 (Sat, 31 Jan 2009)
New Revision: 12761
Added:
modules/authorization/trunk/policy-server/src/main/java/org/jboss/security/authz/policy/server/PolicyServer.java
modules/authorization/trunk/policy-server/src/main/java/org/jboss/security/authz/policy/server/decision/
modules/authorization/trunk/policy-server/src/main/java/org/jboss/security/authz/policy/server/decision/PolicyDecisionPoint.java
modules/authorization/trunk/policy-server/src/main/resources/META-INF/pdp-config.xml
modules/authorization/trunk/policy-server/src/test/java/org/jboss/security/authz/policy/server/TestPolicyServer.java
Removed:
modules/authorization/trunk/decision-point/
Modified:
modules/authorization/trunk/.classpath
modules/authorization/trunk/policy-server/pom.xml
modules/authorization/trunk/policy-server/src/main/java/org/jboss/security/authz/policy/server/plugin/EnterprisePolicyFinder.java
modules/authorization/trunk/policy-server/src/main/resources/META-INF/jboss-beans.xml
modules/authorization/trunk/policy-server/src/test/resources/pdp-config.xml
modules/authorization/trunk/pom.xml
Log:
starting Policy Server implementation
Modified: modules/authorization/trunk/.classpath
===================================================================
--- modules/authorization/trunk/.classpath 2009-01-31 23:58:05 UTC (rev 12760)
+++ modules/authorization/trunk/.classpath 2009-02-01 03:56:00 UTC (rev 12761)
@@ -7,11 +7,7 @@
<classpathentry kind="src" path="core-components/src/main/java"/>
<classpathentry kind="src" path="core-components/src/main/resources"/>
<classpathentry kind="src" path="core-components/src/test/java"/>
- <classpathentry kind="src" path="core-components/src/test/resources"/>
- <classpathentry kind="src" path="decision-point/src/main/java"/>
- <classpathentry kind="src" path="decision-point/src/main/resources"/>
- <classpathentry kind="src" path="decision-point/src/test/java"/>
- <classpathentry kind="src" path="decision-point/src/test/resources"/>
+ <classpathentry kind="src" path="core-components/src/test/resources"/>
<classpathentry kind="src" path="enforcement/src/main/java"/>
<classpathentry kind="src" path="enforcement/src/main/resources"/>
<classpathentry kind="src" path="enforcement/src/test/java"/>
Modified: modules/authorization/trunk/policy-server/pom.xml
===================================================================
--- modules/authorization/trunk/policy-server/pom.xml 2009-01-31 23:58:05 UTC (rev 12760)
+++ modules/authorization/trunk/policy-server/pom.xml 2009-02-01 03:56:00 UTC (rev 12761)
@@ -18,6 +18,11 @@
<groupId>org.jboss.security.authz</groupId>
<artifactId>jboss-authz-common</artifactId>
<version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.security.authz</groupId>
+ <artifactId>jboss-authz-enforcement</artifactId>
+ <version>${project.version}</version>
</dependency>
<!-- jboss xacml -->
@@ -50,7 +55,8 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>2.3.1</version>
<configuration>
- <includes>
+ <includes>
+ <include>**/TestPolicyServer.java</include>
</includes>
</configuration>
</plugin>
Added: modules/authorization/trunk/policy-server/src/main/java/org/jboss/security/authz/policy/server/PolicyServer.java
===================================================================
--- modules/authorization/trunk/policy-server/src/main/java/org/jboss/security/authz/policy/server/PolicyServer.java (rev 0)
+++ modules/authorization/trunk/policy-server/src/main/java/org/jboss/security/authz/policy/server/PolicyServer.java 2009-02-01 03:56:00 UTC (rev 12761)
@@ -0,0 +1,95 @@
+/*
+* 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.security.authz.policy.server;
+
+import java.io.File;
+
+import org.apache.log4j.Logger;
+
+import org.jboss.security.authz.policy.server.decision.PolicyDecisionPoint;
+
+import org.jboss.security.authz.enforcement.Request;
+import org.jboss.security.authz.enforcement.Response;
+
+/**
+ * The Central Policy Server
+ *
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ */
+public class PolicyServer
+{
+ private static Logger log = Logger.getLogger(PolicyServer.class);
+
+ private PolicyDecisionPoint policyDecisionPoint;
+
+ public PolicyServer()
+ {
+
+ }
+
+ public void start()
+ {
+ }
+
+ public void stop()
+ {
+ this.policyDecisionPoint = null;
+ }
+
+ public PolicyDecisionPoint getPolicyDecisionPoint()
+ {
+ return policyDecisionPoint;
+ }
+
+ public void setPolicyDecisionPoint(PolicyDecisionPoint policyDecisionPoint)
+ {
+ this.policyDecisionPoint = policyDecisionPoint;
+ }
+ //--------Decision making services--------------------------------------------------------------------------------------------------------------------------
+ /**
+ * Makes an Authorization Decision
+ *
+ * This method is used when the PolicyDecisionPoint runs in-memory with the Application from which the native Enforcement components issue Authorization requests
+ *
+ * @param request Authorization Request
+ * @return response which contains the Authorization Decision
+ */
+ public Response evaluate(Request request)
+ {
+ return this.policyDecisionPoint.evaluate(request);
+ }
+
+ /**
+ * Makes an Authorization Decision
+ *
+ * This method is used when the PolicyDecisionPoint is accessed over the network by sending it the appropriate request in XML format
+ * The XML format used is compliant with the XACML spec
+ *
+ * @param xml
+ * @return response in xml format confirming to the XACML spec
+ */
+ public String evaluate(String xml)
+ {
+ return this.policyDecisionPoint.evaluate(xml);
+ }
+ //------- Provisioning services-----------------------------------------------------------------------------------------------------------------------------
+}
Copied: modules/authorization/trunk/policy-server/src/main/java/org/jboss/security/authz/policy/server/decision/PolicyDecisionPoint.java (from rev 12759, modules/authorization/trunk/decision-point/src/main/java/org/jboss/security/authz/decision/PolicyDecisionPoint.java)
===================================================================
--- modules/authorization/trunk/policy-server/src/main/java/org/jboss/security/authz/policy/server/decision/PolicyDecisionPoint.java (rev 0)
+++ modules/authorization/trunk/policy-server/src/main/java/org/jboss/security/authz/policy/server/decision/PolicyDecisionPoint.java 2009-02-01 03:56:00 UTC (rev 12761)
@@ -0,0 +1,108 @@
+/*
+* 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.security.authz.policy.server.decision;
+
+import java.io.File;
+
+import org.apache.log4j.Logger;
+
+import org.jboss.security.authz.enforcement.Request;
+import org.jboss.security.authz.enforcement.Response;
+
+import org.jboss.security.xacml.sunxacml.ConfigurationStore;
+import org.jboss.security.xacml.sunxacml.PDP;
+
+/**
+ * This component processes all incoming Authorization requests and responds with a response
+ *
+ * This component receives requests from native application layer Policy Enforcement Points.
+ *
+ * This typically runs inside the Policy Server and is reachable over a network connection
+ *
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ */
+public class PolicyDecisionPoint
+{
+ private static Logger log = Logger.getLogger(PolicyDecisionPoint.class);
+
+ private PDP policyDecisionPoint;
+
+ public PolicyDecisionPoint()
+ {
+
+ }
+
+ public void start()
+ {
+ try
+ {
+ ConfigurationStore store = new ConfigurationStore(new File(Thread.currentThread().getContextClassLoader().
+ getResource("META-INF/pdp-config.xml").getFile()));
+ store.useDefaultFactories();
+
+ this.policyDecisionPoint = new PDP(store.getDefaultPDPConfig());
+
+ log.info("-------------------------------------------------------");
+ log.info("Policy Decision Point successfully started.....................");
+ log.info("-------------------------------------------------------");
+ }
+ catch(Exception e)
+ {
+ log.error(this, e);
+ throw new RuntimeException(e);
+ }
+ }
+
+ public void stop()
+ {
+ this.policyDecisionPoint = null;
+ }
+ //-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ /**
+ * Makes an Authorization Decision
+ *
+ * This method is used when the PolicyDecisionPoint runs in-memory with the Application from which the native Enforcement components issue Authorization requests
+ *
+ * @param request Authorization Request
+ * @return response which contains the Authorization Decision
+ */
+ public Response evaluate(Request request)
+ {
+ Response response = new Response();
+ return response;
+ }
+
+ /**
+ * Makes an Authorization Decision
+ *
+ * This method is used when the PolicyDecisionPoint is accessed over the network by sending it the appropriate request in XML format
+ * The XML format used is compliant with the XACML spec
+ *
+ * @param xml
+ * @return response in xml format confirming to the XACML spec
+ */
+ public String evaluate(String xml)
+ {
+ String responseXml = null;
+ return responseXml;
+ }
+}
Property changes on: modules/authorization/trunk/policy-server/src/main/java/org/jboss/security/authz/policy/server/decision/PolicyDecisionPoint.java
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: modules/authorization/trunk/policy-server/src/main/java/org/jboss/security/authz/policy/server/plugin/EnterprisePolicyFinder.java
===================================================================
--- modules/authorization/trunk/policy-server/src/main/java/org/jboss/security/authz/policy/server/plugin/EnterprisePolicyFinder.java 2009-01-31 23:58:05 UTC (rev 12760)
+++ modules/authorization/trunk/policy-server/src/main/java/org/jboss/security/authz/policy/server/plugin/EnterprisePolicyFinder.java 2009-02-01 03:56:00 UTC (rev 12761)
@@ -22,6 +22,7 @@
******************************************************************************/
package org.jboss.security.authz.policy.server.plugin;
+import org.jboss.security.xacml.sunxacml.finder.PolicyFinder;
import org.jboss.security.xacml.sunxacml.finder.PolicyFinderModule;
/**
@@ -37,7 +38,15 @@
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
*
*/
-public abstract class EnterprisePolicyFinder extends PolicyFinderModule
+public class EnterprisePolicyFinder extends PolicyFinderModule
{
+ public EnterprisePolicyFinder()
+ {
+
+ }
+ @Override
+ public void init(PolicyFinder finder)
+ {
+ }
}
\ No newline at end of file
Modified: modules/authorization/trunk/policy-server/src/main/resources/META-INF/jboss-beans.xml
===================================================================
--- modules/authorization/trunk/policy-server/src/main/resources/META-INF/jboss-beans.xml 2009-01-31 23:58:05 UTC (rev 12760)
+++ modules/authorization/trunk/policy-server/src/main/resources/META-INF/jboss-beans.xml 2009-02-01 03:56:00 UTC (rev 12761)
@@ -2,5 +2,13 @@
<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
- xmlns="urn:jboss:bean-deployer:2.0">
+ xmlns="urn:jboss:bean-deployer:2.0">
+ <bean name="/policy-server/PolicyServer" class="org.jboss.security.authz.policy.server.PolicyServer">
+ <property name="policyDecisionPoint">
+ <inject bean="/policy-server/PolicyDecisionPoint"/>
+ </property>
+ </bean>
+
+ <bean name="/policy-server/PolicyDecisionPoint" class="org.jboss.security.authz.policy.server.decision.PolicyDecisionPoint">
+ </bean>
</deployment>
\ No newline at end of file
Added: modules/authorization/trunk/policy-server/src/main/resources/META-INF/pdp-config.xml
===================================================================
--- modules/authorization/trunk/policy-server/src/main/resources/META-INF/pdp-config.xml (rev 0)
+++ modules/authorization/trunk/policy-server/src/main/resources/META-INF/pdp-config.xml 2009-02-01 03:56:00 UTC (rev 12761)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<config xmlns="http://sunxacml.sourceforge.net/schema/config-0.3"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ defaultPDP="pdp" defaultAttributeFactory="attr"
+ defaultCombiningAlgFactory="comb" defaultFunctionFactory="func">
+ <pdp name="pdp">
+ <attributeFinderModule class="org.jboss.security.xacml.sunxacml.finder.impl.CurrentEnvModule"/>
+ <attributeFinderModule class="org.jboss.security.xacml.sunxacml.finder.impl.SelectorModule"/>
+ <policyFinderModule class="org.jboss.security.authz.policy.server.plugin.EnterprisePolicyFinder">
+ </policyFinderModule>
+ </pdp>
+
+ <attributeFactory name="attr" useStandardDatatypes="true"/>
+
+ <combiningAlgFactory name="comb" useStandardAlgorithms="true">
+ <algorithm class="org.jboss.security.authz.policy.server.plugin.NoPermitMeansDeniedAlg"/>
+ </combiningAlgFactory>
+
+ <functionFactory name="func" useStandardFunctions="true">
+ <condition>
+ <function class="org.jboss.security.authz.policy.server.plugin.DroolsFunction"/>
+ </condition>
+ </functionFactory>
+</config>
Added: modules/authorization/trunk/policy-server/src/test/java/org/jboss/security/authz/policy/server/TestPolicyServer.java
===================================================================
--- modules/authorization/trunk/policy-server/src/test/java/org/jboss/security/authz/policy/server/TestPolicyServer.java (rev 0)
+++ modules/authorization/trunk/policy-server/src/test/java/org/jboss/security/authz/policy/server/TestPolicyServer.java 2009-02-01 03:56:00 UTC (rev 12761)
@@ -0,0 +1,45 @@
+/*
+* 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.security.authz.policy.server;
+
+import junit.framework.TestCase;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ */
+public class TestPolicyServer extends TestCase
+{
+ public void setUp() throws Exception
+ {
+ Server.bootstrap();
+ }
+
+ public void tearDown() throws Exception
+ {
+
+ }
+
+ public void test() throws Exception
+ {
+
+ }
+}
Modified: modules/authorization/trunk/policy-server/src/test/resources/pdp-config.xml
===================================================================
--- modules/authorization/trunk/policy-server/src/test/resources/pdp-config.xml 2009-01-31 23:58:05 UTC (rev 12760)
+++ modules/authorization/trunk/policy-server/src/test/resources/pdp-config.xml 2009-02-01 03:56:00 UTC (rev 12761)
@@ -2,8 +2,7 @@
<config xmlns="http://sunxacml.sourceforge.net/schema/config-0.3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
defaultPDP="pdp" defaultAttributeFactory="attr"
- defaultCombiningAlgFactory="comb" defaultFunctionFactory="func">
-
+ defaultCombiningAlgFactory="comb" defaultFunctionFactory="func">
<pdp name="pdp">
<attributeFinderModule class="org.jboss.security.xacml.sunxacml.finder.impl.CurrentEnvModule"/>
<attributeFinderModule class="org.jboss.security.xacml.sunxacml.finder.impl.SelectorModule"/>
Modified: modules/authorization/trunk/pom.xml
===================================================================
--- modules/authorization/trunk/pom.xml 2009-01-31 23:58:05 UTC (rev 12760)
+++ modules/authorization/trunk/pom.xml 2009-02-01 03:56:00 UTC (rev 12761)
@@ -11,8 +11,7 @@
<modules>
<module>common</module>
- <module>core-components</module>
- <module>decision-point</module>
+ <module>core-components</module>
<module>enforcement</module>
<module>provisioning</module>
<module>policy-server</module>
15 years, 3 months