Seam SVN: r13094 - branches/enterprise/JBPAPP_5_0/build.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-06-09 09:27:37 -0400 (Wed, 09 Jun 2010)
New Revision: 13094
Modified:
branches/enterprise/JBPAPP_5_0/build/ci.settings.xml
Log:
added maven2-brew repository into CI settings
Modified: branches/enterprise/JBPAPP_5_0/build/ci.settings.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/build/ci.settings.xml 2010-06-09 11:55:01 UTC (rev 13093)
+++ branches/enterprise/JBPAPP_5_0/build/ci.settings.xml 2010-06-09 13:27:37 UTC (rev 13094)
@@ -169,6 +169,12 @@
<url>http://my.repository.com/repo/path</url>
</mirror>
-->
+ <mirror>
+ <id>fake.mirror.of.central</id>
+ <mirrorOf>central</mirrorOf>
+ <name>Fake mirror of central - reroutes central to repository.jboss.org</name>
+ <url>http://repository.jboss.org/maven2-brew</url>
+ </mirror>
</mirrors>
14 years
Seam SVN: r13093 - branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-06-09 07:55:01 -0400 (Wed, 09 Jun 2010)
New Revision: 13093
Removed:
branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/wicket-2.2.xsd
Log:
deleted wicket schema
Deleted: branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/wicket-2.2.xsd
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/wicket-2.2.xsd 2010-06-09 11:26:59 UTC (rev 13092)
+++ branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/wicket-2.2.xsd 2010-06-09 11:55:01 UTC (rev 13093)
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
- targetNamespace="http://jboss.com/products/seam/wicket"
- xmlns:wicket="http://jboss.com/products/seam/wicket"
- xmlns:components="http://jboss.com/products/seam/components" attributeFormDefault="unqualified">
-
- <xs:import namespace="http://jboss.com/products/seam/components" schemaLocation="components-2.2.xsd"/>
-
- <xs:element name="web-application">
- <xs:annotation>
- <xs:documentation></xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:attributeGroup ref="components:attlist.component" />
- <xs:attributeGroup ref="wicket:attlist.webApplication" />
- </xs:complexType>
- </xs:element>
-
- <xs:attributeGroup name="attlist.webApplication">
- <xs:attribute name="application-class" type="components:string" />
- </xs:attributeGroup>
-
-</xs:schema>
14 years
Seam SVN: r13092 - branches/enterprise/JBPAPP_5_0/.settings.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-06-09 07:26:59 -0400 (Wed, 09 Jun 2010)
New Revision: 13092
Modified:
branches/enterprise/JBPAPP_5_0/.settings/org.eclipse.jdt.core.prefs
Log:
changed eclipse project settings
Modified: branches/enterprise/JBPAPP_5_0/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- branches/enterprise/JBPAPP_5_0/.settings/org.eclipse.jdt.core.prefs 2010-06-09 11:24:24 UTC (rev 13091)
+++ branches/enterprise/JBPAPP_5_0/.settings/org.eclipse.jdt.core.prefs 2010-06-09 11:26:59 UTC (rev 13092)
@@ -1,4 +1,4 @@
-#Sat Oct 25 15:55:36 BST 2008
+#Mon Mar 22 13:16:47 CET 2010
eclipse.preferences.version=1
org.eclipse.jdt.core.codeComplete.argumentPrefixes=
org.eclipse.jdt.core.codeComplete.argumentSuffixes=
@@ -9,9 +9,9 @@
org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@@ -79,7 +79,7 @@
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=0
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=0
@@ -123,11 +123,9 @@
org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=next_line
org.eclipse.jdt.core.formatter.brace_position_for_switch=next_line
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=next_line
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines=false
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
org.eclipse.jdt.core.formatter.comment.format_block_comments=true
-org.eclipse.jdt.core.formatter.comment.format_comments=true
org.eclipse.jdt.core.formatter.comment.format_header=false
org.eclipse.jdt.core.formatter.comment.format_html=true
org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
@@ -153,7 +151,6 @@
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
org.eclipse.jdt.core.formatter.indentation.size=3
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=insert
14 years
Seam SVN: r13091 - in branches/enterprise/JBPAPP_5_0: src/test/ftest/examples and 1 other directory.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-06-09 07:24:24 -0400 (Wed, 09 Jun 2010)
New Revision: 13091
Modified:
branches/enterprise/JBPAPP_5_0/build/root.pom.xml
branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/build.xml
Log:
correcting versions of dependencies
Modified: branches/enterprise/JBPAPP_5_0/build/root.pom.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/build/root.pom.xml 2010-06-09 08:44:06 UTC (rev 13090)
+++ branches/enterprise/JBPAPP_5_0/build/root.pom.xml 2010-06-09 11:24:24 UTC (rev 13091)
@@ -50,7 +50,7 @@
<version.richfaces>3.3.1.SP2</version.richfaces>
<version.drools>5.0.1</version.drools>
<version.testng>5.9</version.testng>
- <version.resteasy>1.2.1.GA</version.resteasy>
+ <version.resteasy>1.2.1.GA_CP02</version.resteasy>
</properties>
<dependencyManagement>
Modified: branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/build.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/build.xml 2010-06-09 08:44:06 UTC (rev 13090)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/build.xml 2010-06-09 11:24:24 UTC (rev 13091)
@@ -296,17 +296,17 @@
<dependency groupId="commons-httpclient" artifactId="commons-httpclient" version="3.1"/>
<dependency groupId="org.w3c" artifactId="sac" version="1.3"/>
<dependency groupId="commons-io" artifactId="commons-io" version="1.3.1"/>
- <dependency groupId="commons-lang" artifactId="commons-lang" version="2.3"/>
+ <dependency groupId="commons-lang" artifactId="commons-lang" version="2.4"/>
<dependency groupId="apache-xerces" artifactId="xercesImpl" version="2.9.0"/>
- <dependency groupId="commons-collections" artifactId="commons-collections" version="3.1"/>
- <dependency groupId="commons-lang" artifactId="commons-lang" version="2.3"/>
- <dependency groupId="apache-xalan" artifactId="xalan" version="j_2.7.0"/>
+ <dependency groupId="commons-collections" artifactId="commons-collections" version="3.2"/>
+ <dependency groupId="commons-lang" artifactId="commons-lang" version="2.4"/>
+ <dependency groupId="apache-xalan" artifactId="xalan" version="2.7.1.patch02"/>
<dependency groupId="commons-codec" artifactId="commons-codec" version="1.3"/>
<dependency groupId="commons-logging" artifactId="commons-logging" version="1.1.1"/>
<dependency groupId="net.sourceforge.cssparser" artifactId="cssparser" version="0.9.5"/>
<dependency groupId="net.sourceforge.htmlunit" artifactId="htmlunit-core-js" version="2.4"/>
<dependency groupId="net.sourceforge.nekohtml" artifactId="nekohtml" version="1.9.9"/>
- <dependency groupId="apache-xalan" artifactId="serializer" version="j_2.7.0"/>
+ <dependency groupId="apache-xalan" artifactId="serializer" version="2.7.1.patch02"/>
<dependency groupId="xml-apis" artifactId="xml-apis" version="1.3.03"/>
</copyInlineDependencies>
<property name="copy.htmlunit.done" value="true" />
14 years
Seam SVN: r13090 - modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2010-06-09 04:44:06 -0400 (Wed, 09 Jun 2010)
New Revision: 13090
Modified:
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityManagerImpl.java
Log:
start implementing methods
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityManagerImpl.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityManagerImpl.java 2010-06-09 08:43:31 UTC (rev 13089)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityManagerImpl.java 2010-06-09 08:44:06 UTC (rev 13090)
@@ -3,17 +3,19 @@
import java.io.Serializable;
import java.util.List;
-import javax.annotation.PostConstruct;
-import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Model;
import javax.enterprise.inject.spi.BeanManager;
import javax.inject.Inject;
-import javax.inject.Named;
import org.jboss.seam.security.Identity;
+import org.jboss.seam.security.UserImpl;
import org.jboss.seam.security.util.Strings;
import org.picketlink.idm.api.Credential;
+import org.picketlink.idm.api.IdentitySession;
import org.picketlink.idm.api.IdentityType;
import org.picketlink.idm.api.Role;
+import org.picketlink.idm.api.User;
+import org.picketlink.idm.common.exception.IdentityException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -22,7 +24,7 @@
*
* @author Shane Bryzak
*/
-@Named @ApplicationScoped
+@Model
public class IdentityManagerImpl implements IdentityManager, Serializable
{
private static final long serialVersionUID = 6864253169970552893L;
@@ -41,24 +43,36 @@
@Inject BeanManager manager;
@Inject Identity identity;
- @PostConstruct
- public void create()
- {
-
- }
+ @Inject IdentitySession identitySession;
public boolean createUser(String name, Credential credential)
{
identity.checkPermission(USER_PERMISSION_NAME, PERMISSION_CREATE);
- //return identityStore.createUser(name, credential, null);
- return false;
+ try
+ {
+ User user = identitySession.getPersistenceManager().createUser(name);
+ identitySession.getAttributesManager().updateCredential(user, credential);
+ return true;
+ }
+ catch (IdentityException ex)
+ {
+ throw new RuntimeException("Error creating user", ex);
+ }
}
public boolean deleteUser(String name)
{
identity.checkPermission(USER_PERMISSION_NAME, PERMISSION_DELETE);
- //return identityStore.deleteUser(name);
- return false;
+
+ try
+ {
+ identitySession.getPersistenceManager().removeUser(name, true);
+ return true;
+ }
+ catch (IdentityException ex)
+ {
+ throw new RuntimeException("Failed to delete user", ex);
+ }
}
public boolean enableUser(String name)
@@ -78,8 +92,16 @@
public boolean updateCredential(String name, Credential credential)
{
identity.checkPermission(USER_PERMISSION_NAME, PERMISSION_UPDATE);
- //return identityStore.updateCredential(name, credential);
- return false;
+
+ try
+ {
+ identitySession.getAttributesManager().updateCredential(new UserImpl(name), credential);
+ return true;
+ }
+ catch (IdentityException ex)
+ {
+ throw new RuntimeException("Exception updating credential", ex);
+ }
}
public boolean isUserEnabled(String name)
14 years
Seam SVN: r13089 - in modules/security/trunk/examples/idmconsole: src/main/java/org/jboss/seam/security/examples/idmconsole/model and 2 other directories.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2010-06-09 04:43:31 -0400 (Wed, 09 Jun 2010)
New Revision: 13089
Modified:
modules/security/trunk/examples/idmconsole/pom.xml
modules/security/trunk/examples/idmconsole/src/main/java/org/jboss/seam/security/examples/idmconsole/model/IdentityObject.java
modules/security/trunk/examples/idmconsole/src/main/java/org/jboss/seam/security/examples/idmconsole/model/IdentityObjectCredential.java
modules/security/trunk/examples/idmconsole/src/main/webapp/WEB-INF/beans.xml
modules/security/trunk/examples/idmconsole/src/main/webapp/WEB-INF/classes/seam-beans.xml
Log:
misc
Modified: modules/security/trunk/examples/idmconsole/pom.xml
===================================================================
--- modules/security/trunk/examples/idmconsole/pom.xml 2010-06-09 02:01:11 UTC (rev 13088)
+++ modules/security/trunk/examples/idmconsole/pom.xml 2010-06-09 08:43:31 UTC (rev 13089)
@@ -90,19 +90,6 @@
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>org.glassfish.web</groupId>
- <artifactId>el-impl</artifactId>
- <scope>runtime</scope>
- <version>2.1.2-b04</version>
- <exclusions>
- <exclusion>
- <groupId>javax.el</groupId>
- <artifactId>el-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
</dependencies>
<build>
Modified: modules/security/trunk/examples/idmconsole/src/main/java/org/jboss/seam/security/examples/idmconsole/model/IdentityObject.java
===================================================================
--- modules/security/trunk/examples/idmconsole/src/main/java/org/jboss/seam/security/examples/idmconsole/model/IdentityObject.java 2010-06-09 02:01:11 UTC (rev 13088)
+++ modules/security/trunk/examples/idmconsole/src/main/java/org/jboss/seam/security/examples/idmconsole/model/IdentityObject.java 2010-06-09 08:43:31 UTC (rev 13089)
@@ -7,11 +7,8 @@
import javax.persistence.Id;
import javax.persistence.ManyToOne;
-import org.jboss.seam.security.annotations.management.IdentityEntityName;
-import org.jboss.seam.security.annotations.management.IdentityEntityType;
import org.jboss.seam.security.annotations.management.IdentityProperty;
import org.jboss.seam.security.annotations.management.PropertyType;
-import org.picketlink.idm.spi.model.IdentityObjectType;
/**
*
@@ -54,7 +51,7 @@
return type;
}
- public void setIdentityObjectType(IdentityObjectType type)
+ public void setType(IdentityObjectType type)
{
this.type = type;
}
Modified: modules/security/trunk/examples/idmconsole/src/main/java/org/jboss/seam/security/examples/idmconsole/model/IdentityObjectCredential.java
===================================================================
--- modules/security/trunk/examples/idmconsole/src/main/java/org/jboss/seam/security/examples/idmconsole/model/IdentityObjectCredential.java 2010-06-09 02:01:11 UTC (rev 13088)
+++ modules/security/trunk/examples/idmconsole/src/main/java/org/jboss/seam/security/examples/idmconsole/model/IdentityObjectCredential.java 2010-06-09 08:43:31 UTC (rev 13089)
@@ -7,8 +7,6 @@
import javax.persistence.Id;
import javax.persistence.ManyToOne;
-import org.jboss.seam.security.annotations.management.IdentityEntityType;
-import org.jboss.seam.security.annotations.management.IdentityEntityValue;
import org.jboss.seam.security.annotations.management.IdentityProperty;
import org.jboss.seam.security.annotations.management.PropertyType;
Modified: modules/security/trunk/examples/idmconsole/src/main/webapp/WEB-INF/beans.xml
===================================================================
--- modules/security/trunk/examples/idmconsole/src/main/webapp/WEB-INF/beans.xml 2010-06-09 02:01:11 UTC (rev 13088)
+++ modules/security/trunk/examples/idmconsole/src/main/webapp/WEB-INF/beans.xml 2010-06-09 08:43:31 UTC (rev 13089)
@@ -16,8 +16,4 @@
</idm:identityStore>
</idm:IdentityManager-->
- <interceptors>
- <class>org.jboss.seam.transaction.JtaTxInterceptor</class>
- </interceptors>
-
-</beans>
\ No newline at end of file
+</beans>
Modified: modules/security/trunk/examples/idmconsole/src/main/webapp/WEB-INF/classes/seam-beans.xml
===================================================================
--- modules/security/trunk/examples/idmconsole/src/main/webapp/WEB-INF/classes/seam-beans.xml 2010-06-09 02:01:11 UTC (rev 13088)
+++ modules/security/trunk/examples/idmconsole/src/main/webapp/WEB-INF/classes/seam-beans.xml 2010-06-09 08:43:31 UTC (rev 13089)
@@ -33,7 +33,7 @@
<permission:userPermissionClass>org.jboss.seam.security.examples.seamspace.model.AccountPermission</permission:userPermissionClass>
</permission:JpaPermissionStore-->
- <drools-config:KnowledgeBaseConfig>
+ <!--drools-config:KnowledgeBaseConfig>
<s:overrides/>
<drools-qualifier:KBaseConfig value="security-rules-config"/>
<drools-config:knowledgeBuilderConfig>kbuilderconfig.properties</drools-config:knowledgeBuilderConfig>
@@ -44,9 +44,9 @@
<drools-config:eventListeners>
<s:value>org.drools.event.knowledgebase.DefaultKnowledgeBaseEventListener</s:value>
</drools-config:eventListeners>
- </drools-config:KnowledgeBaseConfig>
+ </drools-config:KnowledgeBaseConfig-->
- <drools:KnowledgeBaseProducer>
+ <!--drools:KnowledgeBaseProducer>
<s:specializes/>
<drools:produceKBase>
<drools-qualifier:KBase value="permission-rules"/>
@@ -57,7 +57,7 @@
</drools-config:KnowledgeBaseConfig>
</s:parameters>
</drools:produceKBase>
- </drools:KnowledgeBaseProducer>
+ </drools:KnowledgeBaseProducer-->
<!--permission:RuleBasedPermissionResolver>
<s:specializes/>
@@ -67,4 +67,4 @@
</permission:securityRules>
</permission:RuleBasedPermissionResolver-->
-</beans>
\ No newline at end of file
+</beans>
14 years
Seam SVN: r13088 - modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2010-06-08 22:01:11 -0400 (Tue, 08 Jun 2010)
New Revision: 13088
Added:
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityObjectRelationshipImpl.java
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityObjectTypeImpl.java
Modified:
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/PasswordHashEncoder.java
Log:
relationship creation
Added: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityObjectRelationshipImpl.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityObjectRelationshipImpl.java (rev 0)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityObjectRelationshipImpl.java 2010-06-09 02:01:11 UTC (rev 13088)
@@ -0,0 +1,51 @@
+package org.jboss.seam.security.management;
+
+import java.io.Serializable;
+
+import org.picketlink.idm.spi.model.IdentityObject;
+import org.picketlink.idm.spi.model.IdentityObjectRelationship;
+import org.picketlink.idm.spi.model.IdentityObjectRelationshipType;
+
+/**
+ *
+ * @author Shane Bryzak
+ */
+public class IdentityObjectRelationshipImpl implements IdentityObjectRelationship, Serializable
+{
+ private static final long serialVersionUID = 487517126125658201L;
+
+ private IdentityObject fromIdentityObject;
+ private IdentityObject toIdentityObject;
+ private String name;
+ private IdentityObjectRelationshipType type;
+
+ public IdentityObjectRelationshipImpl(IdentityObject fromIdentityObject,
+ IdentityObject toIdentityObject, String name,
+ IdentityObjectRelationshipType type)
+ {
+ this.fromIdentityObject = fromIdentityObject;
+ this.toIdentityObject = toIdentityObject;
+ this.name = name;
+ this.type = type;
+ }
+
+ public IdentityObject getFromIdentityObject()
+ {
+ return fromIdentityObject;
+ }
+
+ public IdentityObject getToIdentityObject()
+ {
+ return toIdentityObject;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public IdentityObjectRelationshipType getType()
+ {
+ return type;
+ }
+}
Added: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityObjectTypeImpl.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityObjectTypeImpl.java (rev 0)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityObjectTypeImpl.java 2010-06-09 02:01:11 UTC (rev 13088)
@@ -0,0 +1,27 @@
+package org.jboss.seam.security.management;
+
+import java.io.Serializable;
+
+import org.picketlink.idm.spi.model.IdentityObjectType;
+
+/**
+ * Simple implementation of IdentityObjectType
+ *
+ * @author Shane Bryzak
+ */
+public class IdentityObjectTypeImpl implements IdentityObjectType, Serializable
+{
+ private static final long serialVersionUID = -4364461076493738717L;
+
+ private String name;
+
+ public IdentityObjectTypeImpl(String name)
+ {
+ this.name = name;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+}
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java 2010-06-09 00:20:02 UTC (rev 13087)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java 2010-06-09 02:01:11 UTC (rev 13088)
@@ -11,6 +11,7 @@
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Instance;
+import javax.enterprise.inject.spi.BeanManager;
import javax.inject.Inject;
import javax.persistence.Entity;
import javax.persistence.EntityManager;
@@ -19,19 +20,15 @@
import org.jboss.seam.security.annotations.management.IdentityProperty;
import org.jboss.seam.security.annotations.management.PropertyType;
+import org.jboss.seam.security.events.PrePersistUserEvent;
+import org.jboss.seam.security.events.UserCreatedEvent;
import org.jboss.weld.extensions.util.properties.Property;
import org.jboss.weld.extensions.util.properties.query.AnnotatedPropertyCriteria;
import org.jboss.weld.extensions.util.properties.query.NamedPropertyCriteria;
import org.jboss.weld.extensions.util.properties.query.PropertyCriteria;
import org.jboss.weld.extensions.util.properties.query.PropertyQueries;
import org.jboss.weld.extensions.util.properties.query.TypedPropertyCriteria;
-import org.picketlink.idm.api.Credential;
-import org.picketlink.idm.api.Group;
-import org.picketlink.idm.api.IdentityType;
-import org.picketlink.idm.api.Role;
import org.picketlink.idm.common.exception.IdentityException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.picketlink.idm.spi.configuration.IdentityStoreConfigurationContext;
import org.picketlink.idm.spi.configuration.metadata.IdentityObjectAttributeMetaData;
import org.picketlink.idm.spi.exception.OperationNotSupportedException;
@@ -43,9 +40,10 @@
import org.picketlink.idm.spi.model.IdentityObjectType;
import org.picketlink.idm.spi.search.IdentityObjectSearchCriteria;
import org.picketlink.idm.spi.store.FeaturesMetaData;
-import org.picketlink.idm.spi.store.IdentityStore;
import org.picketlink.idm.spi.store.IdentityStoreInvocationContext;
import org.picketlink.idm.spi.store.IdentityStoreSession;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* IdentityStore implementation that allows identity related data to be
@@ -86,6 +84,21 @@
private static final String PROPERTY_ATTRIBUTE_NAME = "ATTRIBUTE_NAME";
private static final String PROPERTY_ATTRIBUTE_VALUE = "ATTRIBUTE_VALUE";
private static final String PROPERTY_ROLE_TYPE_NAME = "ROLE_TYPE_NAME";
+
+ /**
+ * The bean manager
+ */
+ @Inject BeanManager beanManager;
+
+ /**
+ *
+ */
+ @Inject Instance<EntityManager> entityManagerInstance;
+
+ /**
+ *
+ */
+ //@Inject CredentialProcessor credentialEncoder;
// Entity classes
@@ -802,95 +815,39 @@
public void setRelationshipTypeRole(String relationshipTypeRole)
{
this.relationshipTypeRole = relationshipTypeRole;
+ }
+
+ public IdentityObject createIdentityObject(
+ IdentityStoreInvocationContext invocationCtx, String name,
+ IdentityObjectType identityObjectType) throws IdentityException
+ {
+ return createIdentityObject(invocationCtx, name, identityObjectType, null);
}
-
- /**
- *
- */
- @Inject Instance<EntityManager> entityManagerInstance;
- /**
- *
- */
- @Inject CredentialEncoder credentialEncoder;
-
- public boolean createUser(String username, Credential credential,
- Map<String, ?> attributes) throws IdentityException
+ protected Object lookupIdentityType(String identityType) throws IdentityException
{
try
{
- if (identityClass == null)
- {
- throw new IdentityException("Could not create user, identityObjectEntity not set.");
- }
+ Property<Object> typeNameProp = modelProperties.get(PROPERTY_IDENTITY_TYPE_NAME);
- //if (userExists(username))
- //{
- // log.warn("Could not create user, already exists.");
- //}
-
- Object userInstance = identityClass.newInstance();
- Object credentialInstance = null;
-
- modelProperties.get(PROPERTY_IDENTITY_NAME).setValue(userInstance, username);
-
- Property<Object> identityType = modelProperties.get(PROPERTY_IDENTITY_TYPE);
- if (String.class.equals(identityType.getJavaClass()))
- {
- identityType.setValue(userInstance, userIdentityType);
- }
- else
- {
- identityType.setValue(userInstance, lookupIdentityType(userIdentityType));
- }
-
- if (credentialClass == null)
- {
- modelProperties.get(PROPERTY_CREDENTIAL_VALUE).setValue(userInstance, credential);
- }
- else
- {
- credentialInstance = credentialClass.newInstance();
- // TODO implement this
- //credentialIdentityProperty.setValue(credentialInstance, userInstance);
-
- // TODO need to abstract this out
- modelProperties.get(PROPERTY_CREDENTIAL_VALUE).setValue(credentialInstance, credential);
- if (modelProperties.containsKey(PROPERTY_CREDENTIAL_TYPE))
- {
- // TODO set the credential type - need some kind of mapper?
- //credentialTypeProperty.setValue(credentialInstance, lookupCredentialType)
- }
- }
-
- // TODO create attributes
-
- entityManagerInstance.get().persist(userInstance);
-
- if (credentialInstance != null)
- {
- entityManagerInstance.get().persist(credentialInstance);
- }
+ Object val = entityManagerInstance.get().createQuery(
+ "select t from " + typeNameProp.getDeclaringClass().getName() +
+ " t where t." + typeNameProp.getName() +
+ " = :identityType")
+ .setParameter("identityType", identityType)
+ .getSingleResult();
+ return val;
}
- catch (Exception ex)
+ catch (NoResultException ex)
{
- if (ex instanceof IdentityException)
- {
- throw (IdentityException) ex;
- }
- else
- {
- throw new IdentityException("Could not create user.", ex);
- }
- }
-
- // TODO Auto-generated method stub
- return false;
- }
+ throw new IdentityException("Could not determine identity type [" + identityType + "]");
+ }
+ }
public IdentityObject createIdentityObject(
IdentityStoreInvocationContext invocationCtx, String name,
- IdentityObjectType identityObjectType) throws IdentityException
+ IdentityObjectType identityObjectType, Map<String, String[]> attributes)
+ throws IdentityException
{
try
{
@@ -908,7 +865,13 @@
typeProp.setValue(identityInstance, lookupIdentityType(identityObjectType.getName()));
}
+ beanManager.fireEvent(new PrePersistUserEvent(identityInstance));
+
entityManagerInstance.get().persist(identityInstance);
+
+ beanManager.fireEvent(new UserCreatedEvent(identityInstance));
+
+ // TODO persist attributes
IdentityObject obj = new IdentityObjectImpl(
modelProperties.get(PROPERTY_IDENTITY_ID).getValue(identityInstance).toString(),
@@ -919,45 +882,58 @@
catch (Exception ex)
{
throw new IdentityException("Error creating identity object", ex);
- }
+ }
}
-
- protected Object lookupIdentityType(String identityType) throws IdentityException
- {
+
+ public IdentityObjectRelationship createRelationship(
+ IdentityStoreInvocationContext invocationCxt,
+ IdentityObject fromIdentity, IdentityObject toIdentity,
+ IdentityObjectRelationshipType relationshipType,
+ String relationshipName, boolean createNames) throws IdentityException
+ {
try
{
- Property<Object> typeNameProp = modelProperties.get(PROPERTY_IDENTITY_TYPE_NAME);
+ Object relationship = relationshipClass.newInstance();
- Object val = entityManagerInstance.get().createQuery(
- "select t from " + typeNameProp.getDeclaringClass().getName() +
- " t where t." + typeNameProp.getName() +
- " = :identityType")
- .setParameter("identityType", identityType)
- .getSingleResult();
- return val;
+ modelProperties.get(PROPERTY_RELATIONSHIP_FROM).setValue(relationship,
+ lookupIdentity(fromIdentity));
+ modelProperties.get(PROPERTY_RELATIONSHIP_TO).setValue(relationship,
+ lookupIdentity(toIdentity));
+
+ Property<Object> type = modelProperties.get(PROPERTY_RELATIONSHIP_TYPE);
+ if (String.class.equals(modelProperties.get(PROPERTY_RELATIONSHIP_TYPE).getJavaClass()))
+ {
+ type.setValue(relationship, relationshipType.getName());
+ }
+ else
+ {
+ type.setValue(relationship, lookupRelationshipType(relationshipType));
+ }
+
+ modelProperties.get(PROPERTY_RELATIONSHIP_NAME).setValue(relationship,
+ relationshipName);
+
+ entityManagerInstance.get().persist(relationship);
+
+ return new IdentityObjectRelationshipImpl(fromIdentity, toIdentity,
+ relationshipName, relationshipType);
}
- catch (NoResultException ex)
+ catch (Exception ex)
{
- throw new IdentityException("Could not determine identity type [" + identityType + "]");
- }
+ throw new IdentityException("Exception creating relationship", ex);
+ }
}
-
- public IdentityObject createIdentityObject(
- IdentityStoreInvocationContext invocationCtx, String name,
- IdentityObjectType identityObjectType, Map<String, String[]> attributes)
- throws IdentityException
+
+ protected Object lookupIdentity(IdentityObject obj)
{
- // TODO Auto-generated method stub
+ // TODO implement
return null;
+
}
-
- public IdentityObjectRelationship createRelationship(
- IdentityStoreInvocationContext invocationCxt,
- IdentityObject fromIdentity, IdentityObject toIdentity,
- IdentityObjectRelationshipType relationshipType,
- String relationshipName, boolean createNames) throws IdentityException
+
+ protected Object lookupRelationshipType(IdentityObjectRelationshipType relationshipType)
{
- // TODO Auto-generated method stub
+ // TODO implement
return null;
}
@@ -972,7 +948,36 @@
IdentityStoreInvocationContext invocationContext, String id)
throws IdentityException
{
- // TODO Auto-generated method stub
+ try
+ {
+ Object identity = entityManagerInstance.get().createQuery("select i from " +
+ identityClass.getName() + " i where i." +
+ modelProperties.get(PROPERTY_IDENTITY_ID).getName() +
+ " = :id")
+ .setParameter("id", id)
+ .getSingleResult();
+
+ IdentityObjectType type = modelProperties.containsKey(PROPERTY_IDENTITY_TYPE_NAME) ?
+ new IdentityObjectTypeImpl(
+ modelProperties.get(PROPERTY_IDENTITY_TYPE_NAME).getValue(
+ modelProperties.get(PROPERTY_IDENTITY_TYPE).getValue(identity)).toString()) :
+ new IdentityObjectTypeImpl(modelProperties.get(PROPERTY_IDENTITY_TYPE).getValue(identity).toString());
+
+
+ return new IdentityObjectImpl(
+ modelProperties.get(PROPERTY_IDENTITY_ID).getValue(identity).toString(),
+ modelProperties.get(PROPERTY_IDENTITY_NAME).getValue(identity).toString(),
+ type);
+ }
+ catch (NoResultException ex)
+ {
+ return null;
+ }
+ }
+
+ protected IdentityObjectType convertType(Object obj)
+ {
+ // TODO implement
return null;
}
@@ -980,8 +985,30 @@
IdentityStoreInvocationContext invocationContext, String name,
IdentityObjectType identityObjectType) throws IdentityException
{
- // TODO Auto-generated method stub
- return null;
+ try
+ {
+ Object identityType = modelProperties.containsKey(PROPERTY_IDENTITY_TYPE_NAME) ?
+ lookupIdentityType(identityObjectType.getName()) :
+ identityObjectType.getName();
+
+ Object identity = entityManagerInstance.get().createQuery("select i from " +
+ identityClass.getName() + " i where i." +
+ modelProperties.get(PROPERTY_IDENTITY_NAME).getName() +
+ " = :name and i." + modelProperties.get(PROPERTY_IDENTITY_TYPE).getName() +
+ " = :type")
+ .setParameter("name", name)
+ .setParameter("type", identityType)
+ .getSingleResult();
+
+ return new IdentityObjectImpl(
+ modelProperties.get(PROPERTY_IDENTITY_ID).getValue(identity).toString(),
+ modelProperties.get(PROPERTY_IDENTITY_NAME).getValue(identity).toString(),
+ identityObjectType);
+ }
+ catch (NoResultException ex)
+ {
+ return null;
+ }
}
public Collection<IdentityObject> findIdentityObject(
@@ -989,6 +1016,7 @@
IdentityObjectType identityType, IdentityObjectSearchCriteria criteria)
throws IdentityException
{
+
// TODO Auto-generated method stub
return null;
}
@@ -1227,7 +1255,4 @@
// TODO Auto-generated method stub
return null;
}
-
-
-
}
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/PasswordHashEncoder.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/PasswordHashEncoder.java 2010-06-09 00:20:02 UTC (rev 13087)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/PasswordHashEncoder.java 2010-06-09 02:01:11 UTC (rev 13088)
@@ -10,7 +10,7 @@
* @author Shane Bryzak
*
*/
-public class PasswordHashEncoder implements CredentialEncoder
+public class PasswordHashEncoder implements CredentialProcessor
{
private String passwordHash;
private int passwordIterations = 1000;
14 years
Seam SVN: r13087 - in modules/security/trunk/impl/src/main/java/org/jboss/seam/security: management and 1 other directory.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2010-06-08 20:20:02 -0400 (Tue, 08 Jun 2010)
New Revision: 13087
Added:
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/CredentialProcessor.java
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityObjectImpl.java
Removed:
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityManagementException.java
Modified:
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/JpaTokenStore.java
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java
Log:
start implementing IdentityStore API methods
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/JpaTokenStore.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/JpaTokenStore.java 2010-06-08 19:40:12 UTC (rev 13086)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/JpaTokenStore.java 2010-06-09 00:20:02 UTC (rev 13087)
@@ -12,7 +12,6 @@
import org.jboss.seam.security.annotations.TokenUsername;
import org.jboss.seam.security.annotations.TokenValue;
-import org.jboss.seam.security.management.IdentityManagementException;
import org.jboss.weld.extensions.util.properties.Property;
/**
@@ -71,14 +70,7 @@
}
catch (Exception ex)
{
- if (ex instanceof IdentityManagementException)
- {
- throw (IdentityManagementException) ex;
- }
- else
- {
- throw new IdentityManagementException("Could not create account", ex);
- }
+ throw new RuntimeException("Could not create token", ex);
}
}
Added: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/CredentialProcessor.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/CredentialProcessor.java (rev 0)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/CredentialProcessor.java 2010-06-09 00:20:02 UTC (rev 13087)
@@ -0,0 +1,25 @@
+package org.jboss.seam.security.management;
+
+import java.util.Map;
+
+import org.picketlink.idm.api.Credential;
+
+/**
+ * Encodes credentials to be stored in persistent storage
+ *
+ * @author Shane Bryzak
+ */
+public interface CredentialProcessor
+{
+ /**
+ * Encodes the specified credential and returns a String representation of
+ * the encoded result.
+ *
+ * @param credential The credential to encode
+ * @param options Encoding options
+ * @return The encoded credential
+ */
+ String encode(Credential credential, Map<String,Object> options);
+
+ //boolean validate(Credential credential);
+}
Deleted: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityManagementException.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityManagementException.java 2010-06-08 19:40:12 UTC (rev 13086)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityManagementException.java 2010-06-09 00:20:02 UTC (rev 13087)
@@ -1,21 +0,0 @@
-package org.jboss.seam.security.management;
-
-/**
- * Thrown when an exception is encountered during account creation.
- *
- * @author Shane Bryzak
- */
-public class IdentityManagementException extends RuntimeException
-{
- private static final long serialVersionUID = -8682163627028954352L;
-
- public IdentityManagementException(String message)
- {
- super(message);
- }
-
- public IdentityManagementException(String message, Throwable cause)
- {
- super(message, cause);
- }
-}
Added: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityObjectImpl.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityObjectImpl.java (rev 0)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityObjectImpl.java 2010-06-09 00:20:02 UTC (rev 13087)
@@ -0,0 +1,48 @@
+package org.jboss.seam.security.management;
+
+import java.io.Serializable;
+
+import org.picketlink.idm.common.exception.PolicyValidationException;
+import org.picketlink.idm.spi.model.IdentityObject;
+import org.picketlink.idm.spi.model.IdentityObjectType;
+
+/**
+ * Based implementation of IdentityObject
+ *
+ * @author Shane Bryzak
+ */
+public class IdentityObjectImpl implements IdentityObject, Serializable
+{
+ private static final long serialVersionUID = -7880202628037808071L;
+
+ private String id;
+ private String name;
+ private IdentityObjectType type;
+
+ public IdentityObjectImpl(String id, String name, IdentityObjectType type)
+ {
+ this.id = id;
+ this.name = name;
+ this.type = type;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public IdentityObjectType getIdentityType()
+ {
+ return type;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void validatePolicy() throws PolicyValidationException
+ {
+
+ }
+}
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java 2010-06-08 19:40:12 UTC (rev 13086)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java 2010-06-09 00:20:02 UTC (rev 13087)
@@ -14,11 +14,13 @@
import javax.inject.Inject;
import javax.persistence.Entity;
import javax.persistence.EntityManager;
+import javax.persistence.Id;
import javax.persistence.NoResultException;
import org.jboss.seam.security.annotations.management.IdentityProperty;
import org.jboss.seam.security.annotations.management.PropertyType;
import org.jboss.weld.extensions.util.properties.Property;
+import org.jboss.weld.extensions.util.properties.query.AnnotatedPropertyCriteria;
import org.jboss.weld.extensions.util.properties.query.NamedPropertyCriteria;
import org.jboss.weld.extensions.util.properties.query.PropertyCriteria;
import org.jboss.weld.extensions.util.properties.query.PropertyQueries;
@@ -69,6 +71,7 @@
// Property keys
+ private static final String PROPERTY_IDENTITY_ID = "IDENTITY_ID";
private static final String PROPERTY_IDENTITY_NAME = "IDENTITY_NAME";
private static final String PROPERTY_IDENTITY_TYPE = "IDENTITY_TYPE";
private static final String PROPERTY_IDENTITY_TYPE_NAME = "IDENTITY_TYPE_NAME";
@@ -128,31 +131,45 @@
{
return m.isAnnotationPresent(IdentityProperty.class) &&
m.getAnnotation(IdentityProperty.class).value().equals(pt);
+ }
+ }
+
+ public void bootstrap(IdentityStoreConfigurationContext configurationContext)
+ throws IdentityException
+ {
+ if (identityClass == null)
+ {
+ throw new IdentityException(
+ "Error initializing JpaIdentityStore - identityClass not set");
}
- }
-
- @Inject
- public void init()
- {
+ configureIdentityId();
configureIdentityName();
configureIdentityType();
- //configureCredentials();
- //configureRelationships();
- //configureAttributes();
+ configureCredentials();
+ configureRelationships();
+ configureAttributes();
+ }
+
+ protected void configureIdentityId() throws IdentityException
+ {
+ List<Property<Object>> props = PropertyQueries.createQuery(identityClass)
+ .addCriteria(new AnnotatedPropertyCriteria(Id.class))
+ .getResultList();
- //roleTypeNameProperty = new EntityProperty(roleTypeEntity, PropertyType.NAME);
- }
-
- protected void configureIdentityName()
- {
- if (identityClass == null)
+ if (props.size() == 1)
{
- throw new IdentityManagementException(
- "Error initializing JpaIdentityStore - identityClass not set");
+ modelProperties.put(PROPERTY_IDENTITY_ID, props.get(0));
}
+ else
+ {
+ throw new IdentityException("Error initializing JpaIdentityStore - no Identity ID found.");
+ }
+ }
+ protected void configureIdentityName() throws IdentityException
+ {
List<Property<Object>> props = PropertyQueries.createQuery(identityClass)
.addCriteria(new PropertyTypeCriteria(PropertyType.NAME))
.getResultList();
@@ -163,7 +180,7 @@
}
else if (props.size() > 1)
{
- throw new IdentityManagementException(
+ throw new IdentityException(
"Ambiguous identity name property in identity class " + identityClass.getName());
}
else
@@ -189,11 +206,11 @@
if (!modelProperties.containsKey(PROPERTY_IDENTITY_NAME))
{
- throw new IdentityManagementException("Error initializing JpaIdentityStore - no valid identity name property found.");
+ throw new IdentityException("Error initializing JpaIdentityStore - no valid identity name property found.");
}
}
- protected void configureIdentityType()
+ protected void configureIdentityType() throws IdentityException
{
List<Property<Object>> props = PropertyQueries.createQuery(identityClass)
.addCriteria(new PropertyTypeCriteria(PropertyType.TYPE))
@@ -205,7 +222,7 @@
}
else if (props.size() > 1)
{
- throw new IdentityManagementException(
+ throw new IdentityException(
"Ambiguous identity type property in identity class " + identityClass.getName());
}
else
@@ -246,7 +263,7 @@
if (typeProp == null)
{
- throw new IdentityManagementException("Error initializing JpaIdentityStore - no valid identity type property found.");
+ throw new IdentityException("Error initializing JpaIdentityStore - no valid identity type property found.");
}
if (!String.class.equals(typeProp.getJavaClass()) &&
@@ -261,7 +278,7 @@
}
else
{
- throw new IdentityManagementException("Error initializing JpaIdentityStore - no valid identity type name property found.");
+ throw new IdentityException("Error initializing JpaIdentityStore - no valid identity type name property found.");
}
}
}
@@ -296,7 +313,7 @@
return null;
}
- protected void configureCredentials()
+ protected void configureCredentials() throws IdentityException
{
// If a credential entity has been explicitly configured, scan it
if (credentialClass != null)
@@ -311,7 +328,7 @@
}
else if (props.size() > 1)
{
- throw new IdentityManagementException(
+ throw new IdentityException(
"Ambiguous credential value property in credential class " +
credentialClass.getName());
}
@@ -327,7 +344,7 @@
}
else if (props.size() > 1)
{
- throw new IdentityManagementException(
+ throw new IdentityException(
"Ambiguous credential value property in credential class " +
credentialClass.getName());
}
@@ -352,7 +369,7 @@
}
else if (props.size() > 1)
{
- throw new IdentityManagementException(
+ throw new IdentityException(
"Ambiguous credential property in identity class " +
identityClass.getName());
}
@@ -366,7 +383,7 @@
if (!modelProperties.containsKey(PROPERTY_CREDENTIAL_VALUE))
{
- throw new IdentityManagementException("Error initializing JpaIdentityStore - no credential value property found.");
+ throw new IdentityException("Error initializing JpaIdentityStore - no credential value property found.");
}
// Scan for a credential type property
@@ -380,7 +397,7 @@
}
else if (props.size() > 1)
{
- throw new IdentityManagementException(
+ throw new IdentityException(
"Ambiguous credential type property in credential class " +
credentialClass.getName());
}
@@ -396,7 +413,7 @@
}
else if (props.size() > 1)
{
- throw new IdentityManagementException(
+ throw new IdentityException(
"Ambiguous credential type property in credential class " +
credentialClass.getName());
}
@@ -421,16 +438,16 @@
}
else
{
- throw new IdentityManagementException("Error initializing JpaIdentityStore - no valid credential type name property found.");
+ throw new IdentityException("Error initializing JpaIdentityStore - no valid credential type name property found.");
}
}
}
- protected void configureRelationships()
+ protected void configureRelationships() throws IdentityException
{
if (relationshipClass == null)
{
- throw new IdentityManagementException("Error initializing JpaIdentityStore - relationshipClass not set.");
+ throw new IdentityException("Error initializing JpaIdentityStore - relationshipClass not set.");
}
List<Property<Object>> props = PropertyQueries.createQuery(relationshipClass)
@@ -444,7 +461,7 @@
}
else if (props.size() > 1)
{
- throw new IdentityManagementException(
+ throw new IdentityException(
"Ambiguous relationshipFrom property in relationship class " +
relationshipClass.getName());
}
@@ -487,7 +504,7 @@
}
else if (props.size() > 1)
{
- throw new IdentityManagementException(
+ throw new IdentityException(
"Ambiguous relationshipTo property in relationship class " +
relationshipClass.getName());
}
@@ -527,7 +544,7 @@
}
else if (props.size() > 1)
{
- throw new IdentityManagementException(
+ throw new IdentityException(
"Ambiguous relationshipType property in relationship class " +
relationshipClass.getName());
}
@@ -565,7 +582,7 @@
}
else if (props.size() > 1)
{
- throw new IdentityManagementException(
+ throw new IdentityException(
"Ambiguous relationship name property in relationship class " +
relationshipClass.getName());
}
@@ -581,25 +598,25 @@
if (!modelProperties.containsKey(PROPERTY_RELATIONSHIP_FROM))
{
- throw new IdentityManagementException(
+ throw new IdentityException(
"Error initializing JpaIdentityStore - no valid relationship from property found.");
}
if (!modelProperties.containsKey(PROPERTY_RELATIONSHIP_TO))
{
- throw new IdentityManagementException(
+ throw new IdentityException(
"Error initializing JpaIdentityStore - no valid relationship to property found.");
}
if (!modelProperties.containsKey(PROPERTY_RELATIONSHIP_TYPE))
{
- throw new IdentityManagementException(
+ throw new IdentityException(
"Error initializing JpaIdentityStore - no valid relationship type property found.");
}
if (!modelProperties.containsKey(PROPERTY_RELATIONSHIP_NAME))
{
- throw new IdentityManagementException(
+ throw new IdentityException(
"Error initializing JpaIdentityStore - no valid relationship name property found.");
}
@@ -617,7 +634,7 @@
}
else if (props.size() > 1)
{
- throw new IdentityManagementException(
+ throw new IdentityException(
"Ambiguous relationship type name property in class " +
typeClass.getName());
}
@@ -633,13 +650,13 @@
if (!modelProperties.containsKey(PROPERTY_RELATIONSHIP_TYPE_NAME))
{
- throw new IdentityManagementException(
+ throw new IdentityException(
"Error initializing JpaIdentityStore - no valid relationship type name property found");
}
}
}
- protected void configureAttributes()
+ protected void configureAttributes() throws IdentityException
{
// If an attribute class has been configured, scan it for attributes
if (attributeClass != null)
@@ -655,7 +672,7 @@
}
else if (props.size() > 1)
{
- throw new IdentityManagementException(
+ throw new IdentityException(
"Ambiguous attribute name property in class " +
attributeClass.getName());
}
@@ -676,7 +693,7 @@
}
else if (props.size() > 1)
{
- throw new IdentityManagementException(
+ throw new IdentityException(
"Ambiguous attribute value property in class " +
attributeClass.getName());
}
@@ -798,13 +815,13 @@
@Inject CredentialEncoder credentialEncoder;
public boolean createUser(String username, Credential credential,
- Map<String, ?> attributes)
+ Map<String, ?> attributes) throws IdentityException
{
try
{
if (identityClass == null)
{
- throw new IdentityManagementException("Could not create user, identityObjectEntity not set.");
+ throw new IdentityException("Could not create user, identityObjectEntity not set.");
}
//if (userExists(username))
@@ -857,27 +874,63 @@
}
catch (Exception ex)
{
- if (ex instanceof IdentityManagementException)
+ if (ex instanceof IdentityException)
{
- throw (IdentityManagementException) ex;
+ throw (IdentityException) ex;
}
else
{
- throw new IdentityManagementException("Could not create user.", ex);
+ throw new IdentityException("Could not create user.", ex);
}
}
// TODO Auto-generated method stub
return false;
}
-
- private Object lookupIdentityType(String identityType)
+
+ public IdentityObject createIdentityObject(
+ IdentityStoreInvocationContext invocationCtx, String name,
+ IdentityObjectType identityObjectType) throws IdentityException
{
try
{
+ Object identityInstance = identityClass.newInstance();
+ modelProperties.get(PROPERTY_IDENTITY_NAME).setValue(identityInstance, name);
+
+ Property<Object> typeProp = modelProperties.get(PROPERTY_IDENTITY_TYPE);
+
+ if (String.class.equals(typeProp.getJavaClass()))
+ {
+ typeProp.setValue(identityInstance, identityObjectType.getName());
+ }
+ else
+ {
+ typeProp.setValue(identityInstance, lookupIdentityType(identityObjectType.getName()));
+ }
+
+ entityManagerInstance.get().persist(identityInstance);
+
+ IdentityObject obj = new IdentityObjectImpl(
+ modelProperties.get(PROPERTY_IDENTITY_ID).getValue(identityInstance).toString(),
+ name, identityObjectType);
+
+ return obj;
+ }
+ catch (Exception ex)
+ {
+ throw new IdentityException("Error creating identity object", ex);
+ }
+ }
+
+ protected Object lookupIdentityType(String identityType) throws IdentityException
+ {
+ try
+ {
+ Property<Object> typeNameProp = modelProperties.get(PROPERTY_IDENTITY_TYPE_NAME);
+
Object val = entityManagerInstance.get().createQuery(
- "select t from " + identityClass.getName() + " t where t." +
- modelProperties.get(PROPERTY_IDENTITY_TYPE_NAME).getName() +
+ "select t from " + typeNameProp.getDeclaringClass().getName() +
+ " t where t." + typeNameProp.getName() +
" = :identityType")
.setParameter("identityType", identityType)
.getSingleResult();
@@ -885,27 +938,12 @@
}
catch (NoResultException ex)
{
- return null;
- }
+ throw new IdentityException("Could not determine identity type [" + identityType + "]");
+ }
}
- public void bootstrap(IdentityStoreConfigurationContext configurationContext)
- throws IdentityException
- {
- // TODO Auto-generated method stub
-
- }
-
public IdentityObject createIdentityObject(
IdentityStoreInvocationContext invocationCtx, String name,
- IdentityObjectType identityObjectType) throws IdentityException
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public IdentityObject createIdentityObject(
- IdentityStoreInvocationContext invocationCtx, String name,
IdentityObjectType identityObjectType, Map<String, String[]> attributes)
throws IdentityException
{
14 years
Seam SVN: r13086 - branches/enterprise/JBPAPP_5_0/build.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-06-08 15:40:12 -0400 (Tue, 08 Jun 2010)
New Revision: 13086
Modified:
branches/enterprise/JBPAPP_5_0/build/settings.xml
Log:
added maven2-brew repository as mirrored
Modified: branches/enterprise/JBPAPP_5_0/build/settings.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/build/settings.xml 2010-06-08 17:01:39 UTC (rev 13085)
+++ branches/enterprise/JBPAPP_5_0/build/settings.xml 2010-06-08 19:40:12 UTC (rev 13086)
@@ -168,6 +168,12 @@
<url>http://my.repository.com/repo/path</url>
</mirror>
-->
+ <mirror>
+ <id>fake.mirror.of.central</id>
+ <mirrorOf>central</mirrorOf>
+ <name>Fake mirror of central - reroutes central to repository.jboss.org</name>
+ <url>http://repository.jboss.org/maven2-brew</url>
+ </mirror>
</mirrors>
14 years
Seam SVN: r13085 - dist/trunk.
by seam-commits@lists.jboss.org
Author: tsurdilovic
Date: 2010-06-08 13:01:39 -0400 (Tue, 08 Jun 2010)
New Revision: 13085
Modified:
dist/trunk/pom.xml
Log:
Moved Drools to 5.1.0.M2
Modified: dist/trunk/pom.xml
===================================================================
--- dist/trunk/pom.xml 2010-06-08 15:33:47 UTC (rev 13084)
+++ dist/trunk/pom.xml 2010-06-08 17:01:39 UTC (rev 13085)
@@ -70,7 +70,7 @@
<jms.api.version>1.1</jms.api.version>
<hibernate.version>3.5.1-Final</hibernate.version>
- <drools.version>5.1.0.M1</drools.version>
+ <drools.version>5.1.0.M2</drools.version>
<jbpm.version>4.2</jbpm.version>
<picketlink.idm.version>1.1.2.CR01</picketlink.idm.version>
<joda.time.version>1.6</joda.time.version>
14 years