Author: bdaw
Date: 2009-05-09 11:06:22 -0400 (Sat, 09 May 2009)
New Revision: 486
Added:
idm/trunk/idm-cache/src/main/java/org/jboss/identity/idm/impl/cache/
idm/trunk/idm-core/src/test/resources/organization-test-config.xml
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/cache/
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/cache/IdentityStoreCacheProvider.java
Removed:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/cache/IdentityStoreCacheSupport.java
Modified:
idm/trunk/assembly/sources.xml
idm/trunk/idm-cache/pom.xml
idm/trunk/idm-core/pom.xml
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/cache/JBossCacheAttributeStoreWrapper.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/cache/JBossCacheIdentityStoreWrapper.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/repository/AbstractIdentityStoreRepository.java
idm/trunk/idm-hibernate/pom.xml
idm/trunk/idm-ldap/pom.xml
idm/trunk/idm-testsuite/pom.xml
idm/trunk/idm-testsuite/src/test/resources/organization-test-config.xml
idm/trunk/idm-testsuite/src/test/resources/organization-test-jboss-unit-config.xml
idm/trunk/parent/pom.xml
Log:
detach the jboss cache dependency into separate module
(still a bit messy - need to have a clean cache SPI)
Modified: idm/trunk/assembly/sources.xml
===================================================================
--- idm/trunk/assembly/sources.xml 2009-05-09 11:10:49 UTC (rev 485)
+++ idm/trunk/assembly/sources.xml 2009-05-09 15:06:22 UTC (rev 486)
@@ -22,9 +22,26 @@
<directory>${basedir}/../idm-spi/src/main/java</directory>
<outputDirectory>/</outputDirectory>
</fileSet>
- <fileSet>
- <directory>${basedir}/../idm/src/main/java</directory>
+ <fileSet>
+ <directory>${basedir}/../idm-core/src/main/java</directory>
<outputDirectory>/</outputDirectory>
</fileSet>
+ <fileSet>
+ <directory>${basedir}/../idm-hibernate/src/main/java</directory>
+ <outputDirectory>/</outputDirectory>
+ </fileSet>
+ <fileSet>
+ <directory>${basedir}/../idm-ldap/src/main/java</directory>
+ <outputDirectory>/</outputDirectory>
+ </fileSet>
+ <fileSet>
+ <directory>${basedir}/../idm-cache/src/main/java</directory>
+ <outputDirectory>/</outputDirectory>
+ </fileSet>
+ <fileSet>
+ <directory>${basedir}/../idm-auth/src/main/java</directory>
+ <outputDirectory>/</outputDirectory>
+ </fileSet>
+
</fileSets>
</assembly>
Modified: idm/trunk/idm-cache/pom.xml
===================================================================
--- idm/trunk/idm-cache/pom.xml 2009-05-09 11:10:49 UTC (rev 485)
+++ idm/trunk/idm-cache/pom.xml 2009-05-09 15:06:22 UTC (rev 486)
@@ -64,101 +64,9 @@
</systemProperties>
</configuration>
</plugin>
- <!--<plugin>-->
- <!--<groupId>org.jboss.unit</groupId>-->
-
<!--<artifactId>jboss-unit-tooling-maven2</artifactId>-->
- <!--<executions>-->
- <!--<execution>-->
- <!--<phase>test</phase>-->
- <!--<goals>-->
- <!--<goal>execute</goal>-->
- <!--</goals>-->
- <!--</execution>-->
- <!--</executions>-->
- <!--<configuration>-->
- <!--<jpda>true</jpda>-->
- <!--<jpdaPort>5005</jpdaPort>-->
- <!--<jpdaSuspend>true</jpdaSuspend>-->
- <!--<failOnError>true</failOnError>-->
-
-
- <!--<testsuites>-->
- <!--<testsuite>-->
- <!--<config>jboss-unit.xml</config>-->
- <!--<parameters>-->
- <!--<parameter>-->
- <!--<name>dataSourceName</name>-->
- <!--<values>-->
- <!--<value>hsqldb</value>-->
- <!--<value>mysql5</value>-->
- <!--<value>mysql4</value>-->
-
<!--<value>postgresql8</value>-->
-
<!--<value>sqlserver</value>-->
- <!--<value>oracle9i</value>-->
-
<!--<value>oracle10g</value>-->
- <!--</values>-->
- <!--</parameter>-->
- <!--</parameters>-->
-
-
- <!--</testsuite>-->
- <!--</testsuites>-->
-
- <!--<reports>-->
- <!--<xml>idm/target/tests/reports/xml</xml>-->
-
<!--<html>idm/target/tests/reports/html</html>-->
- <!--</reports>-->
- <!--</configuration>-->
- <!--</plugin>-->
-
</plugins>
</build>
- <profiles>
- <profile>
- <id>provided-jdbc-driver</id>
- <dependencies>
- <dependency>
- <groupId>privided</groupId>
- <artifactId>jdbc-driver</artifactId>
- <version>NA</version>
- <scope>system</scope>
- <systemPath>${provided.jdbc.driver.path}</systemPath>
- </dependency>
- </dependencies>
- </profile>
- <profile>
- <id>provided-jdbc-driver2</id>
- <dependencies>
- <dependency>
- <groupId>privided</groupId>
- <artifactId>jdbc-driver2</artifactId>
- <version>NA</version>
- <scope>system</scope>
- <systemPath>${provided.jdbc.driver.path2}</systemPath>
- </dependency>
- </dependencies>
- </profile>
- <!--<profile>-->
- <!--<id>oracle-provided-jdbc-drivers</id>-->
- <!--<dependencies>-->
- <!--<dependency>-->
- <!--<groupId>oracle</groupId>-->
- <!--<artifactId>jdbc-driver1</artifactId>-->
- <!--<version>NA</version>-->
- <!--<scope>system</scope>-->
-
<!--<systemPath>${oracle.jdbc.driver1}</systemPath>-->
- <!--</dependency>-->
- <!--<dependency>-->
- <!--<groupId>oracle</groupId>-->
- <!--<artifactId>jdbc-driver2</artifactId>-->
- <!--<version>NA</version>-->
- <!--<scope>system</scope>-->
-
<!--<systemPath>${oracle.jdbc.driver1}</systemPath>-->
- <!--</dependency>-->
- <!--</dependencies>-->
- <!--</profile>-->
- </profiles>
</project>
Modified: idm/trunk/idm-core/pom.xml
===================================================================
--- idm/trunk/idm-core/pom.xml 2009-05-09 11:10:49 UTC (rev 485)
+++ idm/trunk/idm-core/pom.xml 2009-05-09 15:06:22 UTC (rev 486)
@@ -48,68 +48,13 @@
<artifactId>jaxb-impl</artifactId>
<version>2.1.8</version>
</dependency>
- <dependency>
- <groupId>javax.persistence</groupId>
- <artifactId>persistence-api</artifactId>
- <version>1.0</version>
- </dependency>
- <!-- hibernate -->
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
- <version>3.3.1.GA</version>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-annotations</artifactId>
- <version>3.4.0.GA</version>
- </dependency>
- <!--Javassist as Hibernate's bytecode provider-->
- <dependency>
- <groupId>javassist</groupId>
- <artifactId>javassist</artifactId>
- <version>3.4.GA</version>
- </dependency>
-
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-cglib-repack</artifactId>
- <version>2.1_3</version>
- </dependency>
-
-
- <!-- Hibernate logging set up -->
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>1.5.2</version>
- </dependency>
- <!--<dependency>-->
- <!--<groupId>log4j</groupId>-->
- <!--<artifactId>log4j</artifactId>-->
- <!--<version>1.2.14</version>-->
- <!--</dependency>-->
-
-
<dependency>
- <groupId>org.jboss.cache</groupId>
- <artifactId>jbosscache-core</artifactId>
- <version>3.0.2.GA</version>
- </dependency>
-
- <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>hsqldb</groupId>
- <artifactId>hsqldb</artifactId>
- <version>1.8.0.7</version>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>sun-opends</groupId>
<artifactId>OpenDS</artifactId>
<version>1.0.0</version>
@@ -122,91 +67,6 @@
<scope>test</scope>
</dependency>
- <!--JBoss Unit-->
-
- <dependency>
- <groupId>org.jboss.unit</groupId>
- <artifactId>jboss-unit</artifactId>
- <version>1.2.2</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.unit</groupId>
- <artifactId>portal-test</artifactId>
- <version>1.2.2</version>
-
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>hibernate</groupId>
- <artifactId>hibernate3</artifactId>
- </exclusion>
- <exclusion>
- <groupId>sun-opends</groupId>
- <artifactId>opends-core</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>jboss.jbossas.core-libs</groupId>
- <artifactId>jboss-local-jdbc</artifactId>
- <version>4.0.4.GA</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>jboss.jbossas.core-libs</groupId>
- <artifactId>jboss-common-jdbc-wrapper</artifactId>
- <version>4.0.4.GA</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-logging-spi</artifactId>
- <version>2.0.2.GA</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-logging-jdk</artifactId>
- <version>2.0.2.GA</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-logging-log4j</artifactId>
- <version>2.0.2.GA</version>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>apache-log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- <version>5.1.6</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>postgresql</groupId>
- <artifactId>postgresql</artifactId>
- <version>8.3-604.jdbc3</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>net.sourceforge.jtds</groupId>
- <artifactId>jtds</artifactId>
- <version>1.2.2</version>
- <scope>test</scope>
- </dependency>
-
-
-
-
</dependencies>
@@ -242,101 +102,9 @@
</execution>
</executions>
</plugin>
- <!--<plugin>-->
- <!--<groupId>org.jboss.unit</groupId>-->
-
<!--<artifactId>jboss-unit-tooling-maven2</artifactId>-->
- <!--<executions>-->
- <!--<execution>-->
- <!--<phase>test</phase>-->
- <!--<goals>-->
- <!--<goal>execute</goal>-->
- <!--</goals>-->
- <!--</execution>-->
- <!--</executions>-->
- <!--<configuration>-->
- <!--<jpda>true</jpda>-->
- <!--<jpdaPort>5005</jpdaPort>-->
- <!--<jpdaSuspend>true</jpdaSuspend>-->
-
- <!--<failOnError>true</failOnError>-->
-
-
- <!--<testsuites>-->
- <!--<testsuite>-->
- <!--<config>jboss-unit.xml</config>-->
- <!--<parameters>-->
- <!--<parameter>-->
- <!--<name>dataSourceName</name>-->
- <!--<values>-->
- <!--<value>hsqldb</value>-->
- <!--<value>mysql5</value>-->
- <!--<value>mysql4</value>-->
-
<!--<value>postgresql8</value>-->
-
<!--<value>sqlserver</value>-->
- <!--<value>oracle9i</value>-->
-
<!--<value>oracle10g</value>-->
- <!--</values>-->
- <!--</parameter>-->
- <!--</parameters>-->
-
-
- <!--</testsuite>-->
- <!--</testsuites>-->
-
- <!--<reports>-->
- <!--<xml>idm/target/tests/reports/xml</xml>-->
-
<!--<html>idm/target/tests/reports/html</html>-->
- <!--</reports>-->
- <!--</configuration>-->
- <!--</plugin>-->
-
</plugins>
</build>
- <profiles>
- <profile>
- <id>provided-jdbc-driver</id>
- <dependencies>
- <dependency>
- <groupId>privided</groupId>
- <artifactId>jdbc-driver</artifactId>
- <version>NA</version>
- <scope>system</scope>
- <systemPath>${provided.jdbc.driver.path}</systemPath>
- </dependency>
- </dependencies>
- </profile>
- <profile>
- <id>provided-jdbc-driver2</id>
- <dependencies>
- <dependency>
- <groupId>privided</groupId>
- <artifactId>jdbc-driver2</artifactId>
- <version>NA</version>
- <scope>system</scope>
- <systemPath>${provided.jdbc.driver.path2}</systemPath>
- </dependency>
- </dependencies>
- </profile>
- <!--<profile>-->
- <!--<id>oracle-provided-jdbc-drivers</id>-->
- <!--<dependencies>-->
- <!--<dependency>-->
- <!--<groupId>oracle</groupId>-->
- <!--<artifactId>jdbc-driver1</artifactId>-->
- <!--<version>NA</version>-->
- <!--<scope>system</scope>-->
-
<!--<systemPath>${oracle.jdbc.driver1}</systemPath>-->
- <!--</dependency>-->
- <!--<dependency>-->
- <!--<groupId>oracle</groupId>-->
- <!--<artifactId>jdbc-driver2</artifactId>-->
- <!--<version>NA</version>-->
- <!--<scope>system</scope>-->
-
<!--<systemPath>${oracle.jdbc.driver1}</systemPath>-->
- <!--</dependency>-->
- <!--</dependencies>-->
- <!--</profile>-->
- </profiles>
+
</project>
Deleted:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/cache/IdentityStoreCacheSupport.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/cache/IdentityStoreCacheSupport.java 2009-05-09
11:10:49 UTC (rev 485)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/cache/IdentityStoreCacheSupport.java 2009-05-09
15:06:22 UTC (rev 486)
@@ -1,912 +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.identity.idm.impl.cache;
-
-import org.jboss.cache.Fqn;
-import org.jboss.cache.Cache;
-import org.jboss.cache.Node;
-import org.jboss.identity.idm.spi.model.IdentityObject;
-import org.jboss.identity.idm.spi.model.IdentityObjectAttribute;
-import org.jboss.identity.idm.spi.model.IdentityObjectType;
-import org.jboss.identity.idm.spi.model.IdentityObjectRelationshipType;
-import org.jboss.identity.idm.spi.model.IdentityObjectRelationship;
-import org.jboss.identity.idm.spi.search.IdentityObjectSearchCriteria;
-
-import java.util.logging.Logger;
-import java.util.logging.Level;
-import java.util.Map;
-import java.util.Set;
-import java.util.Collection;
-
-/**
- * Helper class providing caching support for IdentityStore. Stores search methods
results using hash from a set of used
- * IdentityObjectSearchControl objects as a key. *
- *
- * TODO: update cache tree structure documentation to all used nodes/keys...
- * Cache structure:
- *
- * CACHE_ROOT (real)
- * |
- * |-JBID_ROOT_NODE
- * |
- * |-OBJECT_TYPES_NODE
- * | |
- * | |-OBJECT_TYPES_IDS_NODE
- * | | |
- * | | |- (IdentityObjectType names)
- * | | | key[NODE_OBJECT_KEY] -> IdentityObject
- * | | |- ...
- * | |
- * | |-OBJECT_TYPES_NAMES_NODE
- * | | |
- * | | |- (IdentityObjectType names)
- * | | | key[NODE_OBJECT_KEY] -> IdentityObject
- * | | | key[NODE_ATTRIBUTES_KEY] -> Map<String, IdentityObjectAttribute>
- * | | |- ...
- * | |
- * | |-OBJECT_TYPES_SEARCH_NODE
- * | |
- * | |
- * | |- ...
- * |
- * |-RELATIONSHIPS_NODE
- * |
-
- *
- * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
- * @version : 0.1 $
- */
-public abstract class IdentityStoreCacheSupport
-{
-
- //Structure
- public static final String JBID_ROOT_NODE = "/jboss_id_idm";
-
- public static final String OBJECT_TYPES_NODE = JBID_ROOT_NODE +
"/object_types";
-
- public static final String OBJECT_TYPES_IDS_NODE = OBJECT_TYPES_NODE +
"/by_ids";
-
- public static final String OBJECT_TYPES_NAMES_NODE = OBJECT_TYPES_NODE +
"/by_names";
-
- public static final String OBJECT_TYPES_SEARCH_BY_TYPE_NODE = OBJECT_TYPES_NODE +
"/search_by_type";
-
- public static final String OBJECT_TYPES_SEARCH_NODE = OBJECT_TYPES_NODE +
"/search";
-
- // Don't populate children as resident nodes!
- public static final String OBJECT_TYPES_COUNT_NODE = OBJECT_TYPES_NODE +
"/count";
-
- public static final String RELATIONSHIPS_SEARCH_NODE = JBID_ROOT_NODE +
"/relationship_types_names";
-
- public static final String RELATIONSHIPS_SEARCH_SIMPLE_NODE =
RELATIONSHIPS_SEARCH_NODE + "/simple";
-
- public static final String RELATIONSHIPS_SEARCH_COMPLEX_NODE =
RELATIONSHIPS_SEARCH_NODE + "/complex";
-
- public static final String RELATIONSHIP_NAMES_SEARCH_NODE = JBID_ROOT_NODE +
"/relationship_names_search";
-
- public static final String RELATIONSHIP_NAMES_SEARCH_IO_NODE =
RELATIONSHIP_NAMES_SEARCH_NODE + "/identity_object";
-
- public static final String RELATIONSHIP_NAMES_SEARCH_ALL_NODE =
RELATIONSHIP_NAMES_SEARCH_NODE + "/all";
-
- // Node keys
-
- public static final String NODE_OBJECT_KEY = "object";
-
- public static final String NODE_ATTRIBUTES_KEY = "attributes";
-
- public static final String NODE_REL_NAME_KEY = "relationship_name";
-
- public static final String NODE_REL_TYPE_KEY = "relationship_type";
-
- public static final String NODE_REL_FROM_KEY = "relationship_from";
-
- public static final String NODE_REL_TO_KEY = "relationship_to";
-
- public static final String NODE_SEARCH_RESULTS_KEY = "search_results";
-
-
- // FQNs
-
- public static final Fqn FQN_OBJECT_TYPES = Fqn.fromString(OBJECT_TYPES_NODE);
-
- public static final Fqn FQN_OBJECT_TYPES_NAMES =
Fqn.fromString(OBJECT_TYPES_NAMES_NODE);
-
- public static final Fqn FQN_OBJECT_TYPES_IDS = Fqn.fromString(OBJECT_TYPES_IDS_NODE);
-
- public static final Fqn FQN_OBJECT_TYPES_SEARCH_BY_TYPE =
Fqn.fromString(OBJECT_TYPES_SEARCH_BY_TYPE_NODE);
-
- public static final Fqn FQN_OBJECT_TYPES_SEARCH =
Fqn.fromString(OBJECT_TYPES_SEARCH_NODE);
-
- public static final Fqn FQN_OBJECT_TYPES_COUNT =
Fqn.fromString(OBJECT_TYPES_COUNT_NODE);
-
- public static final Fqn FQN_RELATIONSHIPS =
Fqn.fromString(RELATIONSHIPS_SEARCH_NODE);
-
- public static final Fqn FQN_RELATIONSHIPS_COMPLEX =
Fqn.fromString(RELATIONSHIPS_SEARCH_COMPLEX_NODE);
-
- public static final Fqn FQN_RELATIONSHIPS_SIMPLE =
Fqn.fromString(RELATIONSHIPS_SEARCH_SIMPLE_NODE);
-
-
- private Fqn createIONameNodeFQN(String ioTypeName, String ioName)
- {
- return Fqn.fromElements(OBJECT_TYPES_NAMES_NODE, ioTypeName, ioName);
- }
-
- private Fqn createIONameNodeFQN(IdentityObject io)
- {
- return Fqn.fromElements(OBJECT_TYPES_NAMES_NODE, io.getIdentityType().getName(),
io.getName());
- }
-
- private Fqn createIOIdNodeFQN(IdentityObject io)
- {
- return Fqn.fromElements(OBJECT_TYPES_IDS_NODE, io.getIdentityType().getName(),
io.getId());
- }
-
- private Fqn createIOTypeCountNodeFQN(IdentityObjectType iot)
- {
- return Fqn.fromElements(OBJECT_TYPES_COUNT_NODE, iot.getName());
- }
-
- private Fqn createIOTypeSearchNodeFQN(IdentityObjectType iot, Object searchId)
- {
- return Fqn.fromElements(OBJECT_TYPES_SEARCH_BY_TYPE_NODE, iot.getName(),
searchId);
- }
-
- private Fqn createIOSearchNodeFQN(IdentityObject io, IdentityObjectRelationshipType
relationshipType, boolean parent, Object searchId)
- {
- return Fqn.fromElements(OBJECT_TYPES_SEARCH_NODE, io.getIdentityType().getName(),
relationshipType == null ? "null" : relationshipType.getName(),
- io.getName() + "_" + parent, searchId);
- }
-
- private Fqn createRelationshipNamesIdentityObjectSearchFqn(IdentityObject
identityObject, Object searchId)
- {
- return Fqn.fromElements(RELATIONSHIP_NAMES_SEARCH_IO_NODE,
identityObject.getIdentityType() + "_" + identityObject.getName(),
- searchId);
- }
-
- private Fqn createRelationshipNamesAllSearchFqn(Object searchId)
- {
- return Fqn.fromElements(RELATIONSHIP_NAMES_SEARCH_ALL_NODE, searchId);
- }
-
- private Fqn createRelationshipsSimpleSearchFqn(IdentityObject fromIdentity,
- IdentityObject toIdentity,
- IdentityObjectRelationshipType
relationshipType)
- {
- //TODO: fixme - null relationshipType
- return Fqn.fromElements(RELATIONSHIPS_SEARCH_SIMPLE_NODE,
fromIdentity.getIdentityType().getName() + "_" + toIdentity.getName(),
- toIdentity.getIdentityType().getName() + "_" + toIdentity.getName(),
relationshipType == null ? "null" : relationshipType );
- }
-
- private Fqn createRelationshipsComplexSearchFqn(IdentityObject identity,
- IdentityObjectRelationshipType
relationshipType,
- boolean parent,
- boolean named,
- String name)
- {
- return Fqn.fromElements(RELATIONSHIPS_SEARCH_COMPLEX_NODE,
identity.getIdentityType().getName() + "_" + identity.getName(),
- parent, relationshipType, named + "_" + name);
- }
-
- public static boolean isSchemaFqn(Fqn fqn)
- {
- if (fqn.equals(JBID_ROOT_NODE) ||
- fqn.equals(OBJECT_TYPES_NODE) ||
- fqn.equals(OBJECT_TYPES_IDS_NODE) ||
- fqn.equals(OBJECT_TYPES_NAMES_NODE) ||
- fqn.equals(RELATIONSHIPS_SEARCH_NODE))
- {
- return true;
- }
- return false;
- }
-
- public static boolean isFqnObjectTypeChild(Fqn fqn)
- {
- return fqn.isChildOf(FQN_OBJECT_TYPES);
- }
-
- public static boolean isFqnObjectTypeIdsChild(Fqn fqn)
- {
- return fqn.isChildOf(FQN_OBJECT_TYPES_IDS);
- }
-
- public static boolean isFqnObjectTypeNamesChild(Fqn fqn)
- {
- return fqn.isChildOf(FQN_OBJECT_TYPES_NAMES);
- }
-
- public static boolean isFqnObjectTypeSearchChild(Fqn fqn)
- {
- return fqn.isChildOf(FQN_OBJECT_TYPES_SEARCH_BY_TYPE);
- }
-
- public static boolean isFqnRelationshipsChild(Fqn fqn)
- {
- return fqn.isChildOf(FQN_RELATIONSHIPS);
- }
-
-
- private void removeNodeChildren(String path)
- {
- Fqn fqn = Fqn.fromString(path);
- Node node = getCache().getRoot().getChild(fqn);
-
- if (node != null)
- {
- Set<Object> names = node.getChildrenNames();
- for (Object name : names)
- {
- node.removeChild(name);
- }
- }
- }
-
- protected abstract Logger getLog();
-
- protected abstract Cache getCache();
-
- protected void initResidentNodes(Set<String> supportedIdentityObjectTypes,
- Set<String> supportedRelationshipTypes)
- {
-
getCache().getRoot().addChild(Fqn.fromString(IdentityStoreCacheSupport.JBID_ROOT_NODE)).setResident(true);
-
getCache().getRoot().addChild(Fqn.fromString(IdentityStoreCacheSupport.OBJECT_TYPES_NODE)).setResident(true);
- getCache().getRoot().addChild(FQN_OBJECT_TYPES_IDS).setResident(true);
- getCache().getRoot().addChild(FQN_OBJECT_TYPES_NAMES).setResident(true);
- getCache().getRoot().addChild(FQN_OBJECT_TYPES_SEARCH).setResident(true);
- getCache().getRoot().addChild(FQN_OBJECT_TYPES_SEARCH_BY_TYPE).setResident(true);
- getCache().getRoot().addChild(FQN_OBJECT_TYPES_COUNT).setResident(true);
-
getCache().getRoot().addChild(Fqn.fromString(RELATIONSHIP_NAMES_SEARCH_ALL_NODE)).setResident(true);
-
getCache().getRoot().addChild(Fqn.fromString(RELATIONSHIP_NAMES_SEARCH_IO_NODE)).setResident(true);
-
getCache().getRoot().addChild(Fqn.fromString(RELATIONSHIPS_SEARCH_COMPLEX_NODE)).setResident(true);
-
getCache().getRoot().addChild(Fqn.fromString(RELATIONSHIPS_SEARCH_SIMPLE_NODE)).setResident(true);
-
- for (String objectTypeName : supportedIdentityObjectTypes)
- {
- Fqn nodeFqn = Fqn.fromRelativeElements(FQN_OBJECT_TYPES_NAMES, "/" +
objectTypeName);
- getCache().getRoot().addChild(nodeFqn).setResident(true);
-
- nodeFqn = Fqn.fromRelativeElements(FQN_OBJECT_TYPES_IDS, "/" +
objectTypeName);
- getCache().getRoot().addChild(nodeFqn).setResident(true);
- }
- }
-
- protected void putIntoCache(IdentityObject io)
- {
- Fqn nodeFqn = createIONameNodeFQN(io);
-
- Node ioNode = getCache().getRoot().addChild(nodeFqn);
-
- // in case this node was already present in cache
- if (!ioNode.getKeys().contains(NODE_OBJECT_KEY))
- {
- ioNode.put(NODE_OBJECT_KEY, io);
- }
-
- nodeFqn = createIOIdNodeFQN(io);
-
- ioNode = getCache().getRoot().addChild(nodeFqn);
-
- // in case this node was already present in cache
- if (!ioNode.getKeys().contains(NODE_OBJECT_KEY))
- {
- ioNode.put(NODE_OBJECT_KEY, io);
- }
-
- if (getLog().isLoggable(Level.FINER))
- {
- getLog().finer(this.toString() + "IdentityObject stored in cache: " +
io.getName() + "; " + io.getId());
- }
- }
-
- protected void putIntoCache(IdentityObject io, Map<String,
IdentityObjectAttribute> attributesMap)
- {
- Fqn nodeFqn = createIONameNodeFQN(io);
-
- Node ioNode = getCache().getRoot().addChild(nodeFqn);
-
- // in case this node was already present in cache
- if (!ioNode.getKeys().contains(NODE_OBJECT_KEY))
- {
- ioNode.put(NODE_OBJECT_KEY, io);
- }
-
- if (!ioNode.getKeys().contains(NODE_ATTRIBUTES_KEY))
- {
- ioNode.put(NODE_ATTRIBUTES_KEY, attributesMap);
- }
-
- nodeFqn = createIOIdNodeFQN(io);
-
- ioNode = getCache().getRoot().addChild(nodeFqn);
-
- // in case this node was already present in cache
- if (!ioNode.getKeys().contains(NODE_OBJECT_KEY))
- {
- ioNode.put(NODE_OBJECT_KEY, io);
- }
-
- if (getLog().isLoggable(Level.FINER))
- {
- getLog().finer(this.toString() + "IdentityObject stored in cache with
attributes map: " + io.getName() + "; " + io.getId()
- + "; type=" + io.getIdentityType().getName() );
- }
- }
-
- protected void removeFromCache(IdentityObject io)
- {
- Fqn nodeFqn = createIONameNodeFQN(io);
-
- getCache().getRoot().removeChild(nodeFqn);
-
- nodeFqn = createIOIdNodeFQN(io);
-
- getCache().getRoot().removeChild(nodeFqn);
-
- if (getLog().isLoggable(Level.FINER))
- {
- getLog().finer(this.toString() + "IdentityObject removed from cache: "
+ io.getName() + "; " + io.getId()
- + "; type=" + io.getIdentityType().getName() );
- }
- }
-
- protected void removeAttributesFromCache(IdentityObject io)
- {
- Fqn nodeFqn = createIONameNodeFQN(io);
-
- Node ioNode = getCache().getRoot().addChild(nodeFqn);
-
- ioNode.remove(NODE_ATTRIBUTES_KEY);
-
- if (getLog().isLoggable(Level.FINER))
- {
- getLog().finer(this.toString() + "IdentityObject attributes removed from
cache: name=" + io.getName() + "; id=" + io.getId()
- + "; type=" + io.getIdentityType().getName() );
- }
- }
-
- protected IdentityObject getFromCache(String name, IdentityObjectType
identityObjectType)
- {
- Fqn nodeFqn = Fqn.fromElements(OBJECT_TYPES_NODE, identityObjectType.getName(),
name);
-
- Node ioNode = getCache().getRoot().getChild(nodeFqn);
-
- if (ioNode != null)
- {
- IdentityObject io = (IdentityObject)ioNode.get(NODE_OBJECT_KEY);
-
- if (getLog().isLoggable(Level.FINER))
- {
- getLog().finer(this.toString() + "IdentityObject found in cache:
name=" + io.getName() + "; id=" + io.getId());
- }
-
- return io;
- }
-
- return null;
-
- }
-
- protected Map<String, IdentityObjectAttribute> getAttributesFromCache(String
name, IdentityObjectType identityObjectType)
- {
- Fqn nodeFqn = Fqn.fromElements(OBJECT_TYPES_NODE, identityObjectType.getName(),
name);
-
- Node ioNode = getCache().getRoot().getChild(nodeFqn);
-
- if (ioNode != null)
- {
- Map<String, IdentityObjectAttribute> attrs = (Map<String,
IdentityObjectAttribute>)ioNode.get(NODE_ATTRIBUTES_KEY);
-
- if (attrs != null)
- {
- if (getLog().isLoggable(Level.FINER))
- {
- getLog().finer(this.toString() + "IdentityObject attributes found in
cache: name=" + name + "; type=" + identityObjectType.getName());
- }
- }
- return attrs;
- }
-
- return null;
-
- }
-
- protected IdentityObject getFromCache(String id)
- {
- Node idsNode = getCache().getRoot().getChild(OBJECT_TYPES_IDS_NODE);
-
- for (Node typeNode : (Set<Node>)idsNode.getChildren())
- {
- for (Object name : typeNode.getChildrenNames())
- {
- if (name.toString().equals(id))
- {
- IdentityObject io =
(IdentityObject)typeNode.getChild(name).get(NODE_OBJECT_KEY);
-
- if (getLog().isLoggable(Level.FINER))
- {
- getLog().finer(this.toString() + "IdentityObject found in cache:
name" + io.getName() + "; type" + io.getIdentityType().getName());
- }
-
- return io;
- }
- }
- }
-
- return null;
-
- }
-
- protected void putIdentityObjectSearchIntoCache(IdentityObjectType identityType,
- IdentityObjectSearchCriteria criteria,
- Collection<IdentityObject>
results)
- {
- Fqn nodeFqn = createIOTypeSearchNodeFQN(identityType, getControlsHash(criteria));
-
- Node searchNode = getCache().getRoot().addChild(nodeFqn);
-
- searchNode.put(NODE_SEARCH_RESULTS_KEY, results);
-
- if (getLog().isLoggable(Level.FINER))
- {
- getLog().finer(this.toString() + "IdentityObject search results stored in
cache: type" + identityType.getName());
- }
- }
-
- protected Collection<IdentityObject>
getIdentityObjectSearchFromCache(IdentityObjectType identityType,
-
IdentityObjectSearchCriteria criteria)
- {
- Fqn nodeFqn = createIOTypeSearchNodeFQN(identityType, getControlsHash(criteria));
-
- Node searchNode = getCache().getRoot().getChild(nodeFqn);
-
- Collection<IdentityObject> results = null;
-
- if (searchNode != null)
- {
-
-
- results =
(Collection<IdentityObject>)searchNode.get(NODE_SEARCH_RESULTS_KEY);
-
- if (results != null && getLog().isLoggable(Level.FINER))
- {
- getLog().finer(this.toString() + "IdentityObject search results found in
cache: type" + identityType.getName());
- }
- }
-
- return results;
-
- }
-
- protected void putIdentityObjectSearchToCache(IdentityObject identity,
- IdentityObjectRelationshipType
relationshipType,
- boolean parent,
- IdentityObjectSearchCriteria criteria,
- Collection<IdentityObject> results)
- {
-
- Fqn nodeFqn = createIOSearchNodeFQN(identity, relationshipType, parent,
getControlsHash(criteria));
-
- Node searchNode = getCache().getRoot().addChild(nodeFqn);
-
- searchNode.put(NODE_SEARCH_RESULTS_KEY, results);
-
- if (getLog().isLoggable(Level.FINER))
- {
- getLog().finer(this.toString() + "IdentityObject search results stored in
cache: IdentityObject name= " + identity.getName()
- + "; IdentityObject type= " + identity.getIdentityType().getName()
+ "; IdentityObjectRelationshipType= " + relationshipType +
- "; parent= " + parent);
- }
-
- }
-
- protected Collection<IdentityObject>
getIdentityObjectSearchFromCache(IdentityObject identity,
-
IdentityObjectRelationshipType relationshipType,
- boolean parent,
-
IdentityObjectSearchCriteria criteria)
- {
-
- Fqn nodeFqn = createIOSearchNodeFQN(identity, relationshipType, parent,
getControlsHash(criteria));
-
- Node searchNode = getCache().getRoot().getChild(nodeFqn);
-
- Collection<IdentityObject> results = null;
-
- if (searchNode != null)
- {
- results =
(Collection<IdentityObject>)searchNode.get(NODE_SEARCH_RESULTS_KEY);
-
- if (results != null && getLog().isLoggable(Level.FINER))
- {
- getLog().finer(this.toString() + "IdentityObject search results found in
cache: IdentityObject name= " + identity.getName()
- + "; IdentityObject type= " +
identity.getIdentityType().getName() + "; IdentityObjectRelationshipType= " +
relationshipType +
- "; parent= " + parent);
- }
- }
-
- return results;
-
- }
-
- protected void putRelationshipsSearchIntoCache(IdentityObject fromIdentity,
- IdentityObject toIdentity,
- IdentityObjectRelationshipType
relationshipType,
- Set<IdentityObjectRelationship>
results)
- {
-
- Fqn fqn = createRelationshipsSimpleSearchFqn(fromIdentity, toIdentity,
relationshipType);
- Node node = getCache().getRoot().addChild(fqn);
-
- node.put(NODE_SEARCH_RESULTS_KEY, results);
-
- if (getLog().isLoggable(Level.FINER))
- {
- getLog().finer(this.toString() + "IdentityObjectRelationship search stored
in cache: fromIdentity" +
- fromIdentity.toString() + "; toIdentity=" + toIdentity.toString() +
- "; relationshipType=" + relationshipType.getName() ) ;
- }
-
- }
-
-
-
- protected Set<IdentityObjectRelationship>
getRelationshipsSearchFromCache(IdentityObject fromIdentity,
- IdentityObject
toIdentity,
-
IdentityObjectRelationshipType relationshipType)
- {
- Fqn fqn = createRelationshipsSimpleSearchFqn(fromIdentity, toIdentity,
relationshipType);
- Node node = getCache().getRoot().getChild(fqn);
-
- if (node != null)
- {
- if (node.getKeys().contains(NODE_SEARCH_RESULTS_KEY) &&
getLog().isLoggable(Level.FINER))
- {
- getLog().finer(this.toString() + "IdentityObjectRelationship search
found in cache: fromIdentity" +
- fromIdentity.toString() + "; toIdentity=" +
toIdentity.toString() +
- "; relationshipType=" + relationshipType.getName() ) ;
- }
-
- return
(Set<IdentityObjectRelationship>)node.get(NODE_SEARCH_RESULTS_KEY);
- }
- return null;
- }
-
- protected void putRelationshipSearchIntoCache(IdentityObject identity,
- IdentityObjectRelationshipType
relationshipType,
- boolean parent,
- boolean named,
- String name,
- Set<IdentityObjectRelationship>
results)
- {
- Fqn fqn = createRelationshipsComplexSearchFqn(identity, relationshipType, parent,
named, name);
- Node node = getCache().getRoot().addChild(fqn);
-
- node.put(NODE_SEARCH_RESULTS_KEY, results);
-
- if (getLog().isLoggable(Level.FINER))
- {
- getLog().finer(this.toString() + "IdentityObjectRelationship search stored
in cache: " +
- "identity" + identity.toString() +
- "; relationshipType=" + relationshipType.getName() +
- "; parent=" + parent +
- "; named=" + named +
- "; name=" + name) ;
- }
-
- }
-
-
-
- protected Set<IdentityObjectRelationship>
getRelationshipsSearchFromCache(IdentityObject identity,
-
IdentityObjectRelationshipType relationshipType,
- boolean
parent,
- boolean
named,
- String name)
- {
- Fqn fqn = createRelationshipsComplexSearchFqn(identity, relationshipType, parent,
named, name);
- Node node = getCache().getRoot().getChild(fqn);
-
- Set<IdentityObjectRelationship> results = null;
-
- if (node != null)
- {
- results =
(Set<IdentityObjectRelationship>)node.get(NODE_SEARCH_RESULTS_KEY);
-
- if (results != null && getLog().isLoggable(Level.FINER))
- {
- getLog().finer(this.toString() + "IdentityObjectRelationship search
found in cache: " +
- "identity" + identity.toString() +
- "; relationshipType=" + relationshipType.getName() +
- "; parent=" + parent +
- "; named=" + named +
- "; name=" + name) ;
- }
- }
- return results;
-
- }
-
- protected void invalidateCachedIdentityObjectSearches(IdentityObject io)
- {
-
- Fqn fqn = Fqn.fromElements(OBJECT_TYPES_SEARCH_BY_TYPE_NODE,
io.getIdentityType().getName());
- getCache().getRoot().removeChild(fqn);
-
- // It can be in any result in the type searches
- removeNodeChildren(OBJECT_TYPES_SEARCH_NODE);
-
- if (getLog().isLoggable(Level.FINER))
- {
- getLog().finer(this.toString() + "IdentityObject searches invalidated in
cache: identityObject=" + io.toString());
- }
- }
-
- protected void putIdentityObjectCountIntoCache(IdentityObjectType identityType, int
count)
- {
- Fqn fqn = createIOTypeCountNodeFQN(identityType);
- Node node = getCache().getRoot().addChild(fqn);
-
- node.put(NODE_OBJECT_KEY, count);
-
- if (getLog().isLoggable(Level.FINER))
- {
- getLog().finer(this.toString() + "IdentityObjectType count search strored
in cache: " +
- "identityObjectType=" + identityType.getName() +
- "; count=" + count);
- }
-
- }
-
- protected int getIdentityObjectCountFromCache(IdentityObjectType identityType)
- {
- Fqn fqn = createIOTypeCountNodeFQN(identityType);
- Node node = getCache().getRoot().getChild(fqn);
-
-
- if (node != null && node.getKeys().contains(NODE_OBJECT_KEY))
- {
- int count = (Integer)(node.get(NODE_OBJECT_KEY));
-
- if (getLog().isLoggable(Level.FINER))
- {
- getLog().finer(this.toString() + "IdentityObjectType count search result
found in cache: " +
- "identityObjectType=" + identityType.getName() +
- "; count=" + count);
- }
-
- return count;
-
- }
- // -1 means nothing in cache
- return -1;
- }
-
-
- protected void invalidateCachedIdentityObjectCount(IdentityObjectType identityType)
- {
- Fqn fqn = createIOTypeCountNodeFQN(identityType);
- Node node = getCache().getRoot().addChild(fqn);
-
- node.remove(NODE_OBJECT_KEY);
-
- if (getLog().isLoggable(Level.FINER))
- {
- getLog().finer(this.toString() + "IdentityObjectType count search result
invalidated in cache: " +
- "identityObjectType=" + identityType.getName());
- }
- }
-
- protected void invalidateCachedRelationshipSearches(IdentityObject fromIdentity,
- IdentityObject toIdentity,
- IdentityObjectRelationshipType
relationshipType,
- String relationshipName)
- {
- String fromName = fromIdentity.getIdentityType().getName() + "_" +
fromIdentity.getName();
- String toName = toIdentity.getIdentityType().getName() + "_" +
toIdentity.getName();
-
- // Simple
-
-// Fqn fqn = Fqn.fromElements(RELATIONSHIPS_SEARCH_SIMPLE_NODE, fromName, toName,
relationshipType.getName());
-// getCache().getRoot().removeChild(fqn);
-
- Fqn fqn = createRelationshipsSimpleSearchFqn(fromIdentity, toIdentity,
relationshipType);
- getCache().getRoot().removeChild(fqn);
-
- // Complex
-
- String relNameElement;
- if (relationshipName != null)
- {
- relNameElement = true + relationshipName;
- }
- else
- {
- relNameElement = false + relationshipName;
- }
-
-
- fqn = Fqn.fromElements(RELATIONSHIPS_SEARCH_COMPLEX_NODE, fromName, true,
relationshipType.getName(), relNameElement);
- getCache().getRoot().removeChild(fqn);
- fqn = Fqn.fromElements(RELATIONSHIPS_SEARCH_COMPLEX_NODE, toName, false,
relationshipType.getName(), relNameElement);
- getCache().getRoot().removeChild(fqn);
-
- if (getLog().isLoggable(Level.FINER))
- {
- getLog().finer(this.toString() + "IdentityObjectRelationship search result
invalidated in cache: fromIdentity" +
- fromIdentity.toString() + "; toIdentity=" + toIdentity.toString()
+
- "; relationshipType=" + relationshipType.getName() ) ;
- }
-
- }
-
- protected void invalidateCachedRelationshipSearches(IdentityObject identity1,
IdentityObject identity2, boolean named)
- {
-
- String name1 = identity1.getIdentityType().getName() + "_" +
identity1.getName();
- String name2 = identity2.getIdentityType().getName() + "_" +
identity2.getName();
-
-
- // Complex search
-
- Fqn fqn = Fqn.fromElements(RELATIONSHIPS_SEARCH_COMPLEX_NODE, name1);
- getCache().getRoot().removeChild(fqn);
- fqn = Fqn.fromElements(RELATIONSHIPS_SEARCH_COMPLEX_NODE, name2);
- getCache().getRoot().removeChild(fqn);
-
- // Simple search
-
- getCache().getRoot().removeChild(Fqn.fromElements(RELATIONSHIPS_SEARCH_SIMPLE_NODE,
name1));
- getCache().getRoot().removeChild(Fqn.fromElements(RELATIONSHIPS_SEARCH_SIMPLE_NODE,
name2));
-
- fqn = Fqn.fromElements(RELATIONSHIPS_SEARCH_SIMPLE_NODE);
- Set<String> names = getCache().getRoot().getChildrenNames();
-
- for (String childName : names)
- {
- //
- getCache().getRoot().removeChild(Fqn.fromElements(fqn, childName, name1));
- getCache().getRoot().removeChild(Fqn.fromElements(fqn, childName, name2));
- }
-
- if (getLog().isLoggable(Level.FINER))
- {
- getLog().finer(this.toString() + "IdentityObjectRelationship search result
invalidated in cache for: identity1" +
- identity1.toString() + "; identity2=" + identity2.toString() +
- "; named=" + named ) ;
- }
-
- }
-
- protected void invalidateRelationshipNameSearches(String name)
- {
- //TODO: at the moment it just trash up all relationships searches
-
- removeNodeChildren(RELATIONSHIP_NAMES_SEARCH_ALL_NODE);
- removeNodeChildren(RELATIONSHIP_NAMES_SEARCH_IO_NODE);
-
- if (getLog().isLoggable(Level.FINER))
- {
- getLog().finer(this.toString() + "IdentityObjectRelationshipName search
results invalidated in cache: name" +
- name ) ;
- }
- }
-
-
-
- protected void putRelationshipNamesSearchIntoCache(IdentityObjectSearchCriteria
criteria, Set<String> results)
- {
-
- Fqn fqn = createRelationshipNamesAllSearchFqn(getControlsHash(criteria));
-
- Node node = getCache().getRoot().addChild(fqn);
-
- node.put(NODE_SEARCH_RESULTS_KEY, results);
-
- if (getLog().isLoggable(Level.FINER))
- {
- getLog().finer(this.toString() + "IdentityObjectRelationshipName search
results invalidated in cache: criteria hash=" +
- getControlsHash(criteria)) ;
- }
-
- }
-
- protected Set<String>
getRelationshipNamesSearchFromCache(IdentityObjectSearchCriteria criteria)
- {
-
- Fqn fqn = createRelationshipNamesAllSearchFqn(getControlsHash(criteria));
-
- Node node = getCache().getRoot().getChild(fqn);
-
- if (node != null)
- {
- Set<String> results =
(Set<String>)node.get(NODE_SEARCH_RESULTS_KEY);
-
- if (results != null && getLog().isLoggable(Level.FINER))
- {
- getLog().finer(this.toString() + "IdentityObjectRelationshipName search
result found in cache: criteria hash=" +
- getControlsHash(criteria)) ;
- }
-
- return results;
- }
-
-
- return null;
- }
-
- protected void putRelationshipNamesSearchIntoCache(IdentityObject identity,
- IdentityObjectSearchCriteria
criteria,
- Set<String> results)
- {
-
- Fqn fqn = createRelationshipNamesIdentityObjectSearchFqn(identity,
getControlsHash(criteria));
-
- Node node = getCache().getRoot().addChild(fqn);
-
- node.put(NODE_SEARCH_RESULTS_KEY, results);
-
- if (results != null && getLog().isLoggable(Level.FINER))
- {
- getLog().finer(this.toString() + "IdentityObjectRelationshipName search
result stored in cache: " +
- "criteria hash=" + getControlsHash(criteria) +
- "identity=" + identity.toString()) ;
- }
-
- }
-
- protected Set<String> getRelationshipNamesSearchFromCache(IdentityObject
identity, IdentityObjectSearchCriteria criteria)
- {
-
-
- Fqn fqn = createRelationshipNamesIdentityObjectSearchFqn(identity,
getControlsHash(criteria));
-
- Node node = getCache().getRoot().getChild(fqn);
-
- if (node != null)
- {
- Set<String> results =
(Set<String>)node.get(NODE_SEARCH_RESULTS_KEY);
-
- if (results != null && getLog().isLoggable(Level.FINER))
- {
- getLog().finer(this.toString() + "IdentityObjectRelationshipName search
result found in cache: " +
- "criteria hash=" + getControlsHash(criteria) +
- "identity=" + identity.toString()) ;
- }
-
- return results;
- }
- return null;
- }
-
- private int getControlsHash(IdentityObjectSearchCriteria criteria)
- {
- // Convert criteria to Set to have the same hashcode regardles order of criteria
- int hashcode = 0;
-
- if (criteria != null)
- {
- hashcode = criteria.hashCode();
- }
-
- return hashcode;
- }
-
-}
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/cache/JBossCacheAttributeStoreWrapper.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/cache/JBossCacheAttributeStoreWrapper.java 2009-05-09
11:10:49 UTC (rev 485)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/cache/JBossCacheAttributeStoreWrapper.java 2009-05-09
15:06:22 UTC (rev 486)
@@ -29,44 +29,36 @@
import org.jboss.identity.idm.spi.model.IdentityObjectAttribute;
import org.jboss.identity.idm.spi.model.IdentityObject;
import
org.jboss.identity.idm.spi.configuration.metadata.IdentityObjectAttributeMetaData;
+import org.jboss.identity.idm.spi.cache.IdentityStoreCacheProvider;
import org.jboss.identity.idm.exception.IdentityException;
-import org.jboss.cache.Cache;
-import org.jboss.cache.CacheFactory;
-import org.jboss.cache.DefaultCacheFactory;
import java.util.logging.Logger;
import java.util.Set;
import java.util.Map;
-import java.io.InputStream;
/**
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
* @version : 0.1 $
*/
-public class JBossCacheAttributeStoreWrapper extends IdentityStoreCacheSupport implements
AttributeStore
+public class JBossCacheAttributeStoreWrapper implements AttributeStore
{
private static Logger log =
Logger.getLogger(JBossCacheAttributeStoreWrapper.class.getName());
private final AttributeStore attributeStore;
- protected final Cache cache;
+ protected final IdentityStoreCacheProvider cacheSupport;
// if update/add/remove operation on attributes should result in getAttributes() query
to store new set in cache
// with many updates it can add additional cost
private boolean reloadAttributesToCacheOnUpdate = true;
- public JBossCacheAttributeStoreWrapper(AttributeStore attributeStore, InputStream
cacheConfigInputStream)
+ public JBossCacheAttributeStoreWrapper(AttributeStore attributeStore,
IdentityStoreCacheProvider cacheSupport)
{
+ //cacheSupport = new IdentityStoreCacheSupportImpl(cacheConfigInputStream);
+ this.cacheSupport = cacheSupport;
this.attributeStore = attributeStore;
-
- CacheFactory factory = new DefaultCacheFactory();
-
- this.cache = factory.createCache(cacheConfigInputStream);
-
- this.cache.start();
-
}
public String getId()
@@ -96,7 +88,7 @@
public Map<String, IdentityObjectAttribute>
getAttributes(IdentityStoreInvocationContext invocationContext,
IdentityObject identity)
throws IdentityException
{
- Map<String, IdentityObjectAttribute> results =
getAttributesFromCache(identity.getName(), identity.getIdentityType());
+ Map<String, IdentityObjectAttribute> results =
cacheSupport.getAttributesFromCache(identity.getName(), identity.getIdentityType());
if (results == null)
{
@@ -104,7 +96,7 @@
if (results != null && results.size() > 0)
{
- putIntoCache(identity, results);
+ cacheSupport.putIntoCache(identity, results);
}
}
@@ -115,7 +107,7 @@
IdentityObject identity,
String name) throws IdentityException
{
- Map<String, IdentityObjectAttribute> results =
getAttributesFromCache(identity.getName(), identity.getIdentityType());
+ Map<String, IdentityObjectAttribute> results =
cacheSupport.getAttributesFromCache(identity.getName(), identity.getIdentityType());
if (results != null && results.containsKey(name))
{
@@ -136,7 +128,7 @@
{
attributeStore.updateAttributes(invocationCtx, identity, attributes);
- removeAttributesFromCache(identity);
+ cacheSupport.removeAttributesFromCache(identity);
if (reloadAttributesToCacheOnUpdate)
{
@@ -144,7 +136,7 @@
if (results != null && results.size() > 0)
{
- putIntoCache(identity, results);
+ cacheSupport.putIntoCache(identity, results);
}
}
else
@@ -160,7 +152,7 @@
{
attributeStore.addAttributes(invocationCtx, identity, attributes);
- removeAttributesFromCache(identity);
+ cacheSupport.removeAttributesFromCache(identity);
if (reloadAttributesToCacheOnUpdate)
{
@@ -168,7 +160,7 @@
if (results != null && results.size() > 0)
{
- putIntoCache(identity, results);
+ cacheSupport.putIntoCache(identity, results);
}
}
else
@@ -183,7 +175,7 @@
{
attributeStore.removeAttributes(invocationCtx, identity, attributeNames);
- removeAttributesFromCache(identity);
+ cacheSupport.removeAttributesFromCache(identity);
if (reloadAttributesToCacheOnUpdate)
{
@@ -191,7 +183,7 @@
if (results != null && results.size() > 0)
{
- putIntoCache(identity, results);
+ cacheSupport.putIntoCache(identity, results);
}
}
else
@@ -205,10 +197,10 @@
return log;
}
- protected Cache getCache()
- {
- return cache;
- }
+// protected Cache getCache()
+// {
+// return cache;
+// }
@Override
public String toString()
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/cache/JBossCacheIdentityStoreWrapper.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/cache/JBossCacheIdentityStoreWrapper.java 2009-05-09
11:10:49 UTC (rev 485)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/cache/JBossCacheIdentityStoreWrapper.java 2009-05-09
15:06:22 UTC (rev 486)
@@ -33,13 +33,13 @@
import org.jboss.identity.idm.spi.exception.OperationNotSupportedException;
import org.jboss.identity.idm.spi.configuration.IdentityStoreConfigurationContext;
import org.jboss.identity.idm.spi.search.IdentityObjectSearchCriteria;
+import org.jboss.identity.idm.spi.cache.IdentityStoreCacheProvider;
import org.jboss.identity.idm.exception.IdentityException;
import java.util.Map;
import java.util.Collection;
import java.util.Set;
import java.util.logging.Logger;
-import java.io.InputStream;
/**
* IdentityStore implementation that wraps another IdentityStore and uses JBossCache to
cache results.
@@ -57,15 +57,15 @@
private final IdentityStore identityStore;
- public JBossCacheIdentityStoreWrapper(IdentityStore identityStore, InputStream
cacheConfigInputStream) throws IdentityException
+ public JBossCacheIdentityStoreWrapper(IdentityStore identityStore,
IdentityStoreCacheProvider cacheSupport) throws IdentityException
{
- super(identityStore, cacheConfigInputStream);
+ super(identityStore, cacheSupport);
this.identityStore = identityStore;
-
initResidentNodes(identityStore.getSupportedFeatures().getSupportedIdentityObjectTypes(),
+
cacheSupport.initResidentNodes(identityStore.getSupportedFeatures().getSupportedIdentityObjectTypes(),
identityStore.getSupportedFeatures().getSupportedRelationshipTypes());
log.fine("------------------------------------------------------");
@@ -98,10 +98,10 @@
if (io != null)
{
//should also invalidate IO searches cache - searches/type - clear all children
- invalidateCachedIdentityObjectSearches(io);
- invalidateCachedIdentityObjectCount(identityObjectType);
+ cacheSupport.invalidateCachedIdentityObjectSearches(io);
+ cacheSupport.invalidateCachedIdentityObjectCount(identityObjectType);
- putIntoCache(io);
+ cacheSupport.putIntoCache(io);
}
return io;
}
@@ -120,11 +120,11 @@
if (io != null)
{
//should also invalidate IO searches cache - searches/type - clear all children
- invalidateCachedIdentityObjectSearches(io);
+ cacheSupport.invalidateCachedIdentityObjectSearches(io);
//grab profile - because IS can add extra attributes we canno rely only on
attributes passed
- putIntoCache(io, identityStore.getAttributes(invocationCtx, io));
+ cacheSupport.putIntoCache(io, identityStore.getAttributes(invocationCtx, io));
}
return io;
}
@@ -134,22 +134,22 @@
{
identityStore.removeIdentityObject(invocationCtx, identity);
- removeFromCache(identity);
+ cacheSupport.removeFromCache(identity);
- invalidateCachedIdentityObjectSearches(identity);
- invalidateCachedIdentityObjectCount(identity.getIdentityType());
+ cacheSupport.invalidateCachedIdentityObjectSearches(identity);
+ cacheSupport.invalidateCachedIdentityObjectCount(identity.getIdentityType());
}
public int getIdentityObjectsCount(IdentityStoreInvocationContext invocationCtx,
IdentityObjectType identityType) throws
IdentityException
{
- int count = getIdentityObjectCountFromCache(identityType);
+ int count = cacheSupport.getIdentityObjectCountFromCache(identityType);
if (count == -1)
{
count = identityStore.getIdentityObjectsCount(invocationCtx, identityType);
- putIdentityObjectCountIntoCache(identityType, count);
+ cacheSupport.putIdentityObjectCountIntoCache(identityType, count);
}
return count;
@@ -162,12 +162,12 @@
String name,
IdentityObjectType identityObjectType) throws
IdentityException
{
- IdentityObject io = getFromCache(name, identityObjectType);
+ IdentityObject io = cacheSupport.getFromCache(name, identityObjectType);
if (io == null)
{
io = identityStore.findIdentityObject(invocationContext, name,
identityObjectType);
- putIntoCache(io);
+ cacheSupport.putIntoCache(io);
return io;
}
@@ -177,12 +177,12 @@
public IdentityObject findIdentityObject(IdentityStoreInvocationContext
invocationContext,
String id) throws IdentityException
{
- IdentityObject io = getFromCache(id);
+ IdentityObject io = cacheSupport.getFromCache(id);
if (io == null)
{
io = identityStore.findIdentityObject(invocationContext, id);
- putIntoCache(io);
+ cacheSupport.putIntoCache(io);
return io;
}
@@ -194,18 +194,18 @@
IdentityObjectSearchCriteria
criteria) throws IdentityException
{
- Collection<IdentityObject> results =
getIdentityObjectSearchFromCache(identityType, criteria);
+ Collection<IdentityObject> results =
cacheSupport.getIdentityObjectSearchFromCache(identityType, criteria);
if (results == null)
{
results = identityStore.findIdentityObject(invocationCtx, identityType,
criteria);
- putIdentityObjectSearchIntoCache(identityType, criteria, results);
+ cacheSupport.putIdentityObjectSearchIntoCache(identityType, criteria, results);
// Put all the results into cache separately
for (IdentityObject result : results)
{
- putIntoCache(result);
+ cacheSupport.putIntoCache(result);
}
}
@@ -224,17 +224,17 @@
IdentityObjectSearchCriteria
criteria) throws IdentityException
{
- Collection<IdentityObject> results =
getIdentityObjectSearchFromCache(identity, relationshipType, parent, criteria);
+ Collection<IdentityObject> results =
cacheSupport.getIdentityObjectSearchFromCache(identity, relationshipType, parent,
criteria);
if (results == null)
{
results = identityStore.findIdentityObject(invocationCtx, identity,
relationshipType, parent, criteria);
- putIdentityObjectSearchToCache(identity, relationshipType,parent,criteria,
results);
+ cacheSupport.putIdentityObjectSearchToCache(identity,
relationshipType,parent,criteria, results);
for (IdentityObject result : results)
{
- putIntoCache(result);
+ cacheSupport.putIntoCache(result);
}
}
return results;
@@ -250,7 +250,7 @@
String relationshipName,
boolean createNames) throws
IdentityException
{
- invalidateCachedRelationshipSearches(fromIdentity, toIdentity, relationshipType,
relationshipName);
+ cacheSupport.invalidateCachedRelationshipSearches(fromIdentity, toIdentity,
relationshipType, relationshipName);
return identityStore.createRelationship(invocationCxt,
fromIdentity, toIdentity, relationshipType, relationshipName, createNames);
@@ -266,7 +266,7 @@
{
identityStore.removeRelationship(invocationCxt, fromIdentity, toIdentity,
relationshipType, relationshipName);
- invalidateCachedRelationshipSearches(fromIdentity, toIdentity, relationshipType,
relationshipName);
+ cacheSupport.invalidateCachedRelationshipSearches(fromIdentity, toIdentity,
relationshipType, relationshipName);
}
@@ -280,7 +280,7 @@
{
identityStore.removeRelationships(invocationCtx, identity1, identity2, named);
- invalidateCachedRelationshipSearches(identity1, identity2, named);
+ cacheSupport.invalidateCachedRelationshipSearches(identity1, identity2, named);
}
@@ -292,13 +292,13 @@
{
- Set<IdentityObjectRelationship> results =
getRelationshipsSearchFromCache(fromIdentity, toIdentity, relationshipType);
+ Set<IdentityObjectRelationship> results =
cacheSupport.getRelationshipsSearchFromCache(fromIdentity, toIdentity, relationshipType);
if (results == null)
{
results = identityStore.resolveRelationships(invocationCxt, fromIdentity,
toIdentity, relationshipType);
- putRelationshipsSearchIntoCache(fromIdentity, toIdentity, relationshipType,
results);
+ cacheSupport.putRelationshipsSearchIntoCache(fromIdentity, toIdentity,
relationshipType, results);
}
return results;
@@ -312,14 +312,14 @@
boolean named,
String name) throws
IdentityException
{
- Set<IdentityObjectRelationship> results =
getRelationshipsSearchFromCache(identity, relationshipType, parent, named, name);
+ Set<IdentityObjectRelationship> results =
cacheSupport.getRelationshipsSearchFromCache(identity, relationshipType, parent, named,
name);
if (results == null)
{
results = identityStore.resolveRelationships(invocationCtx,
identity, relationshipType, parent, named, name);
- putRelationshipSearchIntoCache(identity, relationshipType, parent, named, name,
results);
+ cacheSupport.putRelationshipSearchIntoCache(identity, relationshipType, parent,
named, name, results);
}
return results;
@@ -329,7 +329,7 @@
String name) throws IdentityException,
OperationNotSupportedException
{
- invalidateRelationshipNameSearches(name);
+ cacheSupport.invalidateRelationshipNameSearches(name);
return identityStore.createRelationshipName(ctx, name);
}
@@ -337,7 +337,7 @@
public String removeRelationshipName(IdentityStoreInvocationContext ctx,
String name) throws IdentityException,
OperationNotSupportedException
{
- invalidateRelationshipNameSearches(name);
+ cacheSupport.invalidateRelationshipNameSearches(name);
return identityStore.removeRelationshipName(ctx, name);
}
@@ -345,13 +345,13 @@
public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx,
IdentityObjectSearchCriteria criteria) throws
IdentityException, OperationNotSupportedException
{
- Set<String> results = getRelationshipNamesSearchFromCache(criteria);
+ Set<String> results =
cacheSupport.getRelationshipNamesSearchFromCache(criteria);
if (results == null)
{
results = identityStore.getRelationshipNames(ctx, criteria);
- putRelationshipNamesSearchIntoCache(criteria, results);
+ cacheSupport.putRelationshipNamesSearchIntoCache(criteria, results);
}
return results;
@@ -364,13 +364,13 @@
{
- Set<String> results = getRelationshipNamesSearchFromCache(identity,
criteria);
+ Set<String> results =
cacheSupport.getRelationshipNamesSearchFromCache(identity, criteria);
if (results == null)
{
results = identityStore.getRelationshipNames(ctx, identity, criteria);
- putRelationshipNamesSearchIntoCache(identity, criteria, results);
+ cacheSupport.putRelationshipNamesSearchIntoCache(identity, criteria, results);
}
return results;
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/repository/AbstractIdentityStoreRepository.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/repository/AbstractIdentityStoreRepository.java 2009-05-09
11:10:49 UTC (rev 485)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/repository/AbstractIdentityStoreRepository.java 2009-05-09
15:06:22 UTC (rev 486)
@@ -31,18 +31,19 @@
import
org.jboss.identity.idm.spi.configuration.metadata.IdentityRepositoryConfigurationMetaData;
import org.jboss.identity.idm.spi.configuration.metadata.IdentityStoreMappingMetaData;
import org.jboss.identity.idm.spi.configuration.IdentityRepositoryConfigurationContext;
+import org.jboss.identity.idm.spi.cache.IdentityStoreCacheProvider;
import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.identity.idm.impl.helper.SecurityActions;
import org.jboss.identity.idm.impl.cache.JBossCacheIdentityStoreWrapper;
-import org.jboss.identity.idm.impl.helper.SecurityActions;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.List;
import java.util.HashMap;
-import java.io.File;
import java.io.InputStream;
import java.io.Serializable;
+import java.lang.reflect.Constructor;
/**
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
@@ -63,7 +64,9 @@
public static final String CACHE_CONFIG_FILE_OPTION = "cache.config-file";
+ public static final String CACHE_PROVIDER_CLASS_OPTION =
"cache.provider.class";
+
public void bootstrap(IdentityRepositoryConfigurationContext configurationContext,
Map<String, IdentityStore> bootstrappedIdentityStores,
Map<String, AttributeStore> bootstrappedAttributeStores)
throws IdentityException
@@ -90,12 +93,18 @@
if (cacheOption != null &&
cacheOption.equalsIgnoreCase("true"))
{
String cacheConfig =
configurationMD.getOptionSingleValue(CACHE_CONFIG_FILE_OPTION);
+ String cacheSupportClass =
configurationMD.getOptionSingleValue(CACHE_PROVIDER_CLASS_OPTION);
if (cacheConfig == null)
{
throw new IdentityException(CACHE_CONFIG_FILE_OPTION + " is missing
in the repository configuration");
}
+ if (cacheSupportClass == null)
+ {
+ throw new IdentityException(CACHE_PROVIDER_CLASS_OPTION + " is
missing in the repository configuration");
+ }
+
ClassLoader classLoader = SecurityActions.getContextClassLoader();
InputStream cacheConfigInputStream =
classLoader.getResourceAsStream(cacheConfig);
if (cacheConfigInputStream == null)
@@ -104,9 +113,34 @@
"\" doesn't exist: " + cacheConfig);
}
- defaultIdentityStore = new
JBossCacheIdentityStoreWrapper(defaultIdentityStore, cacheConfigInputStream);
+ try
+ {
+ Class cacheClass = null;
+ cacheClass = Class.forName(cacheSupportClass);
+
+ Class partypes[] = new Class[1];
+ partypes[0] = InputStream.class;
+
+ Constructor ct = cacheClass.getConstructor(partypes);
+ Object argList[] = new Object[1];
+ argList[0] = cacheConfigInputStream;
+
+
+ IdentityStoreCacheProvider cacheSupport =
(IdentityStoreCacheProvider)ct.newInstance(argList);
+
+ defaultIdentityStore = new
JBossCacheIdentityStoreWrapper(defaultIdentityStore, cacheSupport);
+
+
+ }
+ catch (Exception e)
+ {
+ throw new IdentityException("Cannot instantiate cache provider:"
+ cacheSupportClass, e);
+ }
+
+
+
}
}
@@ -119,15 +153,23 @@
String cacheOption =
identityStoreMappingMetaData.getOptionSingleValue(CACHE_OPTION);
+
if (cacheOption != null &&
cacheOption.equalsIgnoreCase("true"))
{
String cacheConfig =
identityStoreMappingMetaData.getOptionSingleValue(CACHE_CONFIG_FILE_OPTION);
+ String cacheSupportClass =
identityStoreMappingMetaData.getOptionSingleValue(CACHE_PROVIDER_CLASS_OPTION);
+
if (cacheConfig == null)
{
throw new IdentityException(CACHE_CONFIG_FILE_OPTION + " is missing
in the repository identity-store-mapping configuration");
}
+ if (cacheSupportClass == null)
+ {
+ throw new IdentityException(CACHE_PROVIDER_CLASS_OPTION + " is
missing in the repository configuration");
+ }
+
ClassLoader classLoader = SecurityActions.getContextClassLoader();
InputStream cacheConfigInputStream =
classLoader.getResourceAsStream(cacheConfig);
if (cacheConfigInputStream == null)
@@ -136,8 +178,30 @@
"\" doesn't exist: " + cacheConfig);
}
+ try
+ {
+ Class cacheClass = null;
+ cacheClass = Class.forName(cacheSupportClass);
- store = new JBossCacheIdentityStoreWrapper(store, cacheConfigInputStream);
+ Class partypes[] = new Class[1];
+ partypes[0] = InputStream.class;
+
+ Constructor ct = cacheClass.getConstructor(partypes);
+ Object argList[] = new Object[1];
+ argList[0] = cacheConfigInputStream;
+
+
+ IdentityStoreCacheProvider cacheSupport =
(IdentityStoreCacheProvider)ct.newInstance(argList);
+
+ store = new JBossCacheIdentityStoreWrapper(store, cacheSupport);
+
+ }
+ catch (Exception e)
+ {
+ throw new IdentityException("Cannot instantiate cache provider:"
+ cacheSupportClass, e);
+ }
+
+
}
if (store == null)
Copied: idm/trunk/idm-core/src/test/resources/organization-test-config.xml (from rev 485,
idm/trunk/idm-testsuite/src/test/resources/organization-test-config.xml)
===================================================================
--- idm/trunk/idm-core/src/test/resources/organization-test-config.xml
(rev 0)
+++ idm/trunk/idm-core/src/test/resources/organization-test-config.xml 2009-05-09 15:06:22
UTC (rev 486)
@@ -0,0 +1,800 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jboss-identity xmlns="urn:jboss:identity:idm:config:v1_0_alpha"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:identity:idm:config:v1_0_alpha
identity-config.xsd">
+ <realms>
+ <realm>
+ <id>realm://RedHat/DB</id>
+ <repository-id-ref>RedHat Repository DB</repository-id-ref>
+ <identity-type-mappings>
+ <user-mapping>USER</user-mapping>
+ </identity-type-mappings>
+ </realm>
+ <realm>
+ <id>realm://portal/SamplePortal/DB</id>
+ <repository-id-ref>Sample Portal Repository
DB</repository-id-ref>
+ <identity-type-mappings>
+ <user-mapping>USER</user-mapping>
+ </identity-type-mappings>
+ </realm>
+ <realm>
+ <id>realm://RedHat/DB_LDAP</id>
+ <repository-id-ref>RedHat Repository DB+LDAP</repository-id-ref>
+ <identity-type-mappings>
+ <user-mapping>USER</user-mapping>
+ </identity-type-mappings>
+ </realm>
+ <realm>
+ <id>realm://portal/SamplePortal/DB_LDAP</id>
+ <repository-id-ref>Sample Portal Repository
DB+LDAP</repository-id-ref>
+ <identity-type-mappings>
+ <user-mapping>USER</user-mapping>
+ </identity-type-mappings>
+ </realm>
+ </realms>
+ <repositories>
+ <repository>
+ <id>RedHat Repository DB</id>
+
<class>org.jboss.identity.idm.impl.repository.WrapperIdentityStoreRepository</class>
+ <external-config/>
+ <default-identity-store-id>Hibernate Identity
Store</default-identity-store-id>
+ <default-attribute-store-id>Hibernate Identity
Store</default-attribute-store-id>
+ <options>
+ <option>
+ <name>allowNotDefinedAttributes</name>
+ <value>true</value>
+ </option>
+ </options>
+ </repository>
+ <repository>
+ <id>Sample Portal Repository DB</id>
+
<class>org.jboss.identity.idm.impl.repository.WrapperIdentityStoreRepository</class>
+ <external-config/>
+ <default-identity-store-id>Hibernate Identity
Store</default-identity-store-id>
+ <default-attribute-store-id>Hibernate Identity
Store</default-attribute-store-id>
+ <options>
+ <option>
+ <name>allowNotDefinedAttributes</name>
+ <value>true</value>
+ </option>
+ </options>
+ </repository>
+ <repository>
+ <id>RedHat Repository DB+LDAP</id>
+
<class>org.jboss.identity.idm.impl.repository.FallbackIdentityStoreRepository</class>
+ <external-config/>
+ <default-identity-store-id>Hibernate Identity
Store</default-identity-store-id>
+ <default-attribute-store-id>Hibernate Identity
Store</default-attribute-store-id>
+ <identity-store-mappings>
+ <identity-store-mapping>
+ <identity-store-id>Hibernate Identity
Store</identity-store-id>
+ <identity-object-types>
+
<identity-object-type>DIVISION</identity-object-type>
+ <identity-object-type>PROJECT</identity-object-type>
+ <identity-object-type>PEOPLE</identity-object-type>
+ </identity-object-types>
+ <options/>
+ </identity-store-mapping>
+ <identity-store-mapping>
+ <identity-store-id>LDAP Identity
Store</identity-store-id>
+ <identity-object-types>
+ <identity-object-type>USER</identity-object-type>
+
<identity-object-type>ORGANIZATION</identity-object-type>
+
<identity-object-type>ORGANIZATION_UNIT</identity-object-type>
+
<identity-object-type>DEPARTMENT</identity-object-type>
+ </identity-object-types>
+ <options>
+ <option>
+ <name>cache</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>cache.provider.class</name>
+
<value>org.jboss.identity.idm.impl.cache.IdentityStoreCacheSupportImpl</value>
+ </option>
+ <option>
+ <name>cache.config-file</name>
+
<value>src/test/resources/jboss-cache-config.xml</value>
+ </option>
+ </options>
+ </identity-store-mapping>
+ </identity-store-mappings>
+ <options>
+ <option>
+ <name>allowNotDefinedAttributes</name>
+ <value>true</value>
+ </option>
+ </options>
+ </repository>
+ <repository>
+ <id>Sample Portal Repository DB+LDAP</id>
+
<class>org.jboss.identity.idm.impl.repository.FallbackIdentityStoreRepository</class>
+ <external-config/>
+ <default-identity-store-id>Hibernate Identity
Store</default-identity-store-id>
+ <default-attribute-store-id>Hibernate Identity
Store</default-attribute-store-id>
+ <identity-store-mappings>
+ <identity-store-mapping>
+ <identity-store-id>Hibernate Identity
Store</identity-store-id>
+ <identity-object-types>
+ <identity-object-type>SYSTEM</identity-object-type>
+
<identity-object-type>ADMINISTRATION</identity-object-type>
+
<identity-object-type>COMMUNITY</identity-object-type>
+
<identity-object-type>DIVISION</identity-object-type>
+
<identity-object-type>SECURITY</identity-object-type>
+ <identity-object-type>PEOPLE</identity-object-type>
+ </identity-object-types>
+ <options/>
+ </identity-store-mapping>
+ <identity-store-mapping>
+ <identity-store-id>LDAP Identity
Store</identity-store-id>
+ <identity-object-types>
+ <identity-object-type>USER</identity-object-type>
+
<identity-object-type>DEPARTMENT</identity-object-type>
+
<identity-object-type>ORGANIZATION</identity-object-type>
+
<identity-object-type>ORGANIZATION_UNIT</identity-object-type>
+ <identity-object-type>OFFICE</identity-object-type>
+ </identity-object-types>
+ <options>
+ <option>
+ <name>cache</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>cache.provider.class</name>
+
<value>org.jboss.identity.idm.impl.cache.IdentityStoreCacheSupportImpl</value>
+ </option>
+ <option>
+ <name>cache.config-file</name>
+
<value>src/test/resources/jboss-cache-config.xml</value>
+ </option>
+ </options>
+ </identity-store-mapping>
+ </identity-store-mappings>
+ <options>
+ <option>
+ <name>allowNotDefinedAttributes</name>
+ <value>true</value>
+ </option>
+ </options>
+ </repository>
+ </repositories>
+ <stores>
+ <attribute-stores/>
+ <identity-stores>
+ <identity-store>
+ <id>Hibernate Identity Store</id>
+
<class>org.jboss.identity.idm.impl.store.hibernate.HibernateIdentityStoreImpl</class>
+ <external-config/>
+ <supported-relationship-types>
+
<relationship-type>JBOSS_IDENTITY_MEMBERSHIP</relationship-type>
+
<relationship-type>JBOSS_IDENTITY_ROLE</relationship-type>
+ </supported-relationship-types>
+ <supported-identity-object-types>
+ <identity-object-type>
+ <name>USER</name>
+ <relationships>
+ <!--<relationship>-->
+
<!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
+
<!--<identity-object-type-ref>ORGANIZATION</identity-object-type-ref>-->
+ <!--</relationship>-->
+ <!--<relationship>-->
+
<!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
+
<!--<identity-object-type-ref>COMMUNITY</identity-object-type-ref>-->
+ <!--</relationship>-->
+ <!--<relationship>-->
+
<!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
+
<!--<identity-object-type-ref>OFFICE</identity-object-type-ref>-->
+ <!--</relationship>-->
+ <!--<relationship>-->
+
<!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
+
<!--<identity-object-type-ref>SECURITY</identity-object-type-ref>-->
+ <!--</relationship>-->
+ <!--<relationship>-->
+
<!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
+
<!--<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>-->
+ <!--</relationship>-->
+ <!--<relationship>-->
+
<!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
+
<!--<identity-object-type-ref>PROJECT</identity-object-type-ref>-->
+ <!--</relationship>-->
+ <!--<relationship>-->
+
<!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
+
<!--<identity-object-type-ref>PEOPLE</identity-object-type-ref>-->
+ <!--</relationship>-->
+ </relationships>
+ <credentials>
+ <credential-type>PASSWORD</credential-type>
+ </credentials>
+ <attributes>
+ <attribute>
+ <name>picture</name>
+ <mapping>user.picture</mapping>
+ <type>binary</type>
+ <isRequired>false</isRequired>
+ <isMultivalued>false</isMultivalued>
+ <isReadOnly>false</isReadOnly>
+ </attribute>
+ </attributes>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>ORGANIZATION</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ORGANIZATION</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>DIVISION</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>ORGANIZATION_UNIT</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>DIVISION</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>OFFICE</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>PEOPLE</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>PROJECT</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>DIVISION</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>DEPARTMENT</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>PROJECT</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>PEOPLE</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>ADMINISTRATION</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>COMMUNITY</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>OFFICE</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>SECURITY</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>SYSTEM</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>SECURITY</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>COMMUNITY</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ORGANIZATION</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ </supported-identity-object-types>
+ <options>
+ <option>
+ <name>hibernateConfiguration</name>
+ <value>hibernate-jboss-identity.cfg.xml</value>
+ </option>
+ <!--<option>-->
+
<!--<name>hibernateSessionFactoryJNDIName</name>-->
+
<!--<value>java:/jbossidentity/HibernateStoreSessionFactory</value>-->
+ <!--</option>-->
+ <option>
+ <name>populateRelationshipTypes</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>populateIdentityObjectTypes</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>allowNotDefinedAttributes</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>isRealmAware</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>allowNotDefinedAttributes</name>
+ <value>true</value>
+ </option>
+ </options>
+ </identity-store>
+ <identity-store>
+ <id>LDAP Identity Store</id>
+
<class>org.jboss.identity.idm.impl.store.ldap.LDAPIdentityStoreImpl</class>
+ <external-config/>
+ <supported-relationship-types>
+
<relationship-type>JBOSS_IDENTITY_MEMBERSHIP</relationship-type>
+ </supported-relationship-types>
+ <supported-identity-object-types>
+ <identity-object-type>
+ <name>USER</name>
+ <relationships/>
+ <credentials>
+ <credential-type>PASSWORD</credential-type>
+ </credentials>
+ <attributes>
+ <attribute>
+ <name>phone</name>
+ <mapping>telephoneNumber</mapping>
+ <type>text</type>
+ <isRequired>false</isRequired>
+ <isMultivalued>false</isMultivalued>
+ <isReadOnly>false</isReadOnly>
+ </attribute>
+ <attribute>
+ <name>description</name>
+ <mapping>description</mapping>
+ <type>text</type>
+ <isRequired>false</isRequired>
+ <isMultivalued>false</isMultivalued>
+ <isReadOnly>false</isReadOnly>
+ </attribute>
+ <attribute>
+ <name>carLicense</name>
+ <mapping>carLicense</mapping>
+ <type>text</type>
+ <isRequired>false</isRequired>
+ <isMultivalued>false</isMultivalued>
+ <isReadOnly>false</isReadOnly>
+ </attribute>
+ </attributes>
+ <options>
+ <option>
+ <name>idAttributeName</name>
+ <value>uid</value>
+ </option>
+ <option>
+ <name>passwordAttributeName</name>
+ <value>userPassword</value>
+ </option>
+ <option>
+ <name>ctxDNs</name>
+
<value>ou=People,o=test,dc=portal,dc=example,dc=com</value>
+ </option>
+ <option>
+ <name>allowCreateEntry</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>createEntryAttributeValues</name>
+ <value>objectClass=top</value>
+ <value>objectClass=inetOrgPerson</value>
+ <value>sn= </value>
+ <value>cn= </value>
+ </option>
+ </options>
+ </identity-object-type>
+ <identity-object-type>
+ <name>ORGANIZATION</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ORGANIZATION</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>OFFICE</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options>
+ <option>
+ <name>idAttributeName</name>
+ <value>cn</value>
+ </option>
+ <option>
+ <name>ctxDNs</name>
+
<value>ou=Organizations,o=test,dc=portal,dc=example,dc=com</value>
+ </option>
+ <!--<option>-->
+ <!--<name>entrySearchFilter</name>-->
+ <!--<value></value>-->
+ <!--</option>-->
+ <option>
+ <name>allowCreateEntry</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>membershipAttributeName</name>
+ <value>member</value>
+ </option>
+ <option>
+ <name>isMembershipAttributeDN</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>allowEmptyMemberships</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>createEntryAttributeValues</name>
+ <value>objectClass=top</value>
+ <value>objectClass=groupOfNames</value>
+ </option>
+ </options>
+ </identity-object-type>
+ <identity-object-type>
+ <name>ORGANIZATION_UNIT</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>OFFICE</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options>
+ <option>
+ <name>idAttributeName</name>
+ <value>cn</value>
+ </option>
+ <option>
+ <name>ctxDNs</name>
+
<value>ou=OrganizationUnits,o=test,dc=portal,dc=example,dc=com</value>
+ </option>
+ <!--<option>-->
+ <!--<name>entrySearchFilter</name>-->
+ <!--<value></value>-->
+ <!--</option>-->
+ <option>
+ <name>allowCreateEntry</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>membershipAttributeName</name>
+ <value>member</value>
+ </option>
+ <option>
+ <name>isMembershipAttributeDN</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>allowEmptyMemberships</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>createEntryAttributeValues</name>
+ <value>objectClass=top</value>
+ <value>objectClass=groupOfNames</value>
+ </option>
+ </options>
+ </identity-object-type>
+ <identity-object-type>
+ <name>DEPARTMENT</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options>
+ <option>
+ <name>idAttributeName</name>
+ <value>cn</value>
+ </option>
+ <option>
+ <name>ctxDNs</name>
+
<value>ou=Departments,o=test,dc=portal,dc=example,dc=com</value>
+ </option>
+ <!--<option>-->
+ <!--<name>entrySearchFilter</name>-->
+ <!--<value></value>-->
+ <!--</option>-->
+ <option>
+ <name>allowCreateEntry</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>membershipAttributeName</name>
+ <value>member</value>
+ </option>
+ <option>
+ <name>isMembershipAttributeDN</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>allowEmptyMemberships</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>createEntryAttributeValues</name>
+ <value>objectClass=top</value>
+ <value>objectClass=groupOfNames</value>
+ </option>
+ </options>
+ </identity-object-type>
+ <identity-object-type>
+ <name>OFFICE</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options>
+ <option>
+ <name>idAttributeName</name>
+ <value>cn</value>
+ </option>
+ <option>
+ <name>ctxDNs</name>
+
<value>ou=Offices,o=test,dc=portal,dc=example,dc=com</value>
+ </option>
+ <!--<option>-->
+ <!--<name>entrySearchFilter</name>-->
+ <!--<value></value>-->
+ <!--</option>-->
+ <option>
+ <name>allowCreateEntry</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>membershipAttributeName</name>
+ <value>member</value>
+ </option>
+ <option>
+ <name>isMembershipAttributeDN</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>allowEmptyMemberships</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>createEntryAttributeValues</name>
+ <value>objectClass=top</value>
+ <value>objectClass=groupOfNames</value>
+ </option>
+ </options>
+ </identity-object-type>
+ </supported-identity-object-types>
+ <options>
+ <option>
+ <name>providerURL</name>
+ <value>ldap://localhost:10389</value>
+ </option>
+ <option>
+ <name>adminDN</name>
+ <value>cn=Directory Manager</value>
+ </option>
+ <option>
+ <name>adminPassword</name>
+ <value>password</value>
+ </option>
+ <option>
+ <name>searchTimeLimit</name>
+ <value>10000</value>
+ </option>
+ </options>
+ </identity-store>
+ </identity-stores>
+ </stores>
+</jboss-identity>
\ No newline at end of file
Modified: idm/trunk/idm-hibernate/pom.xml
===================================================================
--- idm/trunk/idm-hibernate/pom.xml 2009-05-09 11:10:49 UTC (rev 485)
+++ idm/trunk/idm-hibernate/pom.xml 2009-05-09 15:06:22 UTC (rev 486)
@@ -107,101 +107,9 @@
</systemProperties>
</configuration>
</plugin>
- <!--<plugin>-->
- <!--<groupId>org.jboss.unit</groupId>-->
-
<!--<artifactId>jboss-unit-tooling-maven2</artifactId>-->
- <!--<executions>-->
- <!--<execution>-->
- <!--<phase>test</phase>-->
- <!--<goals>-->
- <!--<goal>execute</goal>-->
- <!--</goals>-->
- <!--</execution>-->
- <!--</executions>-->
- <!--<configuration>-->
- <!--<jpda>true</jpda>-->
- <!--<jpdaPort>5005</jpdaPort>-->
- <!--<jpdaSuspend>true</jpdaSuspend>-->
-
- <!--<failOnError>true</failOnError>-->
-
-
- <!--<testsuites>-->
- <!--<testsuite>-->
- <!--<config>jboss-unit.xml</config>-->
- <!--<parameters>-->
- <!--<parameter>-->
- <!--<name>dataSourceName</name>-->
- <!--<values>-->
- <!--<value>hsqldb</value>-->
- <!--<value>mysql5</value>-->
- <!--<value>mysql4</value>-->
-
<!--<value>postgresql8</value>-->
-
<!--<value>sqlserver</value>-->
- <!--<value>oracle9i</value>-->
-
<!--<value>oracle10g</value>-->
- <!--</values>-->
- <!--</parameter>-->
- <!--</parameters>-->
-
-
- <!--</testsuite>-->
- <!--</testsuites>-->
-
- <!--<reports>-->
- <!--<xml>idm/target/tests/reports/xml</xml>-->
-
<!--<html>idm/target/tests/reports/html</html>-->
- <!--</reports>-->
- <!--</configuration>-->
- <!--</plugin>-->
-
</plugins>
</build>
- <profiles>
- <profile>
- <id>provided-jdbc-driver</id>
- <dependencies>
- <dependency>
- <groupId>privided</groupId>
- <artifactId>jdbc-driver</artifactId>
- <version>NA</version>
- <scope>system</scope>
- <systemPath>${provided.jdbc.driver.path}</systemPath>
- </dependency>
- </dependencies>
- </profile>
- <profile>
- <id>provided-jdbc-driver2</id>
- <dependencies>
- <dependency>
- <groupId>privided</groupId>
- <artifactId>jdbc-driver2</artifactId>
- <version>NA</version>
- <scope>system</scope>
- <systemPath>${provided.jdbc.driver.path2}</systemPath>
- </dependency>
- </dependencies>
- </profile>
- <!--<profile>-->
- <!--<id>oracle-provided-jdbc-drivers</id>-->
- <!--<dependencies>-->
- <!--<dependency>-->
- <!--<groupId>oracle</groupId>-->
- <!--<artifactId>jdbc-driver1</artifactId>-->
- <!--<version>NA</version>-->
- <!--<scope>system</scope>-->
-
<!--<systemPath>${oracle.jdbc.driver1}</systemPath>-->
- <!--</dependency>-->
- <!--<dependency>-->
- <!--<groupId>oracle</groupId>-->
- <!--<artifactId>jdbc-driver2</artifactId>-->
- <!--<version>NA</version>-->
- <!--<scope>system</scope>-->
-
<!--<systemPath>${oracle.jdbc.driver1}</systemPath>-->
- <!--</dependency>-->
- <!--</dependencies>-->
- <!--</profile>-->
- </profiles>
+
</project>
Modified: idm/trunk/idm-ldap/pom.xml
===================================================================
--- idm/trunk/idm-ldap/pom.xml 2009-05-09 11:10:49 UTC (rev 485)
+++ idm/trunk/idm-ldap/pom.xml 2009-05-09 15:06:22 UTC (rev 486)
@@ -64,101 +64,10 @@
</systemProperties>
</configuration>
</plugin>
- <!--<plugin>-->
- <!--<groupId>org.jboss.unit</groupId>-->
-
<!--<artifactId>jboss-unit-tooling-maven2</artifactId>-->
- <!--<executions>-->
- <!--<execution>-->
- <!--<phase>test</phase>-->
- <!--<goals>-->
- <!--<goal>execute</goal>-->
- <!--</goals>-->
- <!--</execution>-->
- <!--</executions>-->
- <!--<configuration>-->
- <!--<jpda>true</jpda>-->
- <!--<jpdaPort>5005</jpdaPort>-->
- <!--<jpdaSuspend>true</jpdaSuspend>-->
- <!--<failOnError>true</failOnError>-->
-
-
- <!--<testsuites>-->
- <!--<testsuite>-->
- <!--<config>jboss-unit.xml</config>-->
- <!--<parameters>-->
- <!--<parameter>-->
- <!--<name>dataSourceName</name>-->
- <!--<values>-->
- <!--<value>hsqldb</value>-->
- <!--<value>mysql5</value>-->
- <!--<value>mysql4</value>-->
-
<!--<value>postgresql8</value>-->
-
<!--<value>sqlserver</value>-->
- <!--<value>oracle9i</value>-->
-
<!--<value>oracle10g</value>-->
- <!--</values>-->
- <!--</parameter>-->
- <!--</parameters>-->
-
-
- <!--</testsuite>-->
- <!--</testsuites>-->
-
- <!--<reports>-->
- <!--<xml>idm/target/tests/reports/xml</xml>-->
-
<!--<html>idm/target/tests/reports/html</html>-->
- <!--</reports>-->
- <!--</configuration>-->
- <!--</plugin>-->
-
</plugins>
</build>
- <profiles>
- <profile>
- <id>provided-jdbc-driver</id>
- <dependencies>
- <dependency>
- <groupId>privided</groupId>
- <artifactId>jdbc-driver</artifactId>
- <version>NA</version>
- <scope>system</scope>
- <systemPath>${provided.jdbc.driver.path}</systemPath>
- </dependency>
- </dependencies>
- </profile>
- <profile>
- <id>provided-jdbc-driver2</id>
- <dependencies>
- <dependency>
- <groupId>privided</groupId>
- <artifactId>jdbc-driver2</artifactId>
- <version>NA</version>
- <scope>system</scope>
- <systemPath>${provided.jdbc.driver.path2}</systemPath>
- </dependency>
- </dependencies>
- </profile>
- <!--<profile>-->
- <!--<id>oracle-provided-jdbc-drivers</id>-->
- <!--<dependencies>-->
- <!--<dependency>-->
- <!--<groupId>oracle</groupId>-->
- <!--<artifactId>jdbc-driver1</artifactId>-->
- <!--<version>NA</version>-->
- <!--<scope>system</scope>-->
-
<!--<systemPath>${oracle.jdbc.driver1}</systemPath>-->
- <!--</dependency>-->
- <!--<dependency>-->
- <!--<groupId>oracle</groupId>-->
- <!--<artifactId>jdbc-driver2</artifactId>-->
- <!--<version>NA</version>-->
- <!--<scope>system</scope>-->
-
<!--<systemPath>${oracle.jdbc.driver1}</systemPath>-->
- <!--</dependency>-->
- <!--</dependencies>-->
- <!--</profile>-->
- </profiles>
+
</project>
Copied:
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/cache/IdentityStoreCacheProvider.java
(from rev 485,
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/cache/IdentityStoreCacheSupport.java)
===================================================================
---
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/cache/IdentityStoreCacheProvider.java
(rev 0)
+++
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/cache/IdentityStoreCacheProvider.java 2009-05-09
15:06:22 UTC (rev 486)
@@ -0,0 +1,124 @@
+/*
+* 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.identity.idm.spi.cache;
+
+import org.jboss.identity.idm.spi.model.IdentityObjectAttribute;
+import org.jboss.identity.idm.spi.model.IdentityObjectType;
+import org.jboss.identity.idm.spi.model.IdentityObject;
+import org.jboss.identity.idm.spi.model.IdentityObjectRelationshipType;
+import org.jboss.identity.idm.spi.model.IdentityObjectRelationship;
+import org.jboss.identity.idm.spi.search.IdentityObjectSearchCriteria;
+
+import java.util.Map;
+import java.util.Collection;
+import java.util.Set;
+
+public interface IdentityStoreCacheProvider
+{
+
+ void initResidentNodes(Set<String> supportedIdentityObjectTypes,
+ Set<String> supportedRelationshipTypes);
+
+ void putIntoCache(IdentityObject io);
+
+ void putIntoCache(IdentityObject io, Map<String, IdentityObjectAttribute>
attributesMap);
+
+ void removeFromCache(IdentityObject io);
+
+ void removeAttributesFromCache(IdentityObject io);
+
+ IdentityObject getFromCache(String name, IdentityObjectType identityObjectType);
+
+ Map<String, IdentityObjectAttribute> getAttributesFromCache(String name,
IdentityObjectType identityObjectType);
+
+ IdentityObject getFromCache(String id);
+
+ void putIdentityObjectSearchIntoCache(IdentityObjectType identityType,
+ IdentityObjectSearchCriteria criteria,
+ Collection<IdentityObject> results);
+
+ Collection<IdentityObject> getIdentityObjectSearchFromCache(IdentityObjectType
identityType,
+
IdentityObjectSearchCriteria criteria);
+
+ void putIdentityObjectSearchToCache(IdentityObject identity,
+ IdentityObjectRelationshipType relationshipType,
+ boolean parent,
+ IdentityObjectSearchCriteria criteria,
+ Collection<IdentityObject> results);
+
+ Collection<IdentityObject> getIdentityObjectSearchFromCache(IdentityObject
identity,
+
IdentityObjectRelationshipType relationshipType,
+ boolean parent,
+
IdentityObjectSearchCriteria criteria);
+
+ void putRelationshipsSearchIntoCache(IdentityObject fromIdentity,
+ IdentityObject toIdentity,
+ IdentityObjectRelationshipType relationshipType,
+ Set<IdentityObjectRelationship> results);
+
+ Set<IdentityObjectRelationship> getRelationshipsSearchFromCache(IdentityObject
fromIdentity,
+ IdentityObject
toIdentity,
+
IdentityObjectRelationshipType relationshipType);
+
+ void putRelationshipSearchIntoCache(IdentityObject identity,
+ IdentityObjectRelationshipType relationshipType,
+ boolean parent,
+ boolean named,
+ String name,
+ Set<IdentityObjectRelationship> results);
+
+ Set<IdentityObjectRelationship> getRelationshipsSearchFromCache(IdentityObject
identity,
+
IdentityObjectRelationshipType relationshipType,
+ boolean parent,
+ boolean named,
+ String name);
+
+ void invalidateCachedIdentityObjectSearches(IdentityObject io);
+
+ void putIdentityObjectCountIntoCache(IdentityObjectType identityType, int count);
+
+ int getIdentityObjectCountFromCache(IdentityObjectType identityType);
+
+ void invalidateCachedIdentityObjectCount(IdentityObjectType identityType);
+
+ void invalidateCachedRelationshipSearches(IdentityObject fromIdentity,
+ IdentityObject toIdentity,
+ IdentityObjectRelationshipType
relationshipType,
+ String relationshipName);
+
+ void invalidateCachedRelationshipSearches(IdentityObject identity1, IdentityObject
identity2, boolean named);
+
+ void invalidateRelationshipNameSearches(String name);
+
+ void putRelationshipNamesSearchIntoCache(IdentityObjectSearchCriteria criteria,
Set<String> results);
+
+ Set<String> getRelationshipNamesSearchFromCache(IdentityObjectSearchCriteria
criteria);
+
+ void putRelationshipNamesSearchIntoCache(IdentityObject identity,
+ IdentityObjectSearchCriteria criteria,
+ Set<String> results);
+
+ Set<String> getRelationshipNamesSearchFromCache(IdentityObject identity,
IdentityObjectSearchCriteria criteria);
+
+
+}
Modified: idm/trunk/idm-testsuite/pom.xml
===================================================================
--- idm/trunk/idm-testsuite/pom.xml 2009-05-09 11:10:49 UTC (rev 485)
+++ idm/trunk/idm-testsuite/pom.xml 2009-05-09 15:06:22 UTC (rev 486)
@@ -184,101 +184,8 @@
</systemProperties>
</configuration>
</plugin>
- <!--<plugin>-->
- <!--<groupId>org.jboss.unit</groupId>-->
-
<!--<artifactId>jboss-unit-tooling-maven2</artifactId>-->
- <!--<executions>-->
- <!--<execution>-->
- <!--<phase>test</phase>-->
- <!--<goals>-->
- <!--<goal>execute</goal>-->
- <!--</goals>-->
- <!--</execution>-->
- <!--</executions>-->
- <!--<configuration>-->
- <!--<jpda>true</jpda>-->
- <!--<jpdaPort>5005</jpdaPort>-->
- <!--<jpdaSuspend>true</jpdaSuspend>-->
-
- <!--<failOnError>true</failOnError>-->
-
-
- <!--<testsuites>-->
- <!--<testsuite>-->
- <!--<config>jboss-unit.xml</config>-->
- <!--<parameters>-->
- <!--<parameter>-->
- <!--<name>dataSourceName</name>-->
- <!--<values>-->
- <!--<value>hsqldb</value>-->
- <!--<value>mysql5</value>-->
- <!--<value>mysql4</value>-->
-
<!--<value>postgresql8</value>-->
-
<!--<value>sqlserver</value>-->
- <!--<value>oracle9i</value>-->
-
<!--<value>oracle10g</value>-->
- <!--</values>-->
- <!--</parameter>-->
- <!--</parameters>-->
-
-
- <!--</testsuite>-->
- <!--</testsuites>-->
-
- <!--<reports>-->
- <!--<xml>idm/target/tests/reports/xml</xml>-->
-
<!--<html>idm/target/tests/reports/html</html>-->
- <!--</reports>-->
- <!--</configuration>-->
- <!--</plugin>-->
-
</plugins>
</build>
- <profiles>
- <profile>
- <id>provided-jdbc-driver</id>
- <dependencies>
- <dependency>
- <groupId>privided</groupId>
- <artifactId>jdbc-driver</artifactId>
- <version>NA</version>
- <scope>system</scope>
- <systemPath>${provided.jdbc.driver.path}</systemPath>
- </dependency>
- </dependencies>
- </profile>
- <profile>
- <id>provided-jdbc-driver2</id>
- <dependencies>
- <dependency>
- <groupId>privided</groupId>
- <artifactId>jdbc-driver2</artifactId>
- <version>NA</version>
- <scope>system</scope>
- <systemPath>${provided.jdbc.driver.path2}</systemPath>
- </dependency>
- </dependencies>
- </profile>
- <!--<profile>-->
- <!--<id>oracle-provided-jdbc-drivers</id>-->
- <!--<dependencies>-->
- <!--<dependency>-->
- <!--<groupId>oracle</groupId>-->
- <!--<artifactId>jdbc-driver1</artifactId>-->
- <!--<version>NA</version>-->
- <!--<scope>system</scope>-->
-
<!--<systemPath>${oracle.jdbc.driver1}</systemPath>-->
- <!--</dependency>-->
- <!--<dependency>-->
- <!--<groupId>oracle</groupId>-->
- <!--<artifactId>jdbc-driver2</artifactId>-->
- <!--<version>NA</version>-->
- <!--<scope>system</scope>-->
-
<!--<systemPath>${oracle.jdbc.driver1}</systemPath>-->
- <!--</dependency>-->
- <!--</dependencies>-->
- <!--</profile>-->
- </profiles>
</project>
Modified: idm/trunk/idm-testsuite/src/test/resources/organization-test-config.xml
===================================================================
--- idm/trunk/idm-testsuite/src/test/resources/organization-test-config.xml 2009-05-09
11:10:49 UTC (rev 485)
+++ idm/trunk/idm-testsuite/src/test/resources/organization-test-config.xml 2009-05-09
15:06:22 UTC (rev 486)
@@ -89,6 +89,10 @@
<value>true</value>
</option>
<option>
+ <name>cache.provider.class</name>
+
<value>org.jboss.identity.idm.impl.cache.IdentityStoreCacheProviderImpl</value>
+ </option>
+ <option>
<name>cache.config-file</name>
<value>src/test/resources/jboss-cache-config.xml</value>
</option>
@@ -136,6 +140,10 @@
<value>true</value>
</option>
<option>
+ <name>cache.provider.class</name>
+
<value>org.jboss.identity.idm.impl.cache.IdentityStoreCacheProviderImpl</value>
+ </option>
+ <option>
<name>cache.config-file</name>
<value>src/test/resources/jboss-cache-config.xml</value>
</option>
Modified:
idm/trunk/idm-testsuite/src/test/resources/organization-test-jboss-unit-config.xml
===================================================================
---
idm/trunk/idm-testsuite/src/test/resources/organization-test-jboss-unit-config.xml 2009-05-09
11:10:49 UTC (rev 485)
+++
idm/trunk/idm-testsuite/src/test/resources/organization-test-jboss-unit-config.xml 2009-05-09
15:06:22 UTC (rev 486)
@@ -89,6 +89,10 @@
<value>true</value>
</option>
<option>
+ <name>cache.provider.class</name>
+
<value>org.jboss.identity.idm.impl.cache.IdentityStoreCacheProviderImpl</value>
+ </option>
+ <option>
<name>cache.config-file</name>
<value>jboss-cache-config.xml</value>
</option>
@@ -136,6 +140,10 @@
<value>true</value>
</option>
<option>
+ <name>cache.provider.class</name>
+
<value>org.jboss.identity.idm.impl.cache.IdentityStoreCacheProviderImpl</value>
+ </option>
+ <option>
<name>cache.config-file</name>
<value>jboss-cache-config.xml</value>
</option>
Modified: idm/trunk/parent/pom.xml
===================================================================
--- idm/trunk/parent/pom.xml 2009-05-09 11:10:49 UTC (rev 485)
+++ idm/trunk/parent/pom.xml 2009-05-09 15:06:22 UTC (rev 486)
@@ -121,6 +121,30 @@
</plugins>
</build>
</profile>
+ <profile>
+ <id>provided-jdbc-driver</id>
+ <dependencies>
+ <dependency>
+ <groupId>privided</groupId>
+ <artifactId>jdbc-driver</artifactId>
+ <version>NA</version>
+ <scope>system</scope>
+ <systemPath>${provided.jdbc.driver.path}</systemPath>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>provided-jdbc-driver2</id>
+ <dependencies>
+ <dependency>
+ <groupId>privided</groupId>
+ <artifactId>jdbc-driver2</artifactId>
+ <version>NA</version>
+ <scope>system</scope>
+ <systemPath>${provided.jdbc.driver.path2}</systemPath>
+ </dependency>
+ </dependencies>
+ </profile>
</profiles>
<repositories>