Author: bdaw
Date: 2008-09-10 15:22:59 -0400 (Wed, 10 Sep 2008)
New Revision: 72
Added:
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/ConfigurationService.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/PropertyGroup.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/AttributeStore.java
Modified:
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/IdentityObjectRelationshipType.java
trunk/identity-model/src/main/java/org/jboss/identity/model/core/IdentityObjectType.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/attribute/PasswordAttribute.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/IdentityStore.java
Log:
- few more cleanups
- Simple ConfigurationService
- Separate AttributeStore
Modified:
trunk/identity-model/src/main/java/org/jboss/identity/model/core/IdentityObject.java
===================================================================
---
trunk/identity-model/src/main/java/org/jboss/identity/model/core/IdentityObject.java 2008-09-10
16:04:34 UTC (rev 71)
+++
trunk/identity-model/src/main/java/org/jboss/identity/model/core/IdentityObject.java 2008-09-10
19:22:59 UTC (rev 72)
@@ -22,8 +22,6 @@
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;
Modified:
trunk/identity-model/src/main/java/org/jboss/identity/model/core/IdentityObjectAttribute.java
===================================================================
---
trunk/identity-model/src/main/java/org/jboss/identity/model/core/IdentityObjectAttribute.java 2008-09-10
16:04:34 UTC (rev 71)
+++
trunk/identity-model/src/main/java/org/jboss/identity/model/core/IdentityObjectAttribute.java 2008-09-10
19:22:59 UTC (rev 72)
@@ -26,6 +26,7 @@
/**
* An attribute of 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 IdentityObjectAttribute
Modified:
trunk/identity-model/src/main/java/org/jboss/identity/model/core/IdentityObjectRelationshipType.java
===================================================================
---
trunk/identity-model/src/main/java/org/jboss/identity/model/core/IdentityObjectRelationshipType.java 2008-09-10
16:04:34 UTC (rev 71)
+++
trunk/identity-model/src/main/java/org/jboss/identity/model/core/IdentityObjectRelationshipType.java 2008-09-10
19:22:59 UTC (rev 72)
@@ -22,7 +22,7 @@
package org.jboss.identity.model.core;
/**
- * Defines a <b>relationship</b> between groups, domains etc
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
* @author Anil.Saldhana(a)redhat.com
* @since Jul 9, 2008
*/
Modified:
trunk/identity-model/src/main/java/org/jboss/identity/model/core/IdentityObjectType.java
===================================================================
---
trunk/identity-model/src/main/java/org/jboss/identity/model/core/IdentityObjectType.java 2008-09-10
16:04:34 UTC (rev 71)
+++
trunk/identity-model/src/main/java/org/jboss/identity/model/core/IdentityObjectType.java 2008-09-10
19:22:59 UTC (rev 72)
@@ -25,8 +25,6 @@
/**
- * 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
Modified:
trunk/identity-spi/src/main/java/org/jboss/identity/spi/attribute/PasswordAttribute.java
===================================================================
---
trunk/identity-spi/src/main/java/org/jboss/identity/spi/attribute/PasswordAttribute.java 2008-09-10
16:04:34 UTC (rev 71)
+++
trunk/identity-spi/src/main/java/org/jboss/identity/spi/attribute/PasswordAttribute.java 2008-09-10
19:22:59 UTC (rev 72)
@@ -22,10 +22,8 @@
package org.jboss.identity.spi.attribute;
import java.util.Date;
-import java.util.Set;
import org.jboss.identity.model.core.IdentityObjectType;
-import org.jboss.identity.model.core.IdentityObjectType;
import org.jboss.identity.model.core.IdentityObjectAttribute;
import org.jboss.identity.spi.policy.PasswordExpirationPolicy;
Added:
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/ConfigurationService.java
===================================================================
---
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/ConfigurationService.java
(rev 0)
+++
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/ConfigurationService.java 2008-09-10
19:22:59 UTC (rev 72)
@@ -0,0 +1,59 @@
+/*
+* 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.spi.configuration;
+
+import java.util.Set;
+import java.util.Map;
+import java.util.Collection;
+
+/**
+ *
+ * Main entry point to grab configuration information
+ *
+ * //TODO: Should this be readonly (bootstrapped once) or expose setters also
+ *
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface ConfigurationService
+{
+ /**
+ * @return group of global properties
+ */
+ PropertyGroup getProperties();
+
+ /**
+ * @param groupName
+ * @return group of properties under given namespace
+ */
+ PropertyGroup getProperties(String groupName);
+
+ /**
+ * @return all property groups
+ */
+ Collection<PropertyGroup> getPropertyGroups();
+
+
+
+
+}
Added:
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/PropertyGroup.java
===================================================================
---
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/PropertyGroup.java
(rev 0)
+++
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/PropertyGroup.java 2008-09-10
19:22:59 UTC (rev 72)
@@ -0,0 +1,41 @@
+/*
+* 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.spi.configuration;
+
+import java.util.Set;
+import java.util.Map;
+
+/**
+ * Group of multivalued properties
+ *
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface PropertyGroup
+{
+
+ Map<String, Set<String>> getProperties();
+
+ Set<String> getPropertyValues(String name);
+
+}
Added: trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/AttributeStore.java
===================================================================
--- trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/AttributeStore.java
(rev 0)
+++
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/AttributeStore.java 2008-09-10
19:22:59 UTC (rev 72)
@@ -0,0 +1,88 @@
+/*
+* 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.spi.store;
+
+import org.jboss.identity.model.core.IdentityObjectType;
+import org.jboss.identity.model.core.IdentityObject;
+import org.jboss.identity.exception.IdentityException;
+
+import java.util.Set;
+import java.util.Map;
+
+/**
+ * Store for identity related attributes. Its separat interface as there is possible need
to store profiles in a
+ * distributted way (part in LDAP part in DB).
+ *
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface AttributeStore
+{
+
+ /**
+ * @param identityType
+ * @return names of supported attributes
+ * @throws org.jboss.identity.exception.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;
+
+}
Modified:
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/IdentityStore.java
===================================================================
---
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/IdentityStore.java 2008-09-10
16:04:34 UTC (rev 71)
+++
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/IdentityStore.java 2008-09-10
19:22:59 UTC (rev 72)
@@ -37,7 +37,7 @@
* @author Anil.Saldhana(a)redhat.com
* @since Jul 10, 2008
*/
-public interface IdentityStore
+public interface IdentityStore extends AttributeStore
{
/**
* Set up the store
@@ -166,53 +166,9 @@
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