Author: bdaw
Date: 2008-10-21 08:21:15 -0400 (Tue, 21 Oct 2008)
New Revision: 108
Added:
trunk/identity-api/src/main/java/org/jboss/identity/api/AttributeDescription.java
trunk/identity-api/src/main/java/org/jboss/identity/api/PersistenceManagerFeaturesDescription.java
trunk/identity-api/src/main/java/org/jboss/identity/api/RelationshipManagerFeaturesDescription.java
trunk/identity-api/src/main/java/org/jboss/identity/api/RoleManagerFeaturesDescription.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/FeaturesMetaDataImpl.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/attribute/AttributeMetaData.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/FeaturesMetaData.java
Removed:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/FeaturesDescriptionImpl.java
Modified:
trunk/identity-api/src/main/java/org/jboss/identity/api/AttributesManager.java
trunk/identity-api/src/main/java/org/jboss/identity/api/PersistenceManager.java
trunk/identity-api/src/main/java/org/jboss/identity/api/RelationshipManager.java
trunk/identity-api/src/main/java/org/jboss/identity/api/RoleManager.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/AttributesManagerImpl.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/PersistenceManagerImpl.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/RelationshipManagerImpl.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/RoleManagerImpl.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/repository/FallbackIdentityStoreRepository.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/repository/WrapperIdentityStoreRepository.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/hibernate/HibernateIdentityStoreImpl.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/ldap/LDAPIdentityStore.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/IdentityStore.java
Log:
More metadata improvements
Added: trunk/identity-api/src/main/java/org/jboss/identity/api/AttributeDescription.java
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api/AttributeDescription.java
(rev 0)
+++
trunk/identity-api/src/main/java/org/jboss/identity/api/AttributeDescription.java 2008-10-21
12:21:15 UTC (rev 108)
@@ -0,0 +1,48 @@
+/*
+* 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;
+
+/**
+ * Information about attribute
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface AttributeDescription
+{
+
+ /**
+ * @return
+ */
+ boolean isReadonly();
+
+ /**
+ * @return
+ */
+ boolean isMultivalue();
+
+ /**
+ * @return
+ */
+ boolean isRequired();
+
+}
Modified: trunk/identity-api/src/main/java/org/jboss/identity/api/AttributesManager.java
===================================================================
---
trunk/identity-api/src/main/java/org/jboss/identity/api/AttributesManager.java 2008-10-21
11:05:46 UTC (rev 107)
+++
trunk/identity-api/src/main/java/org/jboss/identity/api/AttributesManager.java 2008-10-21
12:21:15 UTC (rev 108)
@@ -41,10 +41,25 @@
*/
IdentitySession getIdentitySession();
- //TODO: Add FeaturesDescription
+ /**
+ * Get AttributeDesciption object for single attribute supported with a given
IdentityType
+ *
+ * @param identityType
+ * @param name
+ * @return
+ */
+ AttributeDescription getAttributeDescription(IdentityType identityType, String name);
/**
+ * Get AttributeDesciption object for all attributes supported with a given
IdentityType
+ *
* @param identityType
+ * @return
+ */
+ Map<String, AttributeDescription>
getSupportedAttributesDescriptions(IdentityType identityType);
+
+ /**
+ * @param identityType
* @return names of supported attributes
* @throws org.jboss.identity.exception.IdentityException
*/
Modified: trunk/identity-api/src/main/java/org/jboss/identity/api/PersistenceManager.java
===================================================================
---
trunk/identity-api/src/main/java/org/jboss/identity/api/PersistenceManager.java 2008-10-21
11:05:46 UTC (rev 107)
+++
trunk/identity-api/src/main/java/org/jboss/identity/api/PersistenceManager.java 2008-10-21
12:21:15 UTC (rev 108)
@@ -42,8 +42,12 @@
IdentitySession getIdentitySession();
- //TODO: Add FeaturesDescription
+ /**
+ * @return
+ */
+ PersistenceManagerFeaturesDescription getFeaturesDescription();
+
// Create
/**
Added:
trunk/identity-api/src/main/java/org/jboss/identity/api/PersistenceManagerFeaturesDescription.java
===================================================================
---
trunk/identity-api/src/main/java/org/jboss/identity/api/PersistenceManagerFeaturesDescription.java
(rev 0)
+++
trunk/identity-api/src/main/java/org/jboss/identity/api/PersistenceManagerFeaturesDescription.java 2008-10-21
12:21:15 UTC (rev 108)
@@ -0,0 +1,63 @@
+/*
+* 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>
+ * @version : 0.1 $
+ */
+public interface PersistenceManagerFeaturesDescription
+{
+
+ /**
+ * @return
+ */
+ boolean isIdentitiesCreationSupported();
+
+ /**
+ * @return
+ */
+ boolean isGroupsCreationSupported();
+
+ /**
+ * @return
+ */
+ boolean isIdentitiesSortedSearchSupported();
+
+ /**
+ * @param groupType
+ * @return
+ */
+ boolean isGroupsSortedSearchSupported(GroupType groupType);
+
+ /**
+ * @return
+ */
+ boolean isIdentitiesPaginatedSearchSupported();
+
+ /**
+ * @param groupType
+ * @return
+ */
+ boolean isGroupsPaginatedSearchSupported(GroupType groupType);
+}
Modified:
trunk/identity-api/src/main/java/org/jboss/identity/api/RelationshipManager.java
===================================================================
---
trunk/identity-api/src/main/java/org/jboss/identity/api/RelationshipManager.java 2008-10-21
11:05:46 UTC (rev 107)
+++
trunk/identity-api/src/main/java/org/jboss/identity/api/RelationshipManager.java 2008-10-21
12:21:15 UTC (rev 108)
@@ -40,7 +40,10 @@
*/
IdentitySession getIdentitySession();
- //TODO: Add FeaturesDescription
+ /**
+ * @return
+ */
+ RelationshipManagerFeaturesDescription getFeaturesDescription();
// Assignation
Added:
trunk/identity-api/src/main/java/org/jboss/identity/api/RelationshipManagerFeaturesDescription.java
===================================================================
---
trunk/identity-api/src/main/java/org/jboss/identity/api/RelationshipManagerFeaturesDescription.java
(rev 0)
+++
trunk/identity-api/src/main/java/org/jboss/identity/api/RelationshipManagerFeaturesDescription.java 2008-10-21
12:21:15 UTC (rev 108)
@@ -0,0 +1,69 @@
+/*
+* 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>
+ * @version : 0.1 $
+ */
+public interface RelationshipManagerFeaturesDescription
+{
+
+ /**
+ * @param fromGroupType
+ * @return
+ */
+ boolean isIdentityAssociationSupported(GroupType fromGroupType);
+
+ /**
+ * @param fromGroupType
+ * @param toGroupType
+ * @return
+ */
+ boolean isGroupAssociationSupported(GroupType fromGroupType, GroupType toGroupType);
+
+ /**
+ * @return
+ */
+ boolean isIdentitiesSortedSearchSupported();
+
+ /**
+ * @param groupType
+ * @return
+ */
+ boolean isGroupsSortedSearchSupported(GroupType groupType);
+
+ /**
+ * @return
+ */
+ boolean isIdentitiesPaginatedSearchSupported();
+
+ /**
+ * @param groupType
+ * @return
+ */
+ boolean isGroupsPaginatedSearchSupported(GroupType groupType);
+
+
+
+}
Modified: trunk/identity-api/src/main/java/org/jboss/identity/api/RoleManager.java
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api/RoleManager.java 2008-10-21
11:05:46 UTC (rev 107)
+++ trunk/identity-api/src/main/java/org/jboss/identity/api/RoleManager.java 2008-10-21
12:21:15 UTC (rev 108)
@@ -43,7 +43,10 @@
*/
IdentitySession getIdentitySession();
- //TODO: Add FeaturesDescription
+ /**
+ * @return
+ */
+ RoleManagerFeaturesDescription getSupportedFeatures();
// RoleType
Added:
trunk/identity-api/src/main/java/org/jboss/identity/api/RoleManagerFeaturesDescription.java
===================================================================
---
trunk/identity-api/src/main/java/org/jboss/identity/api/RoleManagerFeaturesDescription.java
(rev 0)
+++
trunk/identity-api/src/main/java/org/jboss/identity/api/RoleManagerFeaturesDescription.java 2008-10-21
12:21:15 UTC (rev 108)
@@ -0,0 +1,62 @@
+/*
+* 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>
+ * @version : 0.1 $
+ */
+public interface RoleManagerFeaturesDescription
+{
+ /**
+ * @return
+ */
+ boolean isRoleTypeCreationSupported();
+
+ /**
+ * @return
+ */
+ boolean isRoleTypeRemovalSupported();
+
+ /**
+ * @return
+ */
+ boolean isRoleSortedSearchSupported();
+
+ /**
+ * @param groupType
+ * @return
+ */
+ boolean isRoleTypeSortedSearchSupported(GroupType groupType);
+
+ /**
+ * @return
+ */
+ boolean isRolePaginatedSearchSupported();
+
+ /**
+ * @param groupType
+ * @return
+ */
+ boolean isRoleTypePaginatedSearchSupported(GroupType groupType);
+}
Modified:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/AttributesManagerImpl.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/AttributesManagerImpl.java 2008-10-21
11:05:46 UTC (rev 107)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/AttributesManagerImpl.java 2008-10-21
12:21:15 UTC (rev 108)
@@ -26,6 +26,7 @@
import org.jboss.identity.api.AttributesManager;
import org.jboss.identity.api.IdentityType;
import org.jboss.identity.api.Identity;
+import org.jboss.identity.api.AttributeDescription;
import org.jboss.identity.exception.IdentityException;
import org.jboss.identity.impl.NotYetImplementedException;
@@ -45,6 +46,16 @@
super(session);
}
+ public AttributeDescription getAttributeDescription(IdentityType identityType, String
name)
+ {
+ return null;
+ }
+
+ public Map<String, AttributeDescription>
getSupportedAttributesDescriptions(IdentityType identityType)
+ {
+ return null;
+ }
+
//TODO: fix to have similar signatures in API/SPI for String[] and avoid unnesesary
iterations
public Set<String> getSupportedAttributeNames(IdentityType identityType) throws
IdentityException
Modified:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/PersistenceManagerImpl.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/PersistenceManagerImpl.java 2008-10-21
11:05:46 UTC (rev 107)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/PersistenceManagerImpl.java 2008-10-21
12:21:15 UTC (rev 108)
@@ -28,6 +28,7 @@
import org.jboss.identity.api.GroupType;
import org.jboss.identity.api.IdentityType;
import org.jboss.identity.api.IdentitySession;
+import org.jboss.identity.api.PersistenceManagerFeaturesDescription;
import org.jboss.identity.exception.IdentityException;
import org.jboss.identity.spi.model.IdentityObjectType;
import org.jboss.identity.spi.model.IdentityObject;
@@ -52,6 +53,11 @@
super(session);
}
+ public PersistenceManagerFeaturesDescription getFeaturesDescription()
+ {
+ return null;
+ }
+
public Identity createIdentity(String identityName) throws IdentityException
{
IdentityObjectType iot = getIdentityObjectType();
Modified:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/RelationshipManagerImpl.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/RelationshipManagerImpl.java 2008-10-21
11:05:46 UTC (rev 107)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/RelationshipManagerImpl.java 2008-10-21
12:21:15 UTC (rev 108)
@@ -28,6 +28,7 @@
import org.jboss.identity.api.Identity;
import org.jboss.identity.api.IdentityType;
import org.jboss.identity.api.GroupType;
+import org.jboss.identity.api.RelationshipManagerFeaturesDescription;
import org.jboss.identity.exception.IdentityException;
import org.jboss.identity.spi.model.IdentityObjectRelationshipType;
import org.jboss.identity.spi.model.IdentityObjectRelationship;
@@ -56,6 +57,11 @@
super(session);
}
+ public RelationshipManagerFeaturesDescription getFeaturesDescription()
+ {
+ return null;
+ }
+
public void associateGroups(Collection<Group> parents, Collection<Group>
members) throws IdentityException
{
for (Iterator<Group> parentsIterator = parents.iterator();
parentsIterator.hasNext();)
Modified:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/RoleManagerImpl.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/RoleManagerImpl.java 2008-10-21
11:05:46 UTC (rev 107)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/RoleManagerImpl.java 2008-10-21
12:21:15 UTC (rev 108)
@@ -29,6 +29,7 @@
import org.jboss.identity.api.Identity;
import org.jboss.identity.api.Group;
import org.jboss.identity.api.IdentityType;
+import org.jboss.identity.api.RoleManagerFeaturesDescription;
import org.jboss.identity.exception.IdentityException;
import org.jboss.identity.spi.model.IdentityObjectRelationshipType;
import org.jboss.identity.spi.model.IdentityObjectRelationship;
@@ -58,6 +59,11 @@
super(session);
}
+ public RoleManagerFeaturesDescription getSupportedFeatures()
+ {
+ return null;
+ }
+
public RoleType createRoleType(String name) throws IdentityException
{
String roleType = null;
Modified:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/repository/FallbackIdentityStoreRepository.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/repository/FallbackIdentityStoreRepository.java 2008-10-21
11:05:46 UTC (rev 107)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/repository/FallbackIdentityStoreRepository.java 2008-10-21
12:21:15 UTC (rev 108)
@@ -24,7 +24,7 @@
import org.jboss.identity.spi.store.IdentityStore;
import org.jboss.identity.spi.store.AttributeStore;
-import org.jboss.identity.spi.store.FeaturesDescription;
+import org.jboss.identity.spi.store.FeaturesMetaData;
import org.jboss.identity.spi.store.IdentityStoreInvocationContext;
import org.jboss.identity.spi.model.IdentityObject;
import org.jboss.identity.spi.model.IdentityObjectType;
@@ -71,7 +71,7 @@
return null;
}
- public FeaturesDescription getSupportedFeatures()
+ public FeaturesMetaData getSupportedFeatures()
{
return null;
}
Modified:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/repository/WrapperIdentityStoreRepository.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/repository/WrapperIdentityStoreRepository.java 2008-10-21
11:05:46 UTC (rev 107)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/repository/WrapperIdentityStoreRepository.java 2008-10-21
12:21:15 UTC (rev 108)
@@ -22,10 +22,9 @@
package org.jboss.identity.impl.repository;
-import org.jboss.identity.spi.repository.IdentityStoreRepository;
import org.jboss.identity.spi.store.IdentityStore;
import org.jboss.identity.spi.store.AttributeStore;
-import org.jboss.identity.spi.store.FeaturesDescription;
+import org.jboss.identity.spi.store.FeaturesMetaData;
import org.jboss.identity.spi.store.IdentityStoreInvocationContext;
import org.jboss.identity.spi.model.IdentityObject;
import org.jboss.identity.spi.model.IdentityObjectType;
@@ -71,7 +70,7 @@
return null;
}
- public FeaturesDescription getSupportedFeatures()
+ public FeaturesMetaData getSupportedFeatures()
{
return null;
}
Deleted:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/FeaturesDescriptionImpl.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/FeaturesDescriptionImpl.java 2008-10-21
11:05:46 UTC (rev 107)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/FeaturesDescriptionImpl.java 2008-10-21
12:21:15 UTC (rev 108)
@@ -1,80 +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.impl.store;
-
-import org.jboss.identity.spi.store.FeaturesDescription;
-import org.jboss.identity.spi.store.OperationType;
-import org.jboss.identity.spi.exception.IdentityTypeNotSupportedException;
-import org.jboss.identity.spi.model.IdentityObjectType;
-import org.jboss.identity.spi.model.IdentityObjectRelationshipType;
-import org.jboss.identity.exception.IdentityException;
-
-import java.util.Set;
-import java.util.Map;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
- * @version : 0.1 $
- */
-public class FeaturesDescriptionImpl implements FeaturesDescription
-{
- public Set<OperationType> getSupportedOperations(IdentityObjectType
identityObjectType) throws IdentityTypeNotSupportedException
- {
- return null;
- }
-
- public boolean isOperationSupported(OperationType operationType, IdentityObjectType
identityObjectType) throws IdentityTypeNotSupportedException
- {
- return true;
- }
-
- public Set<IdentityObjectType> getSupportedIdentityObjectTypes(OperationType
operationType)
- {
- return null;
- }
-
- public Set<IdentityObjectType> getSupportedIdentityObjectTypes()
- {
- return null;
- }
-
- public boolean isIdentityObjectTypeSupported(IdentityObjectType identityObjectType)
- {
- return true;
- }
-
- public boolean isRelationshipTypeSupported(IdentityObjectType fromType,
IdentityObjectType toType, IdentityObjectRelationshipType relationshipType) throws
IdentityException
- {
- return true;
- }
-
- public Set<IdentityObjectRelationshipType> getSupportedRelationshipTypes()
- {
- return null;
- }
-
- public Map<IdentityObjectRelationshipType, Map<IdentityObjectType,
IdentityObjectType>> getSupportedRelationshipTypeMappings()
- {
- return null;
- }
-}
Copied:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/FeaturesMetaDataImpl.java
(from rev 95,
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/FeaturesDescriptionImpl.java)
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/FeaturesMetaDataImpl.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/FeaturesMetaDataImpl.java 2008-10-21
12:21:15 UTC (rev 108)
@@ -0,0 +1,80 @@
+/*
+* 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.impl.store;
+
+import org.jboss.identity.spi.store.FeaturesMetaData;
+import org.jboss.identity.spi.store.OperationType;
+import org.jboss.identity.spi.exception.IdentityTypeNotSupportedException;
+import org.jboss.identity.spi.model.IdentityObjectType;
+import org.jboss.identity.spi.model.IdentityObjectRelationshipType;
+import org.jboss.identity.exception.IdentityException;
+
+import java.util.Set;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class FeaturesMetaDataImpl implements FeaturesMetaData
+{
+ public Set<OperationType> getSupportedOperations(IdentityObjectType
identityObjectType) throws IdentityTypeNotSupportedException
+ {
+ return null;
+ }
+
+ public boolean isOperationSupported(OperationType operationType, IdentityObjectType
identityObjectType) throws IdentityTypeNotSupportedException
+ {
+ return true;
+ }
+
+ public Set<IdentityObjectType> getSupportedIdentityObjectTypes(OperationType
operationType)
+ {
+ return null;
+ }
+
+ public Set<IdentityObjectType> getSupportedIdentityObjectTypes()
+ {
+ return null;
+ }
+
+ public boolean isIdentityObjectTypeSupported(IdentityObjectType identityObjectType)
+ {
+ return true;
+ }
+
+ public boolean isRelationshipTypeSupported(IdentityObjectType fromType,
IdentityObjectType toType, IdentityObjectRelationshipType relationshipType) throws
IdentityException
+ {
+ return true;
+ }
+
+ public Set<IdentityObjectRelationshipType> getSupportedRelationshipTypes()
+ {
+ return null;
+ }
+
+ public Map<IdentityObjectRelationshipType, Map<IdentityObjectType,
IdentityObjectType>> getSupportedRelationshipTypeMappings()
+ {
+ return null;
+ }
+}
Modified:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/hibernate/HibernateIdentityStoreImpl.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/hibernate/HibernateIdentityStoreImpl.java 2008-10-21
11:05:46 UTC (rev 107)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/hibernate/HibernateIdentityStoreImpl.java 2008-10-21
12:21:15 UTC (rev 108)
@@ -23,7 +23,7 @@
package org.jboss.identity.impl.store.hibernate;
import org.jboss.identity.spi.store.IdentityStore;
-import org.jboss.identity.spi.store.FeaturesDescription;
+import org.jboss.identity.spi.store.FeaturesMetaData;
import org.jboss.identity.spi.store.IdentityStoreInvocationContext;
import org.jboss.identity.spi.model.IdentityObjectRelationshipType;
import org.jboss.identity.spi.model.IdentityObject;
@@ -37,12 +37,10 @@
import org.jboss.identity.impl.model.hibernate.HibernateIdentityObjectType;
import org.jboss.identity.impl.model.hibernate.HibernateIdentityObjectRelationshipName;
import org.jboss.identity.impl.NotYetImplementedException;
-import org.jboss.identity.impl.helper.Tools;
-import org.jboss.identity.impl.store.FeaturesDescriptionImpl;
+import org.jboss.identity.impl.store.FeaturesMetaDataImpl;
import org.jboss.identity.impl.store.hibernate.HibernateIdentityStoreInvocationContext;
import org.hibernate.ejb.HibernateEntityManager;
import org.hibernate.criterion.Restrictions;
-import org.hibernate.HibernateException;
import javax.persistence.NoResultException;
import javax.persistence.Query;
@@ -50,11 +48,8 @@
import java.util.Collection;
import java.util.Map;
import java.util.List;
-import java.util.LinkedList;
import java.util.Iterator;
import java.util.HashSet;
-import java.util.Collections;
-import java.util.HashMap;
import java.io.IOException;
/**
@@ -85,13 +80,13 @@
private String id;
- private FeaturesDescription supportedFeatures;
+ private FeaturesMetaData supportedFeatures;
public HibernateIdentityStoreImpl()
{
// For now just dummy impl
//TODO: initialize with configuration
- supportedFeatures = new FeaturesDescriptionImpl();
+ supportedFeatures = new FeaturesMetaDataImpl();
}
public void start()
@@ -123,7 +118,7 @@
this.id = id;
}
- public FeaturesDescription getSupportedFeatures()
+ public FeaturesMetaData getSupportedFeatures()
{
return supportedFeatures;
}
Modified:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/ldap/LDAPIdentityStore.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/ldap/LDAPIdentityStore.java 2008-10-21
11:05:46 UTC (rev 107)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/ldap/LDAPIdentityStore.java 2008-10-21
12:21:15 UTC (rev 108)
@@ -23,7 +23,7 @@
package org.jboss.identity.impl.store.ldap;
import org.jboss.identity.spi.store.IdentityStore;
-import org.jboss.identity.spi.store.FeaturesDescription;
+import org.jboss.identity.spi.store.FeaturesMetaData;
import org.jboss.identity.spi.store.IdentityStoreInvocationContext;
import org.jboss.identity.spi.model.IdentityObject;
import org.jboss.identity.spi.model.IdentityObjectType;
@@ -31,11 +31,10 @@
import org.jboss.identity.spi.model.IdentityObjectRelationship;
import org.jboss.identity.spi.exception.OperationNotSupportedException;
import org.jboss.identity.exception.IdentityException;
-import org.jboss.identity.impl.store.FeaturesDescriptionImpl;
+import org.jboss.identity.impl.store.FeaturesMetaDataImpl;
import org.jboss.identity.impl.model.ldap.LDAPIdentityObjectImpl;
import org.jboss.identity.impl.model.ldap.LDAPIdentityObjectRelationshipImpl;
import org.jboss.identity.impl.helper.Tools;
-import org.jboss.identity.impl.helper.LDAPTools;
import org.jboss.identity.impl.NotYetImplementedException;
import javax.naming.ldap.LdapContext;
@@ -75,13 +74,13 @@
private final String id;
- private FeaturesDescription supportedFeatures;
+ private FeaturesMetaData supportedFeatures;
public LDAPIdentityStore(String id)
{
// For now just dummy impl
//TODO: initialize with configuration
- supportedFeatures = new FeaturesDescriptionImpl();
+ supportedFeatures = new FeaturesMetaDataImpl();
this.id = id;
}
@@ -95,7 +94,7 @@
return id;
}
- public FeaturesDescription getSupportedFeatures()
+ public FeaturesMetaData getSupportedFeatures()
{
return supportedFeatures;
}
Added:
trunk/identity-spi/src/main/java/org/jboss/identity/spi/attribute/AttributeMetaData.java
===================================================================
---
trunk/identity-spi/src/main/java/org/jboss/identity/spi/attribute/AttributeMetaData.java
(rev 0)
+++
trunk/identity-spi/src/main/java/org/jboss/identity/spi/attribute/AttributeMetaData.java 2008-10-21
12:21:15 UTC (rev 108)
@@ -0,0 +1,45 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.spi.attribute;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface AttributeMetaData
+{
+ /**
+ * @return
+ */
+ boolean isReadonly();
+
+ /**
+ * @return
+ */
+ boolean isMultivalue();
+
+ /**
+ * @return
+ */
+ boolean isRequired();
+}
Copied:
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/FeaturesMetaData.java (from
rev 95,
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/FeaturesDescription.java)
===================================================================
--- trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/FeaturesMetaData.java
(rev 0)
+++
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/FeaturesMetaData.java 2008-10-21
12:21:15 UTC (rev 108)
@@ -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.spi.model.IdentityObjectType;
+import org.jboss.identity.spi.model.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 FeaturesMetaData
+{
+ /**
+ * 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> getSupportedIdentityObjectTypes(OperationType
operationType);
+
+ /**
+ * @return set of identity types that can be persisted
+ */
+ Set<IdentityObjectType> getSupportedIdentityObjectTypes();
+
+ /**
+ * @param identityObjectType
+ * @return boolean describing if given identity type can be persisted or retrieved
using this identity store
+ */
+ boolean isIdentityObjectTypeSupported(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 isRelationshipTypeSupported(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
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-10-21
11:05:46 UTC (rev 107)
+++
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/IdentityStore.java 2008-10-21
12:21:15 UTC (rev 108)
@@ -57,7 +57,7 @@
* @return FeaturesDescription object describing what
* operation are supported by this store
*/
- FeaturesDescription getSupportedFeatures();
+ FeaturesMetaData getSupportedFeatures();
// Operations