Author: bdaw
Date: 2008-09-10 07:29:05 -0400 (Wed, 10 Sep 2008)
New Revision: 65
Added:
trunk/identity-api/src/main/java/org/jboss/identity/api/IdentityAttribute.java
trunk/identity-api/src/main/java/org/jboss/identity/api/IdentityType.java
trunk/identity-api/src/main/java/org/jboss/identity/api/RelationshipType.java
trunk/identity-api/src/main/java/org/jboss/identity/api/Role.java
trunk/identity-api/src/main/java/org/jboss/identity/api/RoleType.java
trunk/identity-api/src/main/java/org/jboss/identity/api/RoleTypeEnum.java
trunk/identity-api/src/main/java/org/jboss/identity/api/SimpleGroupType.java
trunk/identity-api/src/main/java/org/jboss/identity/api/domain/
trunk/identity-api/src/main/java/org/jboss/identity/api/relation/
trunk/identity-common/
trunk/identity-common/pom.xml
trunk/identity-common/src/
trunk/identity-common/src/main/
trunk/identity-common/src/main/java/
trunk/identity-common/src/main/java/org/
trunk/identity-common/src/main/java/org/jboss/
trunk/identity-common/src/main/java/org/jboss/identity/
trunk/identity-common/src/main/java/org/jboss/identity/exception/
trunk/identity-common/src/main/java/org/jboss/identity/exception/IdentityException.java
trunk/identity-common/src/main/java/org/jboss/identity/exception/PolicyValidationException.java
trunk/identity-common/src/main/resources/
trunk/identity-common/src/test/
trunk/identity-common/src/test/java/
trunk/identity-common/src/test/java/org/
trunk/identity-common/src/test/java/org/jboss/
trunk/identity-common/src/test/java/org/jboss/test/
trunk/identity-common/src/test/java/org/jboss/test/identity/
trunk/identity-common/src/test/resources/
trunk/identity-model/src/main/java/org/jboss/identity/model/core/
trunk/identity-model/src/main/java/org/jboss/identity/model/core/IdentityObject.java
trunk/identity-model/src/main/java/org/jboss/identity/model/core/IdentityObjectAttribute.java
trunk/identity-model/src/main/java/org/jboss/identity/model/core/IdentityObjectRelationship.java
trunk/identity-model/src/main/java/org/jboss/identity/model/core/IdentityObjectRelationshipType.java
trunk/identity-model/src/main/java/org/jboss/identity/model/core/IdentityObjectType.java
trunk/identity-spi/
trunk/identity-spi/pom.xml
trunk/identity-spi/src/
trunk/identity-spi/src/main/
trunk/identity-spi/src/main/java/
trunk/identity-spi/src/main/java/org/
trunk/identity-spi/src/main/java/org/jboss/
trunk/identity-spi/src/main/java/org/jboss/identity/
trunk/identity-spi/src/main/java/org/jboss/identity/spi/
trunk/identity-spi/src/main/java/org/jboss/identity/spi/exception/
trunk/identity-spi/src/main/java/org/jboss/identity/spi/exception/IdentityTypeNotSupportedException.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/policy/
trunk/identity-spi/src/main/java/org/jboss/identity/spi/policy/IdentityTypePolicy.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/policy/PasswordExpirationPolicy.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/policy/RelationshipPolicy.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/repository/
trunk/identity-spi/src/main/java/org/jboss/identity/spi/repository/IdentityStoreRepository.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/FeaturesDescription.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/IdentityStore.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/OperationType.java
trunk/identity-spi/src/main/resources/
trunk/identity-spi/src/test/
trunk/identity-spi/src/test/java/
trunk/identity-spi/src/test/java/org/
trunk/identity-spi/src/test/java/org/jboss/
trunk/identity-spi/src/test/java/org/jboss/test/
trunk/identity-spi/src/test/java/org/jboss/test/identity/
trunk/identity-spi/src/test/resources/
Removed:
trunk/identity-api/src/main/java/org/jboss/identity/api/exception/IdentityException.java
trunk/identity-api/src/main/java/org/jboss/identity/api/exception/IdentityTypeNotSupportedException.java
trunk/identity-api/src/main/java/org/jboss/identity/api/managers/PersistenceManager.java
trunk/identity-api/src/main/java/org/jboss/identity/api/relation/RelationshipType.java
trunk/identity-api/src/main/java/org/jboss/identity/api/store/FeaturesDescription.java
trunk/identity-api/src/main/java/org/jboss/identity/api/store/IdentityStore.java
trunk/identity-api/src/main/java/org/jboss/identity/api/store/IdentityStoreRepository.java
trunk/identity-api/src/main/java/org/jboss/identity/api/store/OperationType.java
trunk/identity-model/src/main/java/org/jboss/identity/model/Identity.java
trunk/identity-model/src/main/java/org/jboss/identity/model/IdentityAttribute.java
trunk/identity-model/src/main/java/org/jboss/identity/model/IdentityType.java
trunk/identity-model/src/main/java/org/jboss/identity/model/IdentityTypeEnum.java
trunk/identity-model/src/main/java/org/jboss/identity/model/domain/
trunk/identity-model/src/main/java/org/jboss/identity/model/groups/SimpleGroupType.java
trunk/identity-model/src/main/java/org/jboss/identity/model/relation/RelationshipType.java
trunk/identity-model/src/main/java/org/jboss/identity/model/roles/RoleType.java
trunk/identity-model/src/main/java/org/jboss/identity/model/roles/RoleTypeEnum.java
Modified:
trunk/identity-api/pom.xml
trunk/identity-api/src/main/java/org/jboss/identity/api/domain/ModelRoot.java
trunk/identity-api/src/main/java/org/jboss/identity/api/domain/Realm.java
trunk/identity-api/src/main/java/org/jboss/identity/api/domain/SimpleModelRoot.java
trunk/identity-api/src/main/java/org/jboss/identity/api/exception/PersistenceManagerNotFoundException.java
trunk/identity-api/src/main/java/org/jboss/identity/api/exception/SessionNotOpenException.java
trunk/identity-api/src/main/java/org/jboss/identity/api/managers/IdentityManager.java
trunk/identity-api/src/main/java/org/jboss/identity/api/relation/HierarchicalRelationshipType.java
trunk/identity-api/src/main/java/org/jboss/identity/api/session/Session.java
trunk/identity-impl/pom.xml
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/FileBasedIdentityStore.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleGroup.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleIdentity.java
trunk/identity-model/pom.xml
trunk/identity-model/src/main/java/org/jboss/identity/model/attribute/PasswordAttribute.java
trunk/parent/pom.xml
trunk/pom.xml
Log:
- Separate API from SPI
- Two models - core (abstract) model on the SPI side and Identity/Role/Group interfaces in
API
Modified: trunk/identity-api/pom.xml
===================================================================
--- trunk/identity-api/pom.xml 2008-09-05 10:09:37 UTC (rev 64)
+++ trunk/identity-api/pom.xml 2008-09-10 11:29:05 UTC (rev 65)
@@ -29,7 +29,7 @@
<dependencies>
<dependency>
<groupId>org.jboss.identity</groupId>
- <artifactId>jboss-identity-model</artifactId>
+ <artifactId>jboss-identity-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
Added: trunk/identity-api/src/main/java/org/jboss/identity/api/IdentityAttribute.java
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api/IdentityAttribute.java
(rev 0)
+++
trunk/identity-api/src/main/java/org/jboss/identity/api/IdentityAttribute.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -0,0 +1,32 @@
+/*
+* 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.api;
+
+/**
+ * An attribute of an identity
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Jun 30, 2008
+ */
+public interface IdentityAttribute
+{
+}
Added: trunk/identity-api/src/main/java/org/jboss/identity/api/IdentityType.java
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api/IdentityType.java
(rev 0)
+++ trunk/identity-api/src/main/java/org/jboss/identity/api/IdentityType.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -0,0 +1,61 @@
+/*
+* 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.api;
+
+import org.jboss.identity.exception.PolicyValidationException;
+
+import java.util.List;
+
+/**
+ * Marker Interface representing
+ * an object of the Identity Model
+ * @author Anil.Saldhana(a)redhat.com
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @since Jul 10, 2008
+ */
+public interface IdentityType
+{
+
+ /**
+ * @return id of this identity object
+ */
+ Object getId();
+
+ /**
+ * <p>Return the name of the identity</p>
+ * @return
+ */
+ String getName();
+
+ /**
+ * <p>Return a list of attributes</p>
+ * @return
+ */
+ List<IdentityAttribute> getAttributes();
+
+ /**
+ * Validate configured Policies
+ * @throws org.jboss.identity.exception.PolicyValidationException
+ */
+ void validatePolicy() throws PolicyValidationException;
+}
\ No newline at end of file
Added: trunk/identity-api/src/main/java/org/jboss/identity/api/RelationshipType.java
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api/RelationshipType.java
(rev 0)
+++
trunk/identity-api/src/main/java/org/jboss/identity/api/RelationshipType.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -0,0 +1,34 @@
+/*
+* 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.api;
+
+/**
+ * Defines a <b>relationship</b> between groups, domains etc
+ * @author Anil.Saldhana(a)redhat.com
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @since Jul 9, 2008
+ */
+public interface RelationshipType
+{
+ String getName();
+}
Added: trunk/identity-api/src/main/java/org/jboss/identity/api/Role.java
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api/Role.java
(rev 0)
+++ trunk/identity-api/src/main/java/org/jboss/identity/api/Role.java 2008-09-10 11:29:05
UTC (rev 65)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.api;
+
+import org.jboss.identity.api.RoleType;
+
+
+/**
+ * Marker Interface represents a role
+ * @author Anil.Saldhana(a)redhat.com
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @since Jun 30, 2008
+ */
+public interface Role extends IdentityType
+{
+
+ /**
+ * @return group display name
+ */
+ String getDisplayName();
+
+ /**
+ * @return description
+ */
+ String getDescription();
+
+ /**
+ * @return group type
+ */
+ RoleType getRoleType();
+
+}
\ No newline at end of file
Copied: trunk/identity-api/src/main/java/org/jboss/identity/api/RoleType.java (from rev
64, trunk/identity-model/src/main/java/org/jboss/identity/model/roles/RoleType.java)
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api/RoleType.java
(rev 0)
+++ trunk/identity-api/src/main/java/org/jboss/identity/api/RoleType.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.api;
+
+
+/**
+ * Type of Role
+ * @author Anil.Saldhana(a)redhat.com
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @since Jun 30, 2008
+ */
+public interface RoleType
+{
+
+ /**
+ * @return role type name
+ */
+ String getName();
+
+}
\ No newline at end of file
Copied: trunk/identity-api/src/main/java/org/jboss/identity/api/RoleTypeEnum.java (from
rev 64,
trunk/identity-model/src/main/java/org/jboss/identity/model/roles/RoleTypeEnum.java)
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api/RoleTypeEnum.java
(rev 0)
+++ trunk/identity-api/src/main/java/org/jboss/identity/api/RoleTypeEnum.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -0,0 +1,58 @@
+/*
+* 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.api;
+
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @author Anil.Saldhana(a)redhat.com
+ * @version : 0.1 $
+ */
+public enum RoleTypeEnum implements RoleType
+{
+ /**
+ * Plain Role
+ */
+ ROLE_REGULAR,
+ /**
+ * A role that is nested within another
+ */
+ ROLE_NESTED,
+ /**
+ * A role that is part of an hierarchy
+ * (Eg. LDAP Role)
+ */
+ ROLE_HIERARCHICAL,
+ /**
+ * Custom Role
+ */
+ ROLE_CUSTOM;
+
+
+ public String getName()
+ {
+ return this.name();
+ }
+
+}
Copied: trunk/identity-api/src/main/java/org/jboss/identity/api/SimpleGroupType.java (from
rev 62,
trunk/identity-model/src/main/java/org/jboss/identity/model/groups/SimpleGroupType.java)
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api/SimpleGroupType.java
(rev 0)
+++
trunk/identity-api/src/main/java/org/jboss/identity/api/SimpleGroupType.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.api;
+
+/**
+ * Simple Implementation of Group Type
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Jul 22, 2008
+ */
+public class SimpleGroupType implements GroupType
+{
+ protected String name;
+
+ public SimpleGroupType(String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * @see GroupType#getName()
+ */
+ public String getName()
+ {
+ return null;
+ }
+
+ @Override
+ public String toString()
+ {
+ StringBuilder builder = new StringBuilder("Group[");
+ builder.append(name).append("]");
+ return builder.toString();
+ }
+}
Copied: trunk/identity-api/src/main/java/org/jboss/identity/api/domain (from rev 46,
trunk/identity-model/src/main/java/org/jboss/identity/model/domain)
Modified: trunk/identity-api/src/main/java/org/jboss/identity/api/domain/ModelRoot.java
===================================================================
---
trunk/identity-model/src/main/java/org/jboss/identity/model/domain/ModelRoot.java 2008-08-30
11:18:48 UTC (rev 46)
+++
trunk/identity-api/src/main/java/org/jboss/identity/api/domain/ModelRoot.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.identity.model.domain;
+package org.jboss.identity.api.domain;
/**
* Represents the root of a particular
Modified: trunk/identity-api/src/main/java/org/jboss/identity/api/domain/Realm.java
===================================================================
---
trunk/identity-model/src/main/java/org/jboss/identity/model/domain/Realm.java 2008-08-30
11:18:48 UTC (rev 46)
+++ trunk/identity-api/src/main/java/org/jboss/identity/api/domain/Realm.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.identity.model.domain;
+package org.jboss.identity.api.domain;
/**
* <p>The <b>realm</b> under which the various models and policies
Modified:
trunk/identity-api/src/main/java/org/jboss/identity/api/domain/SimpleModelRoot.java
===================================================================
---
trunk/identity-model/src/main/java/org/jboss/identity/model/domain/SimpleModelRoot.java 2008-08-30
11:18:48 UTC (rev 46)
+++
trunk/identity-api/src/main/java/org/jboss/identity/api/domain/SimpleModelRoot.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.identity.model.domain;
+package org.jboss.identity.api.domain;
/**
* Simple Implementation of Model Root
Deleted:
trunk/identity-api/src/main/java/org/jboss/identity/api/exception/IdentityException.java
===================================================================
---
trunk/identity-api/src/main/java/org/jboss/identity/api/exception/IdentityException.java 2008-09-05
10:09:37 UTC (rev 64)
+++
trunk/identity-api/src/main/java/org/jboss/identity/api/exception/IdentityException.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -1,54 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.api.exception;
-
-import java.security.GeneralSecurityException;
-
-/**
- * <p>Identity Exception</p>
- * @author Anil.Saldhana(a)redhat.com
- * @since Jul 10, 2008
- */
-public class IdentityException extends GeneralSecurityException
-{
- private static final long serialVersionUID = 1L;
-
- public IdentityException()
- {
- super();
- }
-
- public IdentityException(String message, Throwable cause)
- {
- super(message, cause);
- }
-
- public IdentityException(String msg)
- {
- super(msg);
- }
-
- public IdentityException(Throwable cause)
- {
- super(cause);
- }
-}
\ No newline at end of file
Deleted:
trunk/identity-api/src/main/java/org/jboss/identity/api/exception/IdentityTypeNotSupportedException.java
===================================================================
---
trunk/identity-api/src/main/java/org/jboss/identity/api/exception/IdentityTypeNotSupportedException.java 2008-09-05
10:09:37 UTC (rev 64)
+++
trunk/identity-api/src/main/java/org/jboss/identity/api/exception/IdentityTypeNotSupportedException.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -1,34 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.api.exception;
-
-/**
- * <p>Represents an exception that
- * the corresponding IdentityType is
- * not supported</p>
- * @author Anil.Saldhana(a)redhat.com
- * @since Jul 10, 2008
- */
-public class IdentityTypeNotSupportedException extends IdentityException
-{
- private static final long serialVersionUID = 1L;
-}
Modified:
trunk/identity-api/src/main/java/org/jboss/identity/api/exception/PersistenceManagerNotFoundException.java
===================================================================
---
trunk/identity-api/src/main/java/org/jboss/identity/api/exception/PersistenceManagerNotFoundException.java 2008-09-05
10:09:37 UTC (rev 64)
+++
trunk/identity-api/src/main/java/org/jboss/identity/api/exception/PersistenceManagerNotFoundException.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -21,6 +21,8 @@
*/
package org.jboss.identity.api.exception;
+import org.jboss.identity.exception.IdentityException;
+
/**
* Exception indicating the non-availability
* of a Persistence Manager
Modified:
trunk/identity-api/src/main/java/org/jboss/identity/api/exception/SessionNotOpenException.java
===================================================================
---
trunk/identity-api/src/main/java/org/jboss/identity/api/exception/SessionNotOpenException.java 2008-09-05
10:09:37 UTC (rev 64)
+++
trunk/identity-api/src/main/java/org/jboss/identity/api/exception/SessionNotOpenException.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -21,6 +21,8 @@
*/
package org.jboss.identity.api.exception;
+import org.jboss.identity.exception.IdentityException;
+
/**
* Exception indicating that no session
* is open
Modified:
trunk/identity-api/src/main/java/org/jboss/identity/api/managers/IdentityManager.java
===================================================================
---
trunk/identity-api/src/main/java/org/jboss/identity/api/managers/IdentityManager.java 2008-09-05
10:09:37 UTC (rev 64)
+++
trunk/identity-api/src/main/java/org/jboss/identity/api/managers/IdentityManager.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -23,18 +23,11 @@
import java.io.InputStream;
-import org.jboss.identity.api.exception.IdentityException;
import org.jboss.identity.api.exception.PersistenceManagerNotFoundException;
import org.jboss.identity.api.exception.SessionNotOpenException;
import org.jboss.identity.api.session.Session;
-import org.jboss.identity.api.store.IdentityStoreRepository;
-import org.jboss.identity.model.Identity;
-import org.jboss.identity.model.relation.RelationshipType;
-import org.jboss.identity.model.roles.Role;
-import org.jboss.identity.model.roles.RoleType;
-import org.jboss.identity.model.domain.Realm;
-import org.jboss.identity.model.groups.Group;
-import org.jboss.identity.model.groups.GroupType;
+import org.jboss.identity.api.domain.Realm;
+import org.jboss.identity.api.RelationshipType;
/**
* Performs Operations associated with a Realm
Deleted:
trunk/identity-api/src/main/java/org/jboss/identity/api/managers/PersistenceManager.java
===================================================================
---
trunk/identity-api/src/main/java/org/jboss/identity/api/managers/PersistenceManager.java 2008-09-05
10:09:37 UTC (rev 64)
+++
trunk/identity-api/src/main/java/org/jboss/identity/api/managers/PersistenceManager.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -1,55 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.api.managers;
-
-import org.jboss.identity.api.store.IdentityStore;
-import org.jboss.identity.api.store.IdentityStoreRepository;
-import org.jboss.identity.model.IdentityObjectType;
-import org.jboss.identity.model.domain.Realm;
-
-/**
- * Manages the Identity Stores
- * @author Anil.Saldhana(a)redhat.com
- * @author boleslaw dot dawidowicz at redhat anotherdot com
- * @since Jul 10, 2008
- */
-public interface PersistenceManager
-{
-
- /**
- * <p>Get the IdentityStoreRepository configured for a realm</p>
- * @param realm
- * @return
- */
- IdentityStoreRepository getIdentityStoreRepository(Realm realm);
-
- /**
- * <p>Get the Identity Store configured for an identity type
- * at the realm level </p>
- * <p>May retrun null if given identity type is not mapped in this
realm</p>
- * @param realm
- * @param identityObjectType
- * @return
- */
- IdentityStore getIdentityStore(Realm realm, IdentityObjectType identityObjectType);
-
-}
\ No newline at end of file
Copied: trunk/identity-api/src/main/java/org/jboss/identity/api/relation (from rev 46,
trunk/identity-model/src/main/java/org/jboss/identity/model/relation)
Modified:
trunk/identity-api/src/main/java/org/jboss/identity/api/relation/HierarchicalRelationshipType.java
===================================================================
---
trunk/identity-model/src/main/java/org/jboss/identity/model/relation/HierarchicalRelationshipType.java 2008-08-30
11:18:48 UTC (rev 46)
+++
trunk/identity-api/src/main/java/org/jboss/identity/api/relation/HierarchicalRelationshipType.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -19,8 +19,11 @@
* 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.model.relation;
+package org.jboss.identity.api.relation;
+import org.jboss.identity.api.RelationshipType;
+
+
/**
* Represents an hierarchical relationship type
* @author Anil.Saldhana(a)redhat.com
Deleted:
trunk/identity-api/src/main/java/org/jboss/identity/api/relation/RelationshipType.java
===================================================================
---
trunk/identity-model/src/main/java/org/jboss/identity/model/relation/RelationshipType.java 2008-08-30
11:18:48 UTC (rev 46)
+++
trunk/identity-api/src/main/java/org/jboss/identity/api/relation/RelationshipType.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -1,32 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.model.relation;
-
-/**
- * Defines a <b>relationship</b> between groups, domains etc
- * @author Anil.Saldhana(a)redhat.com
- * @since Jul 9, 2008
- */
-public interface RelationshipType
-{
- String getName();
-}
\ No newline at end of file
Modified: trunk/identity-api/src/main/java/org/jboss/identity/api/session/Session.java
===================================================================
---
trunk/identity-api/src/main/java/org/jboss/identity/api/session/Session.java 2008-09-05
10:09:37 UTC (rev 64)
+++
trunk/identity-api/src/main/java/org/jboss/identity/api/session/Session.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -21,18 +21,16 @@
*/
package org.jboss.identity.api.session;
-import org.jboss.identity.api.exception.IdentityException;
import org.jboss.identity.api.exception.SessionNotOpenException;
import org.jboss.identity.api.Transaction;
-import org.jboss.identity.model.Identity;
-import org.jboss.identity.model.IdentityObject;
-import org.jboss.identity.model.IdentityObjectType;
-import org.jboss.identity.model.IdentityType;
-import org.jboss.identity.model.relation.RelationshipType;
-import org.jboss.identity.model.roles.Role;
-import org.jboss.identity.model.roles.RoleType;
-import org.jboss.identity.model.groups.Group;
-import org.jboss.identity.model.groups.GroupType;
+import org.jboss.identity.api.Identity;
+import org.jboss.identity.api.Group;
+import org.jboss.identity.api.GroupType;
+import org.jboss.identity.api.Role;
+import org.jboss.identity.api.RoleType;
+import org.jboss.identity.api.RelationshipType;
+import org.jboss.identity.api.IdentityType;
+import org.jboss.identity.exception.IdentityException;
import java.util.List;
import java.util.Set;
@@ -97,10 +95,9 @@
/**
* <p>Create an identity in the realm</p>
* @param identityName
- * @param identityType
* @return
*/
- Identity createIdentity(String identityName, IdentityType identityType) throws
IdentityException;
+ Identity createIdentity(String identityName) throws IdentityException;
/**
* Create a group of a particular type
@@ -128,8 +125,9 @@
* @param identity
* @throws IdentityException
*/
- void removeIdentity(IdentityObject identity) throws IdentityException;
+ void removeIdentity(Identity identity) throws IdentityException;
+
// Realtionships
/**
@@ -266,8 +264,8 @@
* @param relationshipType
* @throws IdentityException
*/
- <R extends RelationshipType> void createRelationship(IdentityObject
fromIdentity,
- IdentityObject toIdentity,
+ <R extends RelationshipType> void createRelationship(IdentityType fromIdentity,
+ IdentityType toIdentity,
R relationshipType) throws IdentityException;
/**
@@ -279,8 +277,8 @@
* @param relationshipType
* @throws IdentityException
*/
- <R extends RelationshipType> void removeRelationship(IdentityObject
fromIdentity,
- IdentityObject toIdentity,
+ <R extends RelationshipType> void removeRelationship(IdentityType fromIdentity,
+ IdentityType toIdentity,
R relationshipType) throws IdentityException;
/**
@@ -292,7 +290,7 @@
* @param identity2
* @throws IdentityException
*/
- void removeRelationships(IdentityObject identity1, IdentityObject identity2)
+ void removeRelationships(IdentityType identity1, IdentityType identity2)
throws IdentityException;
/**
@@ -304,29 +302,43 @@
* @return
* @throws IdentityException
*/
- Set<RelationshipType> resolveRelationships(IdentityObject fromIdentity,
IdentityObject toIdentity)
+ Set<RelationshipType> resolveRelationships(IdentityType fromIdentity,
IdentityType toIdentity)
throws IdentityException;
// Search operations
/**
- * @param identityType
* @return a number of stored identities with a given type
* @throws IdentityException
*/
- <T extends IdentityObjectType> int getIdentityTypeCount(T identityType)
- throws IdentityException;
+ int getIdentityTypeCount()
+ throws IdentityException;
/**
+ * @param groupType
+ * @return a number of stored groups with a given type
+ * @throws IdentityException
+ */
+ int getGroupTypeCount(GroupType groupType)
+ throws IdentityException;
+
+ /**
+ * @param roleType
+ * @return a number of stored roles with a given type
+ * @throws IdentityException
+ */
+ int getRoleTypeCount(RoleType roleType)
+ throws IdentityException;
+
+ /**
* Find identity with a given name
*
* @param name
- * @param identityObjectType
* @return
* @throws IdentityException
*/
- IdentityObject findIdentityObject(String name, IdentityObjectType identityObjectType)
throws IdentityException;
+ Identity findIdentity(String name) throws IdentityException;
/**
* Find identity with a given id
@@ -335,7 +347,7 @@
* @return
* @throws IdentityException
*/
- IdentityObject findIdentityObject(Object id) throws IdentityException;
+ Identity findIdentity(Object id) throws IdentityException;
/**
* Find identities with a given type paginated and ordered.
@@ -343,7 +355,6 @@
* are not supported in this store implementation, dedicated
* parameters will take no effect
*
- * @param identityType
* @param offset
* @param limit 0 means unlimited page size
* @param orderedByAttributeName can be null
@@ -351,8 +362,63 @@
* @return
* @throws IdentityException
*/
- <T extends IdentityObjectType> Collection<IdentityObject>
findIdentityObject(T identityType,
+ Collection<Identity> findIdentity(int offset, int limit,
+ String orderedByAttributeName,
+ boolean ascending) throws IdentityException;
+
+ /**
+ * Find identities with a given attributes values. If the paginatedSearch or
+ * orderedSearch operations
+ * are not supported in this store implementation, dedicated parameters will take no
effect
+ *
+ * @param attributes
+ * @param offset
+ * @param limit 0 means unlimited page size
+ * @param orderedByAttributeName can be null
+ * @param ascending default true
+ * @return
+ * @throws IdentityException
+ */
+ Collection<Identity> findIdentity(Map<String, String[]> attributes,
int offset, int limit,
+ String orderedByAttributeName, boolean ascending)
throws IdentityException;
+ // Search Roles
+
+ /**
+ * Find role with a given name
+ *
+ * @param name
+ * @param roleType
+ * @return
+ * @throws IdentityException
+ */
+ Role findRole(String name, RoleType roleType) throws IdentityException;
+
+ /**
+ * Find role with a given id
+ *
+ * @param id
+ * @return
+ * @throws IdentityException
+ */
+ Role findRole(Object id) throws IdentityException;
+
+ /**
+ * Find role with a given type paginated and ordered.
+ * If the paginatedSearch or orderedSearch operations
+ * are not supported in this store implementation, dedicated
+ * parameters will take no effect
+ *
+ * @param roleType
+ * @param offset
+ * @param limit 0 means unlimited page size
+ * @param orderedByAttributeName can be null
+ * @param ascending default true
+ * @return
+ * @throws IdentityException
+ */
+ Collection<Role> findRole(RoleType roleType,
+ int offset, int limit,
String orderedByAttributeName,
boolean ascending) throws IdentityException;
@@ -361,7 +427,7 @@
* orderedSearch operations
* are not supported in this store implementation, dedicated parameters will take no
effect
*
- * @param identityType
+ * @param roleType
* @param attributes
* @param offset
* @param limit 0 means unlimited page size
@@ -370,12 +436,76 @@
* @return
* @throws IdentityException
*/
- <T extends IdentityObjectType> Collection<IdentityObject>
findIdentityObject(T identityType,
+ Collection<Identity> findRole(RoleType roleType,
Map<String, String[]> attributes,
int offset, int limit,
String orderedByAttributeName, boolean ascending)
throws IdentityException;
+ // Search Groups
+
/**
+ * Find group with a given name
+ *
+ * @param name
+ * @param groupType
+ * @return
+ * @throws IdentityException
+ */
+ Group findGroup(String name, GroupType groupType) throws IdentityException;
+
+ /**
+ * Find group with a given id
+ *
+ * @param id
+ * @return
+ * @throws IdentityException
+ */
+ Group findGroup(Object id) throws IdentityException;
+
+ /**
+ * Find group with a given type paginated and ordered.
+ * If the paginatedSearch or orderedSearch operations
+ * are not supported in this store implementation, dedicated
+ * parameters will take no effect
+ *
+ * @param groupType
+ * @param offset
+ * @param limit 0 means unlimited page size
+ * @param orderedByAttributeName can be null
+ * @param ascending default true
+ * @return
+ * @throws IdentityException
+ */
+ Collection<Group> findRole(GroupType groupType,
+ int offset, int limit,
+ String orderedByAttributeName,
+ boolean ascending) throws IdentityException;
+
+ /**
+ * Find group with a given attributes values. If the paginatedSearch or
+ * orderedSearch operations
+ * are not supported in this store implementation, dedicated parameters will take no
effect
+ *
+ * @param groupType
+ * @param attributes
+ * @param offset
+ * @param limit 0 means unlimited page size
+ * @param orderedByAttributeName can be null
+ * @param ascending default true
+ * @return
+ * @throws IdentityException
+ */
+ Collection<Group> findGroup(GroupType groupType,
+ Map<String, String[]> attributes,
+ int offset, int limit,
+ String orderedByAttributeName, boolean ascending)
throws IdentityException;
+
+
+
+
+ // Search with relationship types
+
+ /**
* Find identites that have relationship with given identity. Relationships are
directional (from parent to child).
* If the paginatedSearch or orderedSearch operations
* are not supported in this store implementation, dedicated parameters will
@@ -392,8 +522,8 @@
* @return
* @throws IdentityException
*/
- <R extends RelationshipType>Collection<IdentityObject>
findIdentityObject(IdentityObject identity,
- R relationshipType,
+ Collection<IdentityType> findRelatedIdentityTypes(IdentityType identity,
+ RelationshipType relationshipType,
boolean parent,
int offset, int limit,
String orderedByAttributeName,
@@ -406,7 +536,7 @@
* @return names of supported attributes
* @throws IdentityException
*/
- <T extends IdentityObjectType> Set<String> getSupportedAttributeNames(T
identityType)
+ Set<String> getSupportedAttributeNames(IdentityType identityType)
throws IdentityException;
/**
@@ -416,7 +546,7 @@
* @return
* @throws IdentityException
*/
- Map<String, String[]> getAttributes(IdentityObject identity) throws
IdentityException;
+ Map<String, String[]> getAttributes(IdentityType identity) throws
IdentityException;
/**
* Update attributes with new values - previous values will be overwritten
@@ -424,7 +554,7 @@
* @param attributes
* @throws IdentityException
*/
- void updateAttributes(IdentityObject identity, Map<String, String[]>
attributes)
+ void updateAttributes(IdentityType identity, Map<String, String[]> attributes)
throws IdentityException;
/**
@@ -435,7 +565,7 @@
* @param attributes
* @throws IdentityException
*/
- void addAttributes(IdentityObject identity, Map<String, String[]> attributes)
+ void addAttributes(IdentityType identity, Map<String, String[]> attributes)
throws IdentityException;
/**
@@ -444,7 +574,7 @@
* @param identity
* @param attributes
*/
- void removeAttributes(IdentityObject identity, Set<String> attributes)
+ void removeAttributes(IdentityType identity, Set<String> attributes)
throws IdentityException;
Deleted:
trunk/identity-api/src/main/java/org/jboss/identity/api/store/FeaturesDescription.java
===================================================================
---
trunk/identity-api/src/main/java/org/jboss/identity/api/store/FeaturesDescription.java 2008-09-05
10:09:37 UTC (rev 64)
+++
trunk/identity-api/src/main/java/org/jboss/identity/api/store/FeaturesDescription.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -1,98 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.api.store;
-
-import java.util.Set;
-import java.util.Map;
-
-import org.jboss.identity.api.exception.IdentityException;
-import org.jboss.identity.api.exception.IdentityTypeNotSupportedException;
-import org.jboss.identity.model.IdentityObjectType;
-import org.jboss.identity.model.relation.RelationshipType;
-
-/**
- * Describe the features supported by an Identity Store
- * @author boleslaw dot dawidowicz at redhat anotherdot com
- * @author Anil.Saldhana(a)redhat.com
- * @since Jul 10, 2008
- */
-public interface FeaturesDescription
-{
- /**
- * Get the supported operations
- * @param identityObjectType a type representing identity, role, group
- * @return supported operations for given identity type
- * @throws IdentityTypeNotSupportedException
- */
- public Set<OperationType> getSupportedOperations(IdentityObjectType
identityObjectType)
- throws IdentityTypeNotSupportedException;
-
- /**
- * @param operationType
- * @param identityObjectType
- * @return if given operation on given identity type is supported
- * @throws IdentityTypeNotSupportedException
- */
- boolean isOperationSupported(OperationType operationType,
- IdentityObjectType identityObjectType) throws
IdentityTypeNotSupportedException;
-
-
- /**
- * @param operationType
- * @return set of identity types that can be processed with a given operation
- * @throws org.jboss.identity.api.exception.IdentityException
- */
- public Set<IdentityObjectType> getSupportedIdentities(OperationType
operationType);
-
- /**
- * @return set of identity types that can be persisted
- */
- Set<IdentityObjectType> getSupportedIdentities();
-
- /**
- * @param identityObjectType
- * @return boolean describing if given identity type can be persisted or retrieved
using this identity store
- */
- boolean isIdentitySupported(IdentityObjectType identityObjectType);
-
- /**
- * @param fromType
- * @param toType
- * @param relationshipType
- * @return true is given relationship can be persisted or retrieved
- * @throws IdentityException
- */
- boolean isRelationshipSupported(IdentityObjectType fromType, IdentityObjectType
toType,
- RelationshipType relationshipType)
- throws IdentityException;
-
- /**
- * @return Set of RelationshipType supported in this store
- */
- Set<RelationshipType> getSupportedRelationshipTypes();
-
- /**
- * @return A mapping of RelationshipType and IdentityType objects that can have such
relationship in this store
- */
- Map<RelationshipType, Map<IdentityObjectType, IdentityObjectType>>
getSupportedRelationshipTypeMappings();
-
-}
\ No newline at end of file
Deleted: trunk/identity-api/src/main/java/org/jboss/identity/api/store/IdentityStore.java
===================================================================
---
trunk/identity-api/src/main/java/org/jboss/identity/api/store/IdentityStore.java 2008-09-05
10:09:37 UTC (rev 64)
+++
trunk/identity-api/src/main/java/org/jboss/identity/api/store/IdentityStore.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -1,264 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.api.store;
-
-import java.io.IOException;
-import java.util.Collection;
-import java.util.Map;
-import java.util.Set;
-
-import org.jboss.identity.api.exception.IdentityException;
-import org.jboss.identity.model.IdentityObject;
-import org.jboss.identity.model.IdentityObjectType;
-import org.jboss.identity.model.relation.RelationshipType;
-
-/**
- * Represents an Identity Store
- * @author boleslaw dot dawidowicz at redhat anotherdot com
- * @author Anil.Saldhana(a)redhat.com
- * @since Jul 10, 2008
- */
-public interface IdentityStore
-{
- /**
- * Set up the store
- */
- void bootstrap() throws IOException;
-
- /**
- * @return id of this identity store
- */
- String getId();
-
-
- /**
- * @return FeaturesDescription object describing what
- * operation are supported by this store
- */
- FeaturesDescription getSupportedFeatures();
-
-
- // Operations
-
- /**
- * Create new identity with a given name
- *
- * @param name
- * @param identityObjectType
- * @return
- * @throws IdentityException
- */
- IdentityObject createIdentity(String name, IdentityObjectType identityObjectType)
throws IdentityException;
-
- /**
- * Remove given identity
- *
- * @param identity
- * @throws IdentityException
- */
- void removeIdentity(IdentityObject identity) throws IdentityException;
-
- /**
- * @param identityType
- * @return a number of stored identities with a given type
- * @throws IdentityException
- */
- <T extends IdentityObjectType> int getIdentitiesCount(T identityType)
- throws IdentityException;
-
- /**
- * Find identity with a given name
- *
- * @param name
- * @param identityObjectType
- * @return
- * @throws IdentityException
- */
- IdentityObject findIdentity(String name, IdentityObjectType identityObjectType) throws
IdentityException;
-
- /**
- * Find identity with a given id
- *
- * @param id
- * @return
- * @throws IdentityException
- */
- IdentityObject findIdentity(Object id) throws IdentityException;
-
- /**
- * Find identities with a given type paginated and ordered.
- * If the paginatedSearch or orderedSearch operations
- * are not supported in this store implementation, dedicated
- * parameters will take no effect
- *
- * @param identityType
- * @param offset
- * @param limit 0 means unlimited page size
- * @param orderedByAttributeName can be null
- * @param ascending default true
- * @return
- * @throws IdentityException
- */
- <T extends IdentityObjectType> Collection<IdentityObject> findIdentities(T
identityType,
- int offset, int limit,
- String orderedByAttributeName,
- boolean ascending) throws IdentityException;
-
- /**
- * Find identities with a given attributes values. If the paginatedSearch or
- * orderedSearch operations
- * are not supported in this store implementation, dedicated parameters will take no
effect
- *
- * @param identityType
- * @param attributes
- * @param offset
- * @param limit 0 means unlimited page size
- * @param orderedByAttributeName can be null
- * @param ascending default true
- * @return
- * @throws IdentityException
- */
- <T extends IdentityObjectType> Collection<IdentityObject> findIdentities(T
identityType,
- Map<String, String[]> attributes,
- int offset, int limit,
- String orderedByAttributeName, boolean ascending)
throws IdentityException;
-
- /**
- * Find identites that have relationship with given identity. Relationships are
directional (from parent to child).
- * If the paginatedSearch or orderedSearch operations
- * are not supported in this store implementation, dedicated parameters will
- * take no effect
- *
- * @param identity
- * @param relationshipType
- * @param parent defines if given identity is parent or child side in the
- * relationship - default is true (parent)
- * @param offset
- * @param limit 0 means unlimited page size
- * @param orderedByAttributeName can be null
- * @param ascending default true
- * @return
- * @throws IdentityException
- */
- <R extends RelationshipType>Collection<IdentityObject>
findIdentities(IdentityObject identity,
- R relationshipType,
- boolean parent,
- int offset, int limit,
- String orderedByAttributeName,
- boolean ascending) throws IdentityException;
-
- /**
- * @param identityType
- * @return names of supported attributes
- * @throws IdentityException
- */
- <T extends IdentityObjectType> Set<String> getSupportedAttributeNames(T
identityType)
- throws IdentityException;
-
- /**
- * Get attributes for the given identity
- *
- * @param identity
- * @return
- * @throws IdentityException
- */
- Map<String, String[]> getAttributes(IdentityObject identity) throws
IdentityException;
-
- /**
- * Update attributes with new values - previous values will be overwritten
- * @param identity
- * @param attributes
- * @throws IdentityException
- */
- void updateAttributes(IdentityObject identity, Map<String, String[]>
attributes)
- throws IdentityException;
-
- /**
- * Add new attributes - if attribute with given name already exists the values
- * will be appended
- *
- * @param identity
- * @param attributes
- * @throws IdentityException
- */
- void addAttributes(IdentityObject identity, Map<String, String[]> attributes)
- throws IdentityException;
-
- /**
- * Remove attributes
- *
- * @param identity
- * @param attributes
- */
- void removeAttributes(IdentityObject identity, Set<String> attributes)
- throws IdentityException;
-
- /**
- * Create directional relationship of a given type between identities
- *
- * @param fromIdentity
- * @param toIdentity
- * @param relationshipType
- * @throws IdentityException
- */
- <R extends RelationshipType> void createRelationship(IdentityObject
fromIdentity,
- IdentityObject toIdentity,
- R relationshipType) throws IdentityException;
-
- /**
- * Remove relationship between identities. Relationships can be directional so
- * order of parameters matters
- *
- * @param fromIdentity
- * @param toIdentity
- * @param relationshipType
- * @throws IdentityException
- */
- <R extends RelationshipType> void removeRelationship(IdentityObject
fromIdentity,
- IdentityObject toIdentity,
- R relationshipType) throws IdentityException;
-
- /**
- * Remove all relationships between identities. Direction of relationships doesn't
- * matter - all active relationships
- * will be removed
- *
- * @param identity1
- * @param identity2
- * @throws IdentityException
- */
- void removeRelationships(IdentityObject identity1, IdentityObject identity2)
- throws IdentityException;
-
- /**
- * Resolve relationship types between two identities. Relationships can be directional
- * so order of parameters matters
- *
- * @param fromIdentity
- * @param toIdentity
- * @return
- * @throws IdentityException
- */
- Set<RelationshipType> resolveRelationships(IdentityObject fromIdentity,
IdentityObject toIdentity)
- throws IdentityException;
-
-}
\ No newline at end of file
Deleted:
trunk/identity-api/src/main/java/org/jboss/identity/api/store/IdentityStoreRepository.java
===================================================================
---
trunk/identity-api/src/main/java/org/jboss/identity/api/store/IdentityStoreRepository.java 2008-09-05
10:09:37 UTC (rev 64)
+++
trunk/identity-api/src/main/java/org/jboss/identity/api/store/IdentityStoreRepository.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -1,56 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.api.store;
-
-import java.util.Map;
-import java.util.Set;
-
-import org.jboss.identity.model.IdentityObjectType;
-
-/**
- * IdentityStoreRepository exposes identity object management
- * operations and act as an entry point to many underlying data stores.
- * Its responsibility is to map identity objects, their state and relations
- * between them across different identity stores.
- * @author boleslaw dot dawidowicz at redhat anotherdot com
- * @author Anil.Saldhana(a)redhat.com
- * @since Jul 10, 2008
- */
-public interface IdentityStoreRepository extends IdentityStore
-{
- /**
- * @return a set of configured identity stores
- */
- Set<IdentityStore> getConfiguredIdentityStores();
-
- /**
- * @return mapping of IdentityType to the specific identity store
- */
- Map<IdentityObjectType, IdentityStore> getIdentityStoreMappings();
-
- /**
- * @param identityObjectType
- * @return proper identity store to store given identity type
- */
- IdentityStore getIdentityStore(IdentityObjectType identityObjectType);
-
-}
\ No newline at end of file
Deleted: trunk/identity-api/src/main/java/org/jboss/identity/api/store/OperationType.java
===================================================================
---
trunk/identity-api/src/main/java/org/jboss/identity/api/store/OperationType.java 2008-09-05
10:09:37 UTC (rev 64)
+++
trunk/identity-api/src/main/java/org/jboss/identity/api/store/OperationType.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -1,58 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.api.store;
-
-/**
- * Operations supported by the Identity Stores
- * @author boleslaw dot dawidowicz at redhat anotherdot com
- * @author Anil.Saldhana(a)redhat.com
- * @since Jul 10, 2008
- */
-public enum OperationType
-{
- // createIdentity
- create,
-
- // removeIdentity
- remove,
-
- // updateAttribute, updateAttributes, addAttributes
- updateAttributes,
-
- // resolveRelationships
- resolveRelationships,
-
- // createRelationship
- modifyRelationships,
-
- // pagination in findIdentities
- paginatedSearch,
-
- // ordering in findIdentities
- orderedSearch;
-
-
- public String getName()
- {
- return this.name();
- }
-}
\ No newline at end of file
Added: trunk/identity-common/pom.xml
===================================================================
--- trunk/identity-common/pom.xml (rev 0)
+++ trunk/identity-common/pom.xml 2008-09-10 11:29:05 UTC (rev 65)
@@ -0,0 +1,37 @@
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.jboss.identity</groupId>
+ <artifactId>jboss-identity-parent</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../parent</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>jboss-identity-common</artifactId>
+ <packaging>jar</packaging>
+ <name>JBoss Identity Common</name>
+ <
url>http://labs.jboss.org/portal/jbosssecurity/</url>
+ <description>JBoss Identity Common</description>
+ <licenses>
+ <license>
+ <name>lgpl</name>
+ <
url>http://repository.jboss.com/licenses/lgpl.txt</url>
+ </license>
+ </licenses>
+ <organization>
+ <name>JBoss Inc.</name>
+ <url>http://www.jboss.org</url>
+ </organization>
+ <scm>
+
<
connection>scm:svn:http://anonsvn.jboss.org/repos/jbossidentity/trunk&...
+
<
developerConnection>scm:svn:https://svn.jboss.org/jbossidentity/trunk&...
+
<
url>http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossidentity/trunk<...
+ </scm>
+ <dependencies>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
Copied:
trunk/identity-common/src/main/java/org/jboss/identity/exception/IdentityException.java
(from rev 46,
trunk/identity-api/src/main/java/org/jboss/identity/api/exception/IdentityException.java)
===================================================================
---
trunk/identity-common/src/main/java/org/jboss/identity/exception/IdentityException.java
(rev 0)
+++
trunk/identity-common/src/main/java/org/jboss/identity/exception/IdentityException.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.exception;
+
+import java.security.GeneralSecurityException;
+
+/**
+ * <p>Identity Exception</p>
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Jul 10, 2008
+ */
+public class IdentityException extends GeneralSecurityException
+{
+ private static final long serialVersionUID = 1L;
+
+ public IdentityException()
+ {
+ super();
+ }
+
+ public IdentityException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public IdentityException(String msg)
+ {
+ super(msg);
+ }
+
+ public IdentityException(Throwable cause)
+ {
+ super(cause);
+ }
+}
\ No newline at end of file
Added:
trunk/identity-common/src/main/java/org/jboss/identity/exception/PolicyValidationException.java
===================================================================
---
trunk/identity-common/src/main/java/org/jboss/identity/exception/PolicyValidationException.java
(rev 0)
+++
trunk/identity-common/src/main/java/org/jboss/identity/exception/PolicyValidationException.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.exception;
+
+import java.security.GeneralSecurityException;
+
+/**
+ * Exception to denote failure in policy
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Jul 13, 2008
+ */
+public class PolicyValidationException extends GeneralSecurityException
+{
+ private static final long serialVersionUID = 1L;
+}
\ No newline at end of file
Modified: trunk/identity-impl/pom.xml
===================================================================
--- trunk/identity-impl/pom.xml 2008-09-05 10:09:37 UTC (rev 64)
+++ trunk/identity-impl/pom.xml 2008-09-10 11:29:05 UTC (rev 65)
@@ -29,6 +29,11 @@
<dependencies>
<dependency>
<groupId>org.jboss.identity</groupId>
+ <artifactId>jboss-identity-common</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.identity</groupId>
<artifactId>jboss-identity-model</artifactId>
<version>${project.version}</version>
</dependency>
@@ -38,6 +43,15 @@
<version>${project.version}</version>
</dependency>
<dependency>
+ <groupId>org.jboss.identity</groupId>
+ <artifactId>jboss-identity-spi</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.persistence</groupId>
+ <artifactId>persistence-api</artifactId>
+ </dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
Modified:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/FileBasedIdentityStore.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/FileBasedIdentityStore.java 2008-09-05
10:09:37 UTC (rev 64)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/FileBasedIdentityStore.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -28,14 +28,15 @@
import java.util.Map;
import java.util.Set;
-import org.jboss.identity.api.exception.IdentityException;
-import org.jboss.identity.api.store.FeaturesDescription;
-import org.jboss.identity.api.store.IdentityStore;
+
import org.jboss.identity.impl.types.SimpleIdentity;
-import org.jboss.identity.model.IdentityObjectType;
-import org.jboss.identity.model.IdentityObject;
-import org.jboss.identity.model.groups.Group;
-import org.jboss.identity.model.relation.RelationshipType;
+import org.jboss.identity.model.core.IdentityObjectType;
+import org.jboss.identity.model.core.IdentityObject;
+import org.jboss.identity.model.core.IdentityObjectRelationshipType;
+import org.jboss.identity.api.Group;
+import org.jboss.identity.exception.IdentityException;
+import org.jboss.identity.spi.store.IdentityStore;
+import org.jboss.identity.spi.store.FeaturesDescription;
/**
* File Based Identity Store
@@ -73,7 +74,7 @@
return identity;
}
- public <R extends RelationshipType> void createRelationship(IdentityObject
fromIdentity,
+ public <R extends IdentityObjectRelationshipType> void
createRelationship(IdentityObject fromIdentity,
IdentityObject toIdentity,
R relationshipType)
throws IdentityException
@@ -128,7 +129,7 @@
return 0;
}
- public <R extends RelationshipType> Collection<IdentityObject>
findIdentities(IdentityObject identity, R relationshipType, boolean parent, int offset,
int limit, String orderedByAttributeName, boolean ascending) throws IdentityException
+ public <R extends IdentityObjectRelationshipType>
Collection<IdentityObject> findIdentities(IdentityObject identity, R
relationshipType, boolean parent, int offset, int limit, String orderedByAttributeName,
boolean ascending) throws IdentityException
{
return null;
}
@@ -147,7 +148,7 @@
{
}
- public <R extends RelationshipType> void removeRelationship(IdentityObject
fromIdentity,
+ public <R extends IdentityObjectRelationshipType> void
removeRelationship(IdentityObject fromIdentity,
IdentityObject toIdentity,
R relationshipType)
throws IdentityException
@@ -159,7 +160,7 @@
{
}
- public Set<RelationshipType> resolveRelationships(IdentityObject fromIdentity,
+ public Set<IdentityObjectRelationshipType> resolveRelationships(IdentityObject
fromIdentity,
IdentityObject toIdentity)
throws IdentityException
{
Modified:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleGroup.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleGroup.java 2008-09-05
10:09:37 UTC (rev 64)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleGroup.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -23,11 +23,12 @@
import java.util.List;
-import org.jboss.identity.model.IdentityAttribute;
-import org.jboss.identity.model.IdentityObjectType;
-import org.jboss.identity.model.groups.Group;
-import org.jboss.identity.model.groups.GroupType;
-import org.jboss.identity.model.policy.PolicyValidationException;
+import org.jboss.identity.model.core.IdentityObjectAttribute;
+import org.jboss.identity.model.core.IdentityObjectType;
+import org.jboss.identity.api.Group;
+import org.jboss.identity.api.GroupType;
+import org.jboss.identity.api.IdentityAttribute;
+import org.jboss.identity.exception.PolicyValidationException;
/**
* A simple implementation of group
@@ -48,16 +49,6 @@
return null;
}
- public String getFQDN()
- {
- return null;
- }
-
- public IdentityObjectType getIdentityType()
- {
- return null;
- }
-
public String getName()
{
return name;
@@ -70,6 +61,7 @@
public void validatePolicy() throws PolicyValidationException
{
+
}
public String getDisplayName()
Modified:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleIdentity.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleIdentity.java 2008-09-05
10:09:37 UTC (rev 64)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleIdentity.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -24,13 +24,14 @@
import java.util.Collections;
import java.util.List;
-import org.jboss.identity.model.Identity;
-import org.jboss.identity.model.IdentityAttribute;
-import org.jboss.identity.model.roles.Role;
-import org.jboss.identity.model.IdentityObjectType;
-import org.jboss.identity.model.groups.Group;
-import org.jboss.identity.model.policy.PolicyValidationException;
+import org.jboss.identity.model.core.IdentityObjectAttribute;
+import org.jboss.identity.api.Role;
+import org.jboss.identity.model.core.IdentityObjectType;
+import org.jboss.identity.model.core.IdentityObject;
+import org.jboss.identity.api.Group;
+import org.jboss.identity.exception.PolicyValidationException;
+
/**
* Very simple identity
* @author Anil.Saldhana(a)redhat.com
@@ -38,7 +39,7 @@
*
* @since Aug 6, 2008
*/
-public class SimpleIdentity implements Identity
+public class SimpleIdentity implements IdentityObject
{
public IdentityObjectType getIdentityType()
@@ -47,7 +48,7 @@
}
protected String name;
- protected List<IdentityAttribute> attributes = Collections.emptyList();
+ protected List<IdentityObjectAttribute> attributes = Collections.emptyList();
protected List<Group> groups = Collections.emptyList();
protected List<Role> roles = Collections.emptyList();
@@ -66,7 +67,7 @@
return null;
}
- public List<IdentityAttribute> getAttributes()
+ public List<IdentityObjectAttribute> getAttributes()
{
return Collections.unmodifiableList(attributes);
}
@@ -88,5 +89,6 @@
public void validatePolicy() throws PolicyValidationException
{
- }
+
+ }
}
\ No newline at end of file
Modified: trunk/identity-model/pom.xml
===================================================================
--- trunk/identity-model/pom.xml 2008-09-05 10:09:37 UTC (rev 64)
+++ trunk/identity-model/pom.xml 2008-09-10 11:29:05 UTC (rev 65)
@@ -10,7 +10,7 @@
<packaging>jar</packaging>
<name>JBoss Identity Model</name>
<
url>http://labs.jboss.org/portal/jbosssecurity/</url>
- <description>JBoss Identity Model contains the Identity
Model.</description>
+ <description>JBoss Identity Model contains the Core Identity
Model.</description>
<licenses>
<license>
<name>lgpl</name>
@@ -28,6 +28,11 @@
</scm>
<dependencies>
<dependency>
+ <groupId>org.jboss.identity</groupId>
+ <artifactId>jboss-identity-common</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
Deleted: trunk/identity-model/src/main/java/org/jboss/identity/model/Identity.java
===================================================================
--- trunk/identity-model/src/main/java/org/jboss/identity/model/Identity.java 2008-09-05
10:09:37 UTC (rev 64)
+++ trunk/identity-model/src/main/java/org/jboss/identity/model/Identity.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.model;
-
-import java.util.List;
-
-import org.jboss.identity.model.groups.Group;
-import org.jboss.identity.model.roles.Role;
-
-/**
- * Represents an Identity
- * @author Anil.Saldhana(a)redhat.com
- * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
- * @since Jun 30, 2008
- */
-public interface Identity extends IdentityObject
-{
-
-}
\ No newline at end of file
Deleted:
trunk/identity-model/src/main/java/org/jboss/identity/model/IdentityAttribute.java
===================================================================
---
trunk/identity-model/src/main/java/org/jboss/identity/model/IdentityAttribute.java 2008-09-05
10:09:37 UTC (rev 64)
+++
trunk/identity-model/src/main/java/org/jboss/identity/model/IdentityAttribute.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -1,31 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.model;
-
-/**
- * An attribute of an identity
- * @author Anil.Saldhana(a)redhat.com
- * @since Jun 30, 2008
- */
-public interface IdentityAttribute
-{
-}
\ No newline at end of file
Deleted: trunk/identity-model/src/main/java/org/jboss/identity/model/IdentityType.java
===================================================================
---
trunk/identity-model/src/main/java/org/jboss/identity/model/IdentityType.java 2008-09-05
10:09:37 UTC (rev 64)
+++
trunk/identity-model/src/main/java/org/jboss/identity/model/IdentityType.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -1,31 +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.model;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
- * @version : 0.1 $
- */
-public interface IdentityType extends IdentityObjectType
-{
-}
Deleted:
trunk/identity-model/src/main/java/org/jboss/identity/model/IdentityTypeEnum.java
===================================================================
---
trunk/identity-model/src/main/java/org/jboss/identity/model/IdentityTypeEnum.java 2008-09-05
10:09:37 UTC (rev 64)
+++
trunk/identity-model/src/main/java/org/jboss/identity/model/IdentityTypeEnum.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -1,49 +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.model;
-
-import org.jboss.identity.model.policy.RelationshipPolicy;
-
-import java.util.List;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
- * @version : 0.1 $
- */
-public enum IdentityTypeEnum implements IdentityType
-{
- IDENTITY_USER;
-
- public String getName()
- {
- return this.name();
- }
-
- public List<RelationshipPolicy<IdentityObjectType, IdentityObjectType>>
getRelationshipPolicies()
- {
- return null;
- }
-
-
-}
Modified:
trunk/identity-model/src/main/java/org/jboss/identity/model/attribute/PasswordAttribute.java
===================================================================
---
trunk/identity-model/src/main/java/org/jboss/identity/model/attribute/PasswordAttribute.java 2008-09-05
10:09:37 UTC (rev 64)
+++
trunk/identity-model/src/main/java/org/jboss/identity/model/attribute/PasswordAttribute.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -1,68 +1,68 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.model.attribute;
-
-import java.util.Date;
-
-import org.jboss.identity.model.IdentityAttribute;
-import org.jboss.identity.model.IdentityObjectType;
-import org.jboss.identity.model.policy.PasswordExpirationPolicy;
-
-/**
- * Represents a password
- * @author Anil.Saldhana(a)redhat.com
- * @since Jul 13, 2008
- */
-public class PasswordAttribute<T extends IdentityObjectType>
-implements IdentityAttribute
-{
- /**
- * Password policy governing this attribute.
- * A null value indicates that there is no policy.
- */
- protected PasswordExpirationPolicy<T> passwordPolicy;
-
- /**
- * Get the date time when the password was last updated.
- * The update can be based on password expiration.
- */
- protected Date lastUpdated = new Date();
-
- public PasswordAttribute()
- {
- }
-
- public PasswordAttribute(PasswordExpirationPolicy<T> aPasswordPolicy)
- {
- this.passwordPolicy = aPasswordPolicy;
- }
-
- public PasswordExpirationPolicy<T> getPasswordPolicy()
- {
- return passwordPolicy;
- }
-
- public void setPasswordPolicy(PasswordExpirationPolicy<T> passwordPolicy)
- {
- this.passwordPolicy = passwordPolicy;
- }
-}
\ No newline at end of file
+///*
+// * JBoss, Home of Professional Open Source.
+// * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+// * as indicated by the @author tags. See the copyright.txt file 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.model.attribute;
+//
+//import java.util.Date;
+//
+//import org.jboss.identity.model.IdentityAttribute;
+//import org.jboss.identity.model.IdentityObjectType;
+//import org.jboss.identity.model.policy.PasswordExpirationPolicy;
+//
+///**
+// * Represents a password
+// * @author Anil.Saldhana(a)redhat.com
+// * @since Jul 13, 2008
+// */
+//public class PasswordAttribute<T extends IdentityObjectType>
+//implements IdentityAttribute
+//{
+// /**
+// * Password policy governing this attribute.
+// * A null value indicates that there is no policy.
+// */
+// protected PasswordExpirationPolicy<T> passwordPolicy;
+//
+// /**
+// * Get the date time when the password was last updated.
+// * The update can be based on password expiration.
+// */
+// protected Date lastUpdated = new Date();
+//
+// public PasswordAttribute()
+// {
+// }
+//
+// public PasswordAttribute(PasswordExpirationPolicy<T> aPasswordPolicy)
+// {
+// this.passwordPolicy = aPasswordPolicy;
+// }
+//
+// public PasswordExpirationPolicy<T> getPasswordPolicy()
+// {
+// return passwordPolicy;
+// }
+//
+// public void setPasswordPolicy(PasswordExpirationPolicy<T> passwordPolicy)
+// {
+// this.passwordPolicy = passwordPolicy;
+// }
+//}
\ No newline at end of file
Copied:
trunk/identity-model/src/main/java/org/jboss/identity/model/core/IdentityObject.java (from
rev 63, trunk/identity-model/src/main/java/org/jboss/identity/model/IdentityObject.java)
===================================================================
--- trunk/identity-model/src/main/java/org/jboss/identity/model/core/IdentityObject.java
(rev 0)
+++
trunk/identity-model/src/main/java/org/jboss/identity/model/core/IdentityObject.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -0,0 +1,74 @@
+/*
+* 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.model.core;
+
+import org.jboss.identity.model.core.IdentityObjectType;
+import org.jboss.identity.model.core.IdentityObjectAttribute;
+import org.jboss.identity.exception.PolicyValidationException;
+
+import java.util.List;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
+ * @author Anil.Saldhana(a)redhat.com
+ * @version : 0.1 $
+ */
+public interface IdentityObject
+{
+
+ /**
+ * @return id of this identity object
+ */
+ Object getId();
+
+ /**
+ * FQDN identifies the context of this object - realm, identity store in which it is
persisted and object id in this store
+ *
+ * @return full qualified domain name for this identity
+ */
+ String getFQDN();
+
+ /**
+ * <p>Return the name of the identity</p>
+ * @return
+ */
+ String getName();
+
+ /**
+ * <p>Return type of this identity object</p>
+ * @return
+ */
+ IdentityObjectType getIdentityType();
+
+ /**
+ * <p>Return a list of attributes</p>
+ * @return
+ */
+ List<IdentityObjectAttribute> getAttributes();
+
+ /**
+ * Validate configured Policies
+ * @throws org.jboss.identity.exception.PolicyValidationException
+ */
+ void validatePolicy() throws PolicyValidationException;
+}
Copied:
trunk/identity-model/src/main/java/org/jboss/identity/model/core/IdentityObjectAttribute.java
(from rev 46,
trunk/identity-model/src/main/java/org/jboss/identity/model/IdentityAttribute.java)
===================================================================
---
trunk/identity-model/src/main/java/org/jboss/identity/model/core/IdentityObjectAttribute.java
(rev 0)
+++
trunk/identity-model/src/main/java/org/jboss/identity/model/core/IdentityObjectAttribute.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.model.core;
+
+import java.util.Set;
+
+/**
+ * An attribute of an identity
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Jun 30, 2008
+ */
+public interface IdentityObjectAttribute
+{
+
+ /**
+ *
+ * @return
+ */
+ String getName();
+
+ /**
+ *
+ * @return
+ */
+ Set<String> getValues();
+
+}
\ No newline at end of file
Added:
trunk/identity-model/src/main/java/org/jboss/identity/model/core/IdentityObjectRelationship.java
===================================================================
---
trunk/identity-model/src/main/java/org/jboss/identity/model/core/IdentityObjectRelationship.java
(rev 0)
+++
trunk/identity-model/src/main/java/org/jboss/identity/model/core/IdentityObjectRelationship.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -0,0 +1,39 @@
+/*
+* 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.model.core;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface IdentityObjectRelationship
+{
+
+ /**
+ *
+ * @return
+ */
+ IdentityObjectRelationshipType getType();
+
+ //TODO: Does it make sense to add a name?
+}
Copied:
trunk/identity-model/src/main/java/org/jboss/identity/model/core/IdentityObjectRelationshipType.java
(from rev 46,
trunk/identity-model/src/main/java/org/jboss/identity/model/relation/RelationshipType.java)
===================================================================
---
trunk/identity-model/src/main/java/org/jboss/identity/model/core/IdentityObjectRelationshipType.java
(rev 0)
+++
trunk/identity-model/src/main/java/org/jboss/identity/model/core/IdentityObjectRelationshipType.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.model.core;
+
+/**
+ * Defines a <b>relationship</b> between groups, domains etc
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Jul 9, 2008
+ */
+public interface IdentityObjectRelationshipType
+{
+ String getName();
+}
\ No newline at end of file
Copied:
trunk/identity-model/src/main/java/org/jboss/identity/model/core/IdentityObjectType.java
(from rev 63,
trunk/identity-model/src/main/java/org/jboss/identity/model/IdentityObjectType.java)
===================================================================
---
trunk/identity-model/src/main/java/org/jboss/identity/model/core/IdentityObjectType.java
(rev 0)
+++
trunk/identity-model/src/main/java/org/jboss/identity/model/core/IdentityObjectType.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.model.core;
+
+import java.util.List;
+
+
+/**
+ * Marker Interface representing
+ * an object of the Identity Model
+ * @author Anil.Saldhana(a)redhat.com
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @since Jul 10, 2008
+ */
+public interface IdentityObjectType
+{
+ /**
+ * <p>Return the name of the identity type</p>
+ * @return
+ */
+ String getName();
+
+}
\ No newline at end of file
Deleted:
trunk/identity-model/src/main/java/org/jboss/identity/model/groups/SimpleGroupType.java
===================================================================
---
trunk/identity-model/src/main/java/org/jboss/identity/model/groups/SimpleGroupType.java 2008-09-05
10:09:37 UTC (rev 64)
+++
trunk/identity-model/src/main/java/org/jboss/identity/model/groups/SimpleGroupType.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -1,64 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.model.groups;
-
-import org.jboss.identity.model.policy.RelationshipPolicy;
-import org.jboss.identity.model.IdentityObjectType;
-
-import java.util.List;
-
-/**
- * Simple Implementation of Group Type
- * @author Anil.Saldhana(a)redhat.com
- * @since Jul 22, 2008
- */
-public class SimpleGroupType implements GroupType
-{
- protected String name;
-
- public SimpleGroupType(String name)
- {
- this.name = name;
- }
-
- /**
- * @see GroupType#getName()
- */
- public String getName()
- {
- return null;
- }
-
- @Override
- public String toString()
- {
- StringBuilder builder = new StringBuilder("Group[");
- builder.append(name).append("]");
- return builder.toString();
- }
-
-
- public List<RelationshipPolicy<IdentityObjectType, IdentityObjectType>>
getRelationshipPolicies()
- {
- return null;
- }
-}
Deleted:
trunk/identity-model/src/main/java/org/jboss/identity/model/relation/RelationshipType.java
===================================================================
---
trunk/identity-model/src/main/java/org/jboss/identity/model/relation/RelationshipType.java 2008-09-05
10:09:37 UTC (rev 64)
+++
trunk/identity-model/src/main/java/org/jboss/identity/model/relation/RelationshipType.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -1,32 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.model.relation;
-
-/**
- * Defines a <b>relationship</b> between groups, domains etc
- * @author Anil.Saldhana(a)redhat.com
- * @since Jul 9, 2008
- */
-public interface RelationshipType
-{
- String getName();
-}
\ No newline at end of file
Deleted: trunk/identity-model/src/main/java/org/jboss/identity/model/roles/RoleType.java
===================================================================
---
trunk/identity-model/src/main/java/org/jboss/identity/model/roles/RoleType.java 2008-09-05
10:09:37 UTC (rev 64)
+++
trunk/identity-model/src/main/java/org/jboss/identity/model/roles/RoleType.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -1,40 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.model.roles;
-
-import org.jboss.identity.model.IdentityObjectType;
-import org.jboss.identity.model.policy.RelationshipPolicy;
-
-import java.util.List;
-
-/**
- * Type of Role
- * @author Anil.Saldhana(a)redhat.com
- * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
- * @since Jun 30, 2008
- */
-public interface RoleType extends IdentityObjectType
-{
-
-
-
-}
\ No newline at end of file
Deleted:
trunk/identity-model/src/main/java/org/jboss/identity/model/roles/RoleTypeEnum.java
===================================================================
---
trunk/identity-model/src/main/java/org/jboss/identity/model/roles/RoleTypeEnum.java 2008-09-05
10:09:37 UTC (rev 64)
+++
trunk/identity-model/src/main/java/org/jboss/identity/model/roles/RoleTypeEnum.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -1,67 +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.model.roles;
-
-import org.jboss.identity.model.IdentityObjectType;
-import org.jboss.identity.model.policy.RelationshipPolicy;
-
-import java.util.List;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
- * @author Anil.Saldhana(a)redhat.com
- * @version : 0.1 $
- */
-public enum RoleTypeEnum implements RoleType
-{
- /**
- * Plain Role
- */
- ROLE_REGULAR,
- /**
- * A role that is nested within another
- */
- ROLE_NESTED,
- /**
- * A role that is part of an hierarchy
- * (Eg. LDAP Role)
- */
- ROLE_HIERARCHICAL,
- /**
- * Custom Role
- */
- ROLE_CUSTOM;
-
-
- public String getName()
- {
- return this.name();
- }
-
- public List<RelationshipPolicy<IdentityObjectType, IdentityObjectType>>
getRelationshipPolicies()
- {
- return null;
- }
-
-}
Added: trunk/identity-spi/pom.xml
===================================================================
--- trunk/identity-spi/pom.xml (rev 0)
+++ trunk/identity-spi/pom.xml 2008-09-10 11:29:05 UTC (rev 65)
@@ -0,0 +1,46 @@
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.jboss.identity</groupId>
+ <artifactId>jboss-identity-parent</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../parent</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>jboss-identity-spi</artifactId>
+ <packaging>jar</packaging>
+ <name>JBoss Identity SPI</name>
+ <
url>http://labs.jboss.org/portal/jbosssecurity/</url>
+ <description>JBoss Identity SPI</description>
+ <licenses>
+ <license>
+ <name>lgpl</name>
+ <
url>http://repository.jboss.com/licenses/lgpl.txt</url>
+ </license>
+ </licenses>
+ <organization>
+ <name>JBoss Inc.</name>
+ <url>http://www.jboss.org</url>
+ </organization>
+ <scm>
+
<
connection>scm:svn:http://anonsvn.jboss.org/repos/jbossidentity/trunk&...
+
<
developerConnection>scm:svn:https://svn.jboss.org/jbossidentity/trunk&...
+
<
url>http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossidentity/trunk<...
+ </scm>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.identity</groupId>
+ <artifactId>jboss-identity-common</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.identity</groupId>
+ <artifactId>jboss-identity-model</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
Added:
trunk/identity-spi/src/main/java/org/jboss/identity/spi/exception/IdentityTypeNotSupportedException.java
===================================================================
---
trunk/identity-spi/src/main/java/org/jboss/identity/spi/exception/IdentityTypeNotSupportedException.java
(rev 0)
+++
trunk/identity-spi/src/main/java/org/jboss/identity/spi/exception/IdentityTypeNotSupportedException.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.spi.exception;
+
+import org.jboss.identity.exception.IdentityException;
+
+/**
+ * <p>Represents an exception that
+ * the corresponding IdentityType is
+ * not supported</p>
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Jul 10, 2008
+ */
+public class IdentityTypeNotSupportedException extends IdentityException
+{
+ private static final long serialVersionUID = 1L;
+}
Added:
trunk/identity-spi/src/main/java/org/jboss/identity/spi/policy/IdentityTypePolicy.java
===================================================================
---
trunk/identity-spi/src/main/java/org/jboss/identity/spi/policy/IdentityTypePolicy.java
(rev 0)
+++
trunk/identity-spi/src/main/java/org/jboss/identity/spi/policy/IdentityTypePolicy.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.spi.policy;
+
+/**
+ * Marker Interface to indicate a policy
+ * that governs one or more IdentityType(s)
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Jul 13, 2008
+ */
+public interface IdentityTypePolicy
+{
+}
\ No newline at end of file
Added:
trunk/identity-spi/src/main/java/org/jboss/identity/spi/policy/PasswordExpirationPolicy.java
===================================================================
---
trunk/identity-spi/src/main/java/org/jboss/identity/spi/policy/PasswordExpirationPolicy.java
(rev 0)
+++
trunk/identity-spi/src/main/java/org/jboss/identity/spi/policy/PasswordExpirationPolicy.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.spi.policy;
+
+import org.jboss.identity.model.core.IdentityObjectType;
+
+/**
+ * Policy to govern Passwords
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Jul 13, 2008
+ */
+public interface PasswordExpirationPolicy<P extends IdentityObjectType>
+extends IdentityTypePolicy
+{
+}
\ No newline at end of file
Added:
trunk/identity-spi/src/main/java/org/jboss/identity/spi/policy/RelationshipPolicy.java
===================================================================
---
trunk/identity-spi/src/main/java/org/jboss/identity/spi/policy/RelationshipPolicy.java
(rev 0)
+++
trunk/identity-spi/src/main/java/org/jboss/identity/spi/policy/RelationshipPolicy.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.spi.policy;
+
+import org.jboss.identity.model.core.IdentityObjectType;
+import org.jboss.identity.exception.PolicyValidationException;
+
+/**
+ * A Policy that governs the Relationships
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Jul 13, 2008
+ */
+public interface RelationshipPolicy<P extends IdentityObjectType, Q extends
IdentityObjectType>
+extends IdentityTypePolicy
+{
+ /**
+ * Define a relationship
+ * @param pIdentityType
+ * @param qIdentityType
+ */
+ void definePolicy(P pIdentityType, Q qIdentityType);
+
+ /**
+ * Validate a relationship
+ * @param typeA first type
+ * @param typeB second type
+ * @throws PolicyValidationException
+ */
+ void validate(P typeA, Q typeB)
+ throws PolicyValidationException;
+}
\ No newline at end of file
Copied:
trunk/identity-spi/src/main/java/org/jboss/identity/spi/repository/IdentityStoreRepository.java
(from rev 62,
trunk/identity-api/src/main/java/org/jboss/identity/api/store/IdentityStoreRepository.java)
===================================================================
---
trunk/identity-spi/src/main/java/org/jboss/identity/spi/repository/IdentityStoreRepository.java
(rev 0)
+++
trunk/identity-spi/src/main/java/org/jboss/identity/spi/repository/IdentityStoreRepository.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.spi.repository;
+
+import java.util.Map;
+import java.util.Set;
+import java.util.List;
+
+import org.jboss.identity.model.core.IdentityObjectType;
+import org.jboss.identity.spi.store.IdentityStore;
+import org.jboss.identity.spi.policy.RelationshipPolicy;
+
+/**
+ * IdentityStoreRepository exposes identity object management
+ * operations and act as an entry point to many underlying data stores.
+ * Its responsibility is to map identity objects, their state and relations
+ * between them across different identity stores.
+ * @author boleslaw dot dawidowicz at redhat anotherdot com
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Jul 10, 2008
+ */
+public interface IdentityStoreRepository extends IdentityStore
+{
+ /**
+ * @return a set of configured identity stores
+ */
+ Set<IdentityStore> getConfiguredIdentityStores();
+
+ /**
+ * @return mapping of IdentityType to the specific identity store
+ */
+ Map<IdentityObjectType, IdentityStore> getIdentityStoreMappings();
+
+ /**
+ * @param identityObjectType
+ * @return proper identity store to store given identity type
+ */
+ IdentityStore getIdentityStore(IdentityObjectType identityObjectType);
+
+
+ /**
+ * Return a list of relationship policies
+ * @return
+ */
+ List<RelationshipPolicy<IdentityObjectType, IdentityObjectType>>
getRelationshipPolicies(IdentityObjectType identityObjectType);
+
+}
\ No newline at end of file
Copied:
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/FeaturesDescription.java
(from rev 62,
trunk/identity-api/src/main/java/org/jboss/identity/api/store/FeaturesDescription.java)
===================================================================
---
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/FeaturesDescription.java
(rev 0)
+++
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/FeaturesDescription.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -0,0 +1,98 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.spi.store;
+
+import java.util.Set;
+import java.util.Map;
+
+import org.jboss.identity.model.core.IdentityObjectType;
+import org.jboss.identity.model.core.IdentityObjectRelationshipType;
+import org.jboss.identity.spi.exception.IdentityTypeNotSupportedException;
+import org.jboss.identity.exception.IdentityException;
+
+/**
+ * Describe the features supported by an Identity Store
+ * @author boleslaw dot dawidowicz at redhat anotherdot com
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Jul 10, 2008
+ */
+public interface FeaturesDescription
+{
+ /**
+ * Get the supported operations
+ * @param identityObjectType a type representing identity, role, group
+ * @return supported operations for given identity type
+ * @throws org.jboss.identity.spi.exception.IdentityTypeNotSupportedException
+ */
+ public Set<OperationType> getSupportedOperations(IdentityObjectType
identityObjectType)
+ throws IdentityTypeNotSupportedException;
+
+ /**
+ * @param operationType
+ * @param identityObjectType
+ * @return if given operation on given identity type is supported
+ * @throws IdentityTypeNotSupportedException
+ */
+ boolean isOperationSupported(OperationType operationType,
+ IdentityObjectType identityObjectType) throws
IdentityTypeNotSupportedException;
+
+
+ /**
+ * @param operationType
+ * @return set of identity types that can be processed with a given operation
+ * @throws org.jboss.identity.exception.IdentityException
+ */
+ public Set<IdentityObjectType> getSupportedIdentities(OperationType
operationType);
+
+ /**
+ * @return set of identity types that can be persisted
+ */
+ Set<IdentityObjectType> getSupportedIdentities();
+
+ /**
+ * @param identityObjectType
+ * @return boolean describing if given identity type can be persisted or retrieved
using this identity store
+ */
+ boolean isIdentitySupported(IdentityObjectType identityObjectType);
+
+ /**
+ * @param fromType
+ * @param toType
+ * @param relationshipType
+ * @return true is given relationship can be persisted or retrieved
+ * @throws org.jboss.identity.exception.IdentityException
+ */
+ boolean isRelationshipSupported(IdentityObjectType fromType, IdentityObjectType
toType,
+ IdentityObjectRelationshipType relationshipType)
+ throws IdentityException;
+
+ /**
+ * @return Set of RelationshipType supported in this store
+ */
+ Set<IdentityObjectRelationshipType> getSupportedRelationshipTypes();
+
+ /**
+ * @return A mapping of RelationshipType and IdentityType objects that can have such
relationship in this store
+ */
+ Map<IdentityObjectRelationshipType, Map<IdentityObjectType,
IdentityObjectType>> getSupportedRelationshipTypeMappings();
+
+}
\ No newline at end of file
Copied: trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/IdentityStore.java
(from rev 62,
trunk/identity-api/src/main/java/org/jboss/identity/api/store/IdentityStore.java)
===================================================================
--- trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/IdentityStore.java
(rev 0)
+++
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/IdentityStore.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -0,0 +1,264 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.spi.store;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.identity.model.core.IdentityObject;
+import org.jboss.identity.model.core.IdentityObjectType;
+import org.jboss.identity.model.core.IdentityObjectRelationshipType;
+import org.jboss.identity.exception.IdentityException;
+
+/**
+ * Represents an Identity Store
+ * @author boleslaw dot dawidowicz at redhat anotherdot com
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Jul 10, 2008
+ */
+public interface IdentityStore
+{
+ /**
+ * Set up the store
+ */
+ void bootstrap() throws IOException;
+
+ /**
+ * @return id of this identity store
+ */
+ String getId();
+
+
+ /**
+ * @return FeaturesDescription object describing what
+ * operation are supported by this store
+ */
+ FeaturesDescription getSupportedFeatures();
+
+
+ // Operations
+
+ /**
+ * Create new identity with a given name
+ *
+ * @param name
+ * @param identityObjectType
+ * @return
+ * @throws IdentityException
+ */
+ IdentityObject createIdentity(String name, IdentityObjectType identityObjectType)
throws IdentityException;
+
+ /**
+ * Remove given identity
+ *
+ * @param identity
+ * @throws IdentityException
+ */
+ void removeIdentity(IdentityObject identity) throws IdentityException;
+
+ /**
+ * @param identityType
+ * @return a number of stored identities with a given type
+ * @throws IdentityException
+ */
+ <T extends IdentityObjectType> int getIdentitiesCount(T identityType)
+ throws IdentityException;
+
+ /**
+ * Find identity with a given name
+ *
+ * @param name
+ * @param identityObjectType
+ * @return
+ * @throws IdentityException
+ */
+ IdentityObject findIdentity(String name, IdentityObjectType identityObjectType) throws
IdentityException;
+
+ /**
+ * Find identity with a given id
+ *
+ * @param id
+ * @return
+ * @throws IdentityException
+ */
+ IdentityObject findIdentity(Object id) throws IdentityException;
+
+ /**
+ * Find identities with a given type paginated and ordered.
+ * If the paginatedSearch or orderedSearch operations
+ * are not supported in this store implementation, dedicated
+ * parameters will take no effect
+ *
+ * @param identityType
+ * @param offset
+ * @param limit 0 means unlimited page size
+ * @param orderedByAttributeName can be null
+ * @param ascending default true
+ * @return
+ * @throws IdentityException
+ */
+ <T extends IdentityObjectType> Collection<IdentityObject> findIdentities(T
identityType,
+ int offset, int limit,
+ String orderedByAttributeName,
+ boolean ascending) throws IdentityException;
+
+ /**
+ * Find identities with a given attributes values. If the paginatedSearch or
+ * orderedSearch operations
+ * are not supported in this store implementation, dedicated parameters will take no
effect
+ *
+ * @param identityType
+ * @param attributes
+ * @param offset
+ * @param limit 0 means unlimited page size
+ * @param orderedByAttributeName can be null
+ * @param ascending default true
+ * @return
+ * @throws IdentityException
+ */
+ <T extends IdentityObjectType> Collection<IdentityObject> findIdentities(T
identityType,
+ Map<String, String[]> attributes,
+ int offset, int limit,
+ String orderedByAttributeName, boolean ascending)
throws IdentityException;
+
+ /**
+ * Find identites that have relationship with given identity. Relationships are
directional (from parent to child).
+ * If the paginatedSearch or orderedSearch operations
+ * are not supported in this store implementation, dedicated parameters will
+ * take no effect
+ *
+ * @param identity
+ * @param relationshipType
+ * @param parent defines if given identity is parent or child side in the
+ * relationship - default is true (parent)
+ * @param offset
+ * @param limit 0 means unlimited page size
+ * @param orderedByAttributeName can be null
+ * @param ascending default true
+ * @return
+ * @throws IdentityException
+ */
+ <R extends IdentityObjectRelationshipType>Collection<IdentityObject>
findIdentities(IdentityObject identity,
+ R relationshipType,
+ boolean parent,
+ int offset, int limit,
+ String orderedByAttributeName,
+ boolean ascending) throws IdentityException;
+
+ /**
+ * @param identityType
+ * @return names of supported attributes
+ * @throws IdentityException
+ */
+ <T extends IdentityObjectType> Set<String> getSupportedAttributeNames(T
identityType)
+ throws IdentityException;
+
+ /**
+ * Get attributes for the given identity
+ *
+ * @param identity
+ * @return
+ * @throws IdentityException
+ */
+ Map<String, String[]> getAttributes(IdentityObject identity) throws
IdentityException;
+
+ /**
+ * Update attributes with new values - previous values will be overwritten
+ * @param identity
+ * @param attributes
+ * @throws IdentityException
+ */
+ void updateAttributes(IdentityObject identity, Map<String, String[]>
attributes)
+ throws IdentityException;
+
+ /**
+ * Add new attributes - if attribute with given name already exists the values
+ * will be appended
+ *
+ * @param identity
+ * @param attributes
+ * @throws IdentityException
+ */
+ void addAttributes(IdentityObject identity, Map<String, String[]> attributes)
+ throws IdentityException;
+
+ /**
+ * Remove attributes
+ *
+ * @param identity
+ * @param attributes
+ */
+ void removeAttributes(IdentityObject identity, Set<String> attributes)
+ throws IdentityException;
+
+ /**
+ * Create directional relationship of a given type between identities
+ *
+ * @param fromIdentity
+ * @param toIdentity
+ * @param relationshipType
+ * @throws IdentityException
+ */
+ <R extends IdentityObjectRelationshipType> void
createRelationship(IdentityObject fromIdentity,
+ IdentityObject toIdentity,
+ R relationshipType) throws IdentityException;
+
+ /**
+ * Remove relationship between identities. Relationships can be directional so
+ * order of parameters matters
+ *
+ * @param fromIdentity
+ * @param toIdentity
+ * @param relationshipType
+ * @throws IdentityException
+ */
+ <R extends IdentityObjectRelationshipType> void
removeRelationship(IdentityObject fromIdentity,
+ IdentityObject toIdentity,
+ R relationshipType) throws IdentityException;
+
+ /**
+ * Remove all relationships between identities. Direction of relationships doesn't
+ * matter - all active relationships
+ * will be removed
+ *
+ * @param identity1
+ * @param identity2
+ * @throws IdentityException
+ */
+ void removeRelationships(IdentityObject identity1, IdentityObject identity2)
+ throws IdentityException;
+
+ /**
+ * Resolve relationship types between two identities. Relationships can be directional
+ * so order of parameters matters
+ *
+ * @param fromIdentity
+ * @param toIdentity
+ * @return
+ * @throws IdentityException
+ */
+ Set<IdentityObjectRelationshipType> resolveRelationships(IdentityObject
fromIdentity, IdentityObject toIdentity)
+ throws IdentityException;
+
+}
\ No newline at end of file
Copied: trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/OperationType.java
(from rev 46,
trunk/identity-api/src/main/java/org/jboss/identity/api/store/OperationType.java)
===================================================================
--- trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/OperationType.java
(rev 0)
+++
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/OperationType.java 2008-09-10
11:29:05 UTC (rev 65)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.spi.store;
+
+/**
+ * Operations supported by the Identity Stores
+ * @author boleslaw dot dawidowicz at redhat anotherdot com
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Jul 10, 2008
+ */
+public enum OperationType
+{
+ // createIdentity
+ create,
+
+ // removeIdentity
+ remove,
+
+ // updateAttribute, updateAttributes, addAttributes
+ updateAttributes,
+
+ // resolveRelationships
+ resolveRelationships,
+
+ // createRelationship
+ modifyRelationships,
+
+ // pagination in findIdentities
+ paginatedSearch,
+
+ // ordering in findIdentities
+ orderedSearch;
+
+
+ public String getName()
+ {
+ return this.name();
+ }
+}
\ No newline at end of file
Modified: trunk/parent/pom.xml
===================================================================
--- trunk/parent/pom.xml 2008-09-05 10:09:37 UTC (rev 64)
+++ trunk/parent/pom.xml 2008-09-10 11:29:05 UTC (rev 65)
@@ -90,6 +90,11 @@
<version>3.8.1</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>javax.persistence</groupId>
+ <artifactId>persistence-api</artifactId>
+ <version>1.0</version>
+ </dependency>
</dependencies>
</dependencyManagement>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2008-09-05 10:09:37 UTC (rev 64)
+++ trunk/pom.xml 2008-09-10 11:29:05 UTC (rev 65)
@@ -15,7 +15,9 @@
<modules>
<module>parent</module>
+ <module>identity-common</module>
<module>identity-model</module>
+ <module>identity-spi</module>
<module>identity-api</module>
<module>identity-impl</module>
<module>assembly</module>