JBoss Identity SVN: r400 - in idm/trunk: idm/src/main/java/org/jboss/identity/idm/impl/api/session/managers and 11 other directories.
by jboss-identity-commits@lists.jboss.org
Author: bdaw
Date: 2009-03-23 15:50:51 -0400 (Mon, 23 Mar 2009)
New Revision: 400
Added:
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchCriteria.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchCriteriumType.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/UnsupportedCriterium.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/UnsupportedQueryCriterium.java
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/search/IdentityObjectSearchCriteria.java
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/IdentityObjectSearchCriteriaType.java
idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/IdentitySearchCriteriaImpl.java
Removed:
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchConstraintType.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchConstraints.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/UnsupportedConstraint.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/UnsupportedQueryConstraint.java
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/search/IdentityObjectSearchConstraints.java
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/IdentityObjectSearchConstraintType.java
idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/IdentitySearchConstraintsImpl.java
Modified:
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/PersistenceManager.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/PersistenceManagerFeaturesDescription.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RelationshipManager.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RelationshipManagerFeaturesDescription.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RoleManager.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RoleManagerFeaturesDescription.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/GroupQuery.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/UserQuery.java
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/FeaturesMetaData.java
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/IdentityStore.java
idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/session/managers/AbstractManager.java
idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/session/managers/PersistenceManagerImpl.java
idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/session/managers/RelationshipManagerImpl.java
idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/session/managers/RoleManagerImpl.java
idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/cache/IdentityStoreCacheSupport.java
idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/cache/JBossCacheIdentityStoreWrapper.java
idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/repository/FallbackIdentityStoreRepository.java
idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/repository/WrapperIdentityStoreRepository.java
idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/store/FeaturesMetaDataImpl.java
idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/store/hibernate/HibernateIdentityStoreImpl.java
idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/store/ldap/LDAPIdentityStoreImpl.java
idm/trunk/idm/src/test/java/org/jboss/identity/idm/impl/api/PersistenceManagerTest.java
idm/trunk/idm/src/test/java/org/jboss/identity/idm/impl/api/RelationshipManagerTest.java
idm/trunk/idm/src/test/java/org/jboss/identity/idm/impl/store/CommonIdentityStoreTest.java
Log:
Update naming to more proper
Deleted: idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/IdentitySearchConstraintsImpl.java
===================================================================
--- idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/IdentitySearchConstraintsImpl.java 2009-03-23 19:25:19 UTC (rev 399)
+++ idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/IdentitySearchConstraintsImpl.java 2009-03-23 19:50:51 UTC (rev 400)
@@ -1,242 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-
-package org.jboss.identity.idm.impl.api;
-
-import org.jboss.identity.idm.api.IdentitySearchConstraints;
-import org.jboss.identity.idm.api.SortOrder;
-import org.jboss.identity.idm.api.UnsupportedConstraint;
-import org.jboss.identity.idm.spi.search.IdentityObjectSearchConstraints;
-
-import java.util.Map;
-import java.util.HashMap;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
- * @version : 0.1 $
- */
-public class IdentitySearchConstraintsImpl implements IdentitySearchConstraints, IdentityObjectSearchConstraints
-{
-
- private boolean sorted = false;
-
- private String sortByName;
-
- private boolean ascending = true;
-
- private boolean paged = false;
-
- private int firstResult;
-
- private int maxResults;
-
- private boolean filtered = false;
-
- private final Map<String, String[]> attributes = new HashMap<String, String[]>();
-
- private String filter;
-
- public IdentitySearchConstraintsImpl()
- {
-
- }
-
- public IdentitySearchConstraints sort(SortOrder order) throws UnsupportedConstraint
- {
- sorted = true;
- if (order.equals(SortOrder.ASCENDING))
- {
- ascending = true;
- }
- else
- {
- ascending = false;
- }
-
- return this;
- }
-
- public IdentitySearchConstraints sortAttributeName(String name) throws UnsupportedConstraint
- {
- sorted = true;
- sortByName = name;
-
- return this;
- }
-
- public IdentitySearchConstraints page(int firstResult, int maxResults) throws UnsupportedConstraint
- {
- paged = true;
-
- this.firstResult = firstResult;
- this.maxResults = maxResults;
-
-
- return this;
- }
-
- public IdentitySearchConstraints attributeValuesFilter(String attributeName, String[] attributeValue) throws UnsupportedConstraint
- {
- if (attributeName == null)
- {
- throw new IllegalArgumentException("Attribute name is null");
- }
-
- if (attributeValue == null)
- {
- throw new IllegalArgumentException("Attribute values are null");
-
- }
-
- filtered = true;
-
- attributes.put(attributeName, attributeValue);
-
- return this;
- }
-
- public IdentitySearchConstraints idFilter(String filter) throws UnsupportedConstraint
- {
- if (filter == null)
- {
- throw new IllegalArgumentException("ID filter is null");
- }
-
- this.filter = filter;
-
- return this;
- }
-
- public String getFilter()
- {
- return filter;
- }
-
- public boolean isSorted()
- {
- return sorted;
- }
-
- public boolean isAscending()
- {
- return ascending;
- }
-
- public String getSortAttributeName()
- {
- return sortByName;
- }
-
- public boolean isPaged()
- {
- return paged;
- }
-
- public int getFirstResult()
- {
- return firstResult;
- }
-
- public int getMaxResults()
- {
- return maxResults;
- }
-
- public boolean isFiltered()
- {
- return filtered;
- }
-
- public Map<String, String[]> getValues()
- {
- return attributes;
- }
-
- @Override
- public boolean equals(Object o)
- {
- if (this == o)
- {
- return true;
- }
- if (o == null || getClass() != o.getClass())
- {
- return false;
- }
-
- IdentitySearchConstraintsImpl that = (IdentitySearchConstraintsImpl)o;
-
- if (ascending != that.ascending)
- {
- return false;
- }
- if (filtered != that.filtered)
- {
- return false;
- }
- if (firstResult != that.firstResult)
- {
- return false;
- }
- if (maxResults != that.maxResults)
- {
- return false;
- }
- if (paged != that.paged)
- {
- return false;
- }
- if (sorted != that.sorted)
- {
- return false;
- }
- if (!attributes.equals(that.attributes))
- {
- return false;
- }
- if (filter != null ? !filter.equals(that.filter) : that.filter != null)
- {
- return false;
- }
- if (sortByName != null ? !sortByName.equals(that.sortByName) : that.sortByName != null)
- {
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode()
- {
- int result = (sorted ? 1 : 0);
- result = 31 * result + (sortByName != null ? sortByName.hashCode() : 0);
- result = 31 * result + (ascending ? 1 : 0);
- result = 31 * result + (paged ? 1 : 0);
- result = 31 * result + firstResult;
- result = 31 * result + maxResults;
- result = 31 * result + (filtered ? 1 : 0);
- result = 31 * result + attributes.hashCode();
- result = 31 * result + (filter != null ? filter.hashCode() : 0);
- return result;
- }
-}
Copied: idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/IdentitySearchCriteriaImpl.java (from rev 398, idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/IdentitySearchConstraintsImpl.java)
===================================================================
--- idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/IdentitySearchCriteriaImpl.java (rev 0)
+++ idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/IdentitySearchCriteriaImpl.java 2009-03-23 19:50:51 UTC (rev 400)
@@ -0,0 +1,242 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.impl.api;
+
+import org.jboss.identity.idm.api.IdentitySearchCriteria;
+import org.jboss.identity.idm.api.SortOrder;
+import org.jboss.identity.idm.api.UnsupportedCriterium;
+import org.jboss.identity.idm.spi.search.IdentityObjectSearchCriteria;
+
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class IdentitySearchCriteriaImpl implements IdentitySearchCriteria, IdentityObjectSearchCriteria
+{
+
+ private boolean sorted = false;
+
+ private String sortByName;
+
+ private boolean ascending = true;
+
+ private boolean paged = false;
+
+ private int firstResult;
+
+ private int maxResults;
+
+ private boolean filtered = false;
+
+ private final Map<String, String[]> attributes = new HashMap<String, String[]>();
+
+ private String filter;
+
+ public IdentitySearchCriteriaImpl()
+ {
+
+ }
+
+ public IdentitySearchCriteria sort(SortOrder order) throws UnsupportedCriterium
+ {
+ sorted = true;
+ if (order.equals(SortOrder.ASCENDING))
+ {
+ ascending = true;
+ }
+ else
+ {
+ ascending = false;
+ }
+
+ return this;
+ }
+
+ public IdentitySearchCriteria sortAttributeName(String name) throws UnsupportedCriterium
+ {
+ sorted = true;
+ sortByName = name;
+
+ return this;
+ }
+
+ public IdentitySearchCriteria page(int firstResult, int maxResults) throws UnsupportedCriterium
+ {
+ paged = true;
+
+ this.firstResult = firstResult;
+ this.maxResults = maxResults;
+
+
+ return this;
+ }
+
+ public IdentitySearchCriteria attributeValuesFilter(String attributeName, String[] attributeValue) throws UnsupportedCriterium
+ {
+ if (attributeName == null)
+ {
+ throw new IllegalArgumentException("Attribute name is null");
+ }
+
+ if (attributeValue == null)
+ {
+ throw new IllegalArgumentException("Attribute values are null");
+
+ }
+
+ filtered = true;
+
+ attributes.put(attributeName, attributeValue);
+
+ return this;
+ }
+
+ public IdentitySearchCriteria idFilter(String filter) throws UnsupportedCriterium
+ {
+ if (filter == null)
+ {
+ throw new IllegalArgumentException("ID filter is null");
+ }
+
+ this.filter = filter;
+
+ return this;
+ }
+
+ public String getFilter()
+ {
+ return filter;
+ }
+
+ public boolean isSorted()
+ {
+ return sorted;
+ }
+
+ public boolean isAscending()
+ {
+ return ascending;
+ }
+
+ public String getSortAttributeName()
+ {
+ return sortByName;
+ }
+
+ public boolean isPaged()
+ {
+ return paged;
+ }
+
+ public int getFirstResult()
+ {
+ return firstResult;
+ }
+
+ public int getMaxResults()
+ {
+ return maxResults;
+ }
+
+ public boolean isFiltered()
+ {
+ return filtered;
+ }
+
+ public Map<String, String[]> getValues()
+ {
+ return attributes;
+ }
+
+ @Override
+ public boolean equals(Object o)
+ {
+ if (this == o)
+ {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass())
+ {
+ return false;
+ }
+
+ IdentitySearchCriteriaImpl that = (IdentitySearchCriteriaImpl)o;
+
+ if (ascending != that.ascending)
+ {
+ return false;
+ }
+ if (filtered != that.filtered)
+ {
+ return false;
+ }
+ if (firstResult != that.firstResult)
+ {
+ return false;
+ }
+ if (maxResults != that.maxResults)
+ {
+ return false;
+ }
+ if (paged != that.paged)
+ {
+ return false;
+ }
+ if (sorted != that.sorted)
+ {
+ return false;
+ }
+ if (!attributes.equals(that.attributes))
+ {
+ return false;
+ }
+ if (filter != null ? !filter.equals(that.filter) : that.filter != null)
+ {
+ return false;
+ }
+ if (sortByName != null ? !sortByName.equals(that.sortByName) : that.sortByName != null)
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ int result = (sorted ? 1 : 0);
+ result = 31 * result + (sortByName != null ? sortByName.hashCode() : 0);
+ result = 31 * result + (ascending ? 1 : 0);
+ result = 31 * result + (paged ? 1 : 0);
+ result = 31 * result + firstResult;
+ result = 31 * result + maxResults;
+ result = 31 * result + (filtered ? 1 : 0);
+ result = 31 * result + attributes.hashCode();
+ result = 31 * result + (filter != null ? filter.hashCode() : 0);
+ return result;
+ }
+}
Modified: idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/session/managers/AbstractManager.java
===================================================================
--- idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/session/managers/AbstractManager.java 2009-03-23 19:25:19 UTC (rev 399)
+++ idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/session/managers/AbstractManager.java 2009-03-23 19:50:51 UTC (rev 400)
@@ -27,13 +27,13 @@
import org.jboss.identity.idm.api.Group;
import org.jboss.identity.idm.api.IdentityType;
import org.jboss.identity.idm.api.Attribute;
-import org.jboss.identity.idm.api.IdentitySearchConstraints;
+import org.jboss.identity.idm.api.IdentitySearchCriteria;
import org.jboss.identity.idm.spi.repository.IdentityStoreRepository;
import org.jboss.identity.idm.spi.store.IdentityStoreInvocationContext;
import org.jboss.identity.idm.spi.model.IdentityObject;
import org.jboss.identity.idm.spi.model.IdentityObjectType;
import org.jboss.identity.idm.spi.model.IdentityObjectAttribute;
-import org.jboss.identity.idm.spi.search.IdentityObjectSearchConstraints;
+import org.jboss.identity.idm.spi.search.IdentityObjectSearchCriteria;
import org.jboss.identity.idm.impl.types.SimpleIdentityObject;
import org.jboss.identity.idm.impl.api.session.context.IdentitySessionContext;
import org.jboss.identity.idm.impl.api.session.IdentitySessionImpl;
@@ -41,12 +41,8 @@
import org.jboss.identity.idm.impl.api.model.SimpleGroup;
import org.jboss.identity.idm.impl.api.model.GroupId;
import org.jboss.identity.idm.impl.api.SimpleAttribute;
-import org.jboss.identity.idm.impl.api.IdentitySearchConstraintsImpl;
-import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.identity.idm.impl.api.IdentitySearchCriteriaImpl;
-import java.util.List;
-import java.util.LinkedList;
-
/**
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
* @version : 0.1 $
@@ -65,9 +61,9 @@
return identitySession;
}
- public IdentitySearchConstraints createIdentitySearchConstraints()
+ public IdentitySearchCriteria createIdentitySearchConstraints()
{
- return new IdentitySearchConstraintsImpl();
+ return new IdentitySearchCriteriaImpl();
}
protected IdentitySessionContext getSessionContext()
@@ -183,16 +179,16 @@
return new SimpleGroup(new GroupId(id));
}
- protected IdentityObjectSearchConstraints convertSearchControls(IdentitySearchConstraints controls)
+ protected IdentityObjectSearchCriteria convertSearchControls(IdentitySearchCriteria controls)
{
if (controls == null)
{
return null;
}
- if (controls instanceof IdentityObjectSearchConstraints)
+ if (controls instanceof IdentityObjectSearchCriteria)
{
- return (IdentityObjectSearchConstraints)controls;
+ return (IdentityObjectSearchCriteria)controls;
}
else
{
Modified: idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/session/managers/PersistenceManagerImpl.java
===================================================================
--- idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/session/managers/PersistenceManagerImpl.java 2009-03-23 19:25:19 UTC (rev 399)
+++ idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/session/managers/PersistenceManagerImpl.java 2009-03-23 19:50:51 UTC (rev 400)
@@ -27,12 +27,12 @@
import org.jboss.identity.idm.api.Group;
import org.jboss.identity.idm.api.IdentitySession;
import org.jboss.identity.idm.api.PersistenceManagerFeaturesDescription;
-import org.jboss.identity.idm.api.IdentitySearchConstraints;
-import org.jboss.identity.idm.api.IdentitySearchConstraintType;
+import org.jboss.identity.idm.api.IdentitySearchCriteria;
+import org.jboss.identity.idm.api.IdentitySearchCriteriumType;
import org.jboss.identity.idm.exception.IdentityException;
import org.jboss.identity.idm.spi.model.IdentityObjectType;
import org.jboss.identity.idm.spi.model.IdentityObject;
-import org.jboss.identity.idm.spi.store.IdentityObjectSearchConstraintType;
+import org.jboss.identity.idm.spi.store.IdentityObjectSearchCriteriaType;
import org.jboss.identity.idm.impl.api.session.managers.AbstractManager;
import org.jboss.identity.idm.impl.api.model.GroupId;
@@ -73,33 +73,33 @@
isIdentityObjectAddRemoveSupported(objectType);
}
- public boolean isUsersSearchConstraintTypeSupported(IdentitySearchConstraintType constraintType)
+ public boolean isUsersSearchCriteriumTypeSupported(IdentitySearchCriteriumType constraintType)
{
IdentityObjectType objectType = getSessionContext().getIdentityObjectTypeMapper().getIdentityObjectType();
- IdentityObjectSearchConstraintType constraint = IdentityObjectSearchConstraintType.valueOf(constraintType.name());
+ IdentityObjectSearchCriteriaType constraint = IdentityObjectSearchCriteriaType.valueOf(constraintType.name());
if (constraint != null)
{
return getSessionContext().getIdentityStoreRepository().getSupportedFeatures().
- isSearchConstraintTypeSupported(objectType, constraint);
+ isSearchCriteriaTypeSupported(objectType, constraint);
}
return false;
}
- public boolean isGroupsSearchConstraintTypeSupported(String groupType, IdentitySearchConstraintType constraintType)
+ public boolean isGroupsSearchCriteriumTypeSupported(String groupType, IdentitySearchCriteriumType constraintType)
{
IdentityObjectType objectType = getSessionContext().getIdentityObjectTypeMapper().getIdentityObjectType(groupType);
- IdentityObjectSearchConstraintType constraint = IdentityObjectSearchConstraintType.valueOf(constraintType.name());
+ IdentityObjectSearchCriteriaType constraint = IdentityObjectSearchCriteriaType.valueOf(constraintType.name());
if (constraint != null)
{
return getSessionContext().getIdentityStoreRepository().getSupportedFeatures().
- isSearchConstraintTypeSupported(objectType, constraint);
+ isSearchCriteriaTypeSupported(objectType, constraint);
}
return false;
@@ -202,7 +202,7 @@
return createUser(getRepository().findIdentityObject(getInvocationContext(), name, getUserObjectType()));
}
- public Collection<User> findUser(IdentitySearchConstraints controls) throws IdentityException
+ public Collection<User> findUser(IdentitySearchCriteria controls) throws IdentityException
{
@@ -232,7 +232,7 @@
return createGroup(getRepository().findIdentityObject(getInvocationContext(), id));
}
- public Collection<Group> findGroup(String groupType, IdentitySearchConstraints controls) throws IdentityException
+ public Collection<Group> findGroup(String groupType, IdentitySearchCriteria controls) throws IdentityException
{
checkNotNullArgument(groupType, "Group type");
@@ -252,7 +252,7 @@
{
checkNotNullArgument(groupType, "Group type");
- return findGroup(groupType, (IdentitySearchConstraints) null);
+ return findGroup(groupType, (IdentitySearchCriteria) null);
}
// public boolean isVirtual(User identity)
Modified: idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/session/managers/RelationshipManagerImpl.java
===================================================================
--- idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/session/managers/RelationshipManagerImpl.java 2009-03-23 19:25:19 UTC (rev 399)
+++ idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/session/managers/RelationshipManagerImpl.java 2009-03-23 19:50:51 UTC (rev 400)
@@ -28,14 +28,14 @@
import org.jboss.identity.idm.api.User;
import org.jboss.identity.idm.api.IdentityType;
import org.jboss.identity.idm.api.RelationshipManagerFeaturesDescription;
-import org.jboss.identity.idm.api.IdentitySearchConstraints;
-import org.jboss.identity.idm.api.IdentitySearchConstraintType;
+import org.jboss.identity.idm.api.IdentitySearchCriteria;
+import org.jboss.identity.idm.api.IdentitySearchCriteriumType;
import org.jboss.identity.idm.exception.IdentityException;
import org.jboss.identity.idm.spi.model.IdentityObjectRelationshipType;
import org.jboss.identity.idm.spi.model.IdentityObjectRelationship;
import org.jboss.identity.idm.spi.model.IdentityObject;
import org.jboss.identity.idm.spi.model.IdentityObjectType;
-import org.jboss.identity.idm.spi.store.IdentityObjectSearchConstraintType;
+import org.jboss.identity.idm.spi.store.IdentityObjectSearchCriteriaType;
import org.jboss.identity.idm.impl.NotYetImplementedException;
import org.jboss.identity.idm.impl.api.session.managers.AbstractManager;
@@ -103,32 +103,32 @@
}
}
- public boolean isIdentitiesSearchConstraintTypeSupported(IdentitySearchConstraintType constraintType)
+ public boolean isIdentitiesSearchCriteriumTypeSupported(IdentitySearchCriteriumType constraintType)
{
IdentityObjectType objectType = getSessionContext().getIdentityObjectTypeMapper().getIdentityObjectType();
- IdentityObjectSearchConstraintType constraint = IdentityObjectSearchConstraintType.valueOf(constraintType.name());
+ IdentityObjectSearchCriteriaType constraint = IdentityObjectSearchCriteriaType.valueOf(constraintType.name());
if (constraint != null)
{
return getSessionContext().getIdentityStoreRepository().getSupportedFeatures().
- isSearchConstraintTypeSupported(objectType, constraint);
+ isSearchCriteriaTypeSupported(objectType, constraint);
}
return false;
}
- public boolean isGroupsSearchConstraintTypeSupported(String groupType, IdentitySearchConstraintType constraintType)
+ public boolean isGroupsSearchCriteriumTypeSupported(String groupType, IdentitySearchCriteriumType constraintType)
{
IdentityObjectType objectType = getSessionContext().getIdentityObjectTypeMapper().getIdentityObjectType(groupType);
- IdentityObjectSearchConstraintType constraint = IdentityObjectSearchConstraintType.valueOf(constraintType.name());
+ IdentityObjectSearchCriteriaType constraint = IdentityObjectSearchCriteriaType.valueOf(constraintType.name());
if (constraint != null)
{
return getSessionContext().getIdentityStoreRepository().getSupportedFeatures().
- isSearchConstraintTypeSupported(objectType, constraint);
+ isSearchCriteriaTypeSupported(objectType, constraint);
}
return false;
@@ -467,7 +467,7 @@
return true;
}
- public Collection<Group> findAssociatedGroups(Group group, String groupType, boolean parent, boolean inherited, IdentitySearchConstraints controls) throws IdentityException
+ public Collection<Group> findAssociatedGroups(Group group, String groupType, boolean parent, boolean inherited, IdentitySearchCriteria controls) throws IdentityException
{
checkNotNullArgument(group, "Group");
@@ -497,7 +497,7 @@
}
- public Collection<Group> findAssociatedGroups(String groupId, String groupType, boolean parent, boolean inherited, IdentitySearchConstraints controls) throws IdentityException
+ public Collection<Group> findAssociatedGroups(String groupId, String groupType, boolean parent, boolean inherited, IdentitySearchCriteria controls) throws IdentityException
{
checkNotNullArgument(groupId, "Group Id");
// checkNotNullArgument(groupType, "Group type");
@@ -515,7 +515,7 @@
return findAssociatedGroups(group, groupType, parent, inherited, null);
}
- public Collection<Group> findAssociatedGroups(User identity, String groupType, IdentitySearchConstraints controls) throws IdentityException
+ public Collection<Group> findAssociatedGroups(User identity, String groupType, IdentitySearchCriteria controls) throws IdentityException
{
checkNotNullArgument(identity, "User");
//checkNotNullArgument(groupType, "Group type");
@@ -537,7 +537,7 @@
return identities;
}
- public Collection<Group> findAssociatedGroups(String userName, String groupType, IdentitySearchConstraints controls) throws IdentityException
+ public Collection<Group> findAssociatedGroups(String userName, String groupType, IdentitySearchCriteria controls) throws IdentityException
{
checkNotNullArgument(userName, "User name");
//checkNotNullArgument(groupType, "Group type");
@@ -555,7 +555,7 @@
return findAssociatedGroups(identity, groupType, null);
}
- public Collection<Group> findAssociatedGroups(User identity, IdentitySearchConstraints controls) throws IdentityException
+ public Collection<Group> findAssociatedGroups(User identity, IdentitySearchCriteria controls) throws IdentityException
{
checkNotNullArgument(identity, "User");
@@ -577,7 +577,7 @@
return identities;
}
- public Collection<Group> findAssociatedGroups(String userName, IdentitySearchConstraints controls) throws IdentityException
+ public Collection<Group> findAssociatedGroups(String userName, IdentitySearchCriteria controls) throws IdentityException
{
checkNotNullArgument(userName, "User name");
@@ -590,10 +590,10 @@
{
checkNotNullArgument(identity, "User");
- return findAssociatedGroups(identity, (IdentitySearchConstraints)null);
+ return findAssociatedGroups(identity, (IdentitySearchCriteria)null);
}
- public Collection<User> findAssociatedUsers(Group group, boolean inherited, IdentitySearchConstraints controls) throws IdentityException
+ public Collection<User> findAssociatedUsers(Group group, boolean inherited, IdentitySearchCriteria controls) throws IdentityException
{
checkNotNullArgument(group, "Group");
@@ -621,7 +621,7 @@
return identities;
}
- public Collection<User> findAssociatedUsers(String groupId, boolean inherited, IdentitySearchConstraints controls) throws IdentityException
+ public Collection<User> findAssociatedUsers(String groupId, boolean inherited, IdentitySearchCriteria controls) throws IdentityException
{
checkNotNullArgument(groupId, "Group Id");
@@ -637,7 +637,7 @@
return findAssociatedUsers(group, inherited, null);
}
- public Collection<Group> findRelatedGroups(User user, String groupType, IdentitySearchConstraints controls) throws IdentityException
+ public Collection<Group> findRelatedGroups(User user, String groupType, IdentitySearchCriteria controls) throws IdentityException
{
checkNotNullArgument(user, "User");
@@ -658,7 +658,7 @@
return identities;
}
- public Collection<Group> findRelatedGroups(String userName, String groupType, IdentitySearchConstraints controls) throws IdentityException
+ public Collection<Group> findRelatedGroups(String userName, String groupType, IdentitySearchCriteria controls) throws IdentityException
{
checkNotNullArgument(userName, "User name");
@@ -667,7 +667,7 @@
return findRelatedGroups(user, groupType, controls);
}
- public Collection<User> findRelatedUsers(Group group, IdentitySearchConstraints controls) throws IdentityException
+ public Collection<User> findRelatedUsers(Group group, IdentitySearchCriteria controls) throws IdentityException
{
checkNotNullArgument(group, "Group");
@@ -693,7 +693,7 @@
return identities;
}
- public Collection<User> findRelatedUsers(String groupId, IdentitySearchConstraints controls) throws IdentityException
+ public Collection<User> findRelatedUsers(String groupId, IdentitySearchCriteria controls) throws IdentityException
{
checkNotNullArgument(groupId, "Group Id");
Modified: idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/session/managers/RoleManagerImpl.java
===================================================================
--- idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/session/managers/RoleManagerImpl.java 2009-03-23 19:25:19 UTC (rev 399)
+++ idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/session/managers/RoleManagerImpl.java 2009-03-23 19:50:51 UTC (rev 400)
@@ -30,15 +30,15 @@
import org.jboss.identity.idm.api.Group;
import org.jboss.identity.idm.api.IdentityType;
import org.jboss.identity.idm.api.RoleManagerFeaturesDescription;
-import org.jboss.identity.idm.api.IdentitySearchConstraints;
-import org.jboss.identity.idm.api.IdentitySearchConstraintType;
+import org.jboss.identity.idm.api.IdentitySearchCriteria;
+import org.jboss.identity.idm.api.IdentitySearchCriteriumType;
import org.jboss.identity.idm.exception.IdentityException;
import org.jboss.identity.idm.spi.model.IdentityObjectRelationshipType;
import org.jboss.identity.idm.spi.model.IdentityObjectRelationship;
import org.jboss.identity.idm.spi.model.IdentityObjectType;
import org.jboss.identity.idm.spi.model.IdentityObject;
import org.jboss.identity.idm.spi.exception.OperationNotSupportedException;
-import org.jboss.identity.idm.spi.store.IdentityObjectSearchConstraintType;
+import org.jboss.identity.idm.spi.store.IdentityObjectSearchCriteriaType;
import org.jboss.identity.idm.impl.api.model.SimpleRoleType;
import org.jboss.identity.idm.impl.api.model.SimpleRole;
@@ -75,14 +75,14 @@
return getSessionContext().getIdentityStoreRepository().getSupportedFeatures().isRelationshipNameAddRemoveSupported();
}
- public boolean isRoleTypeSearchConstraintTypeSupported(IdentitySearchConstraintType constraintType)
+ public boolean isRoleTypeSearchCriteriumTypeSupported(IdentitySearchCriteriumType constraintType)
{
- IdentityObjectSearchConstraintType constraint = IdentityObjectSearchConstraintType.valueOf(constraintType.name());
+ IdentityObjectSearchCriteriaType constraint = IdentityObjectSearchCriteriaType.valueOf(constraintType.name());
if (constraint != null)
{
return getSessionContext().getIdentityStoreRepository().getSupportedFeatures().
- isRoleNameSearchConstraintSupported(constraint);
+ isRoleNameSearchCriteriaTypeSupported(constraint);
}
else
{
@@ -157,7 +157,7 @@
return null;
}
- public Collection<RoleType> findRoleTypes(IdentitySearchConstraints controls) throws IdentityException
+ public Collection<RoleType> findRoleTypes(IdentitySearchCriteria controls) throws IdentityException
{
@@ -277,7 +277,7 @@
return findRoleTypes(identity, group, null);
}
- public Collection<RoleType> findRoleTypes(User identity, Group group, IdentitySearchConstraints controls) throws IdentityException
+ public Collection<RoleType> findRoleTypes(User identity, Group group, IdentitySearchCriteria controls) throws IdentityException
{
checkNotNullArgument(identity, "User");
checkNotNullArgument(group, "Group");
@@ -295,7 +295,7 @@
}
- public Collection<RoleType> findRoleTypes(String userName, String groupId, IdentitySearchConstraints controls) throws IdentityException
+ public Collection<RoleType> findRoleTypes(String userName, String groupId, IdentitySearchCriteria controls) throws IdentityException
{
checkNotNullArgument(userName, "User name");
checkNotNullArgument(groupId, "Group Id");
@@ -313,7 +313,7 @@
return findUserRoleTypes(identity, null);
}
- public Collection<RoleType> findUserRoleTypes(User identity, IdentitySearchConstraints controls) throws IdentityException
+ public Collection<RoleType> findUserRoleTypes(User identity, IdentitySearchCriteria controls) throws IdentityException
{
checkNotNullArgument(identity, "User");
@@ -338,7 +338,7 @@
}
- public Collection<RoleType> findUserRoleTypes(String userName, IdentitySearchConstraints controls) throws IdentityException
+ public Collection<RoleType> findUserRoleTypes(String userName, IdentitySearchCriteria controls) throws IdentityException
{
checkNotNullArgument(userName, "User name");
@@ -354,7 +354,7 @@
return findGroupRoleTypes(group, null);
}
- public Collection<RoleType> findGroupRoleTypes(String groupId, IdentitySearchConstraints controls) throws IdentityException
+ public Collection<RoleType> findGroupRoleTypes(String groupId, IdentitySearchCriteria controls) throws IdentityException
{
checkNotNullArgument(groupId, "Group Id");
@@ -363,7 +363,7 @@
return findGroupRoleTypes(group, controls);
}
- public Collection<RoleType> findGroupRoleTypes(Group group, IdentitySearchConstraints controls) throws IdentityException
+ public Collection<RoleType> findGroupRoleTypes(Group group, IdentitySearchCriteria controls) throws IdentityException
{
checkNotNullArgument(group, "Group");
@@ -388,7 +388,7 @@
}
- public Collection<Group> findGroupsWithRelatedRole(User identity, IdentitySearchConstraints controls) throws IdentityException
+ public Collection<Group> findGroupsWithRelatedRole(User identity, IdentitySearchCriteria controls) throws IdentityException
{
checkNotNullArgument(identity, "User");
@@ -408,7 +408,7 @@
return identities;
}
- public Collection<Group> findGroupsWithRelatedRole(String userName, IdentitySearchConstraints controls) throws IdentityException
+ public Collection<Group> findGroupsWithRelatedRole(String userName, IdentitySearchCriteria controls) throws IdentityException
{
checkNotNullArgument(userName, "User name");
@@ -417,7 +417,7 @@
return findGroupsWithRelatedRole(user, controls);
}
- public Collection<Group> findGroupsWithRelatedRole(User identity, String groupType, IdentitySearchConstraints controls) throws IdentityException
+ public Collection<Group> findGroupsWithRelatedRole(User identity, String groupType, IdentitySearchCriteria controls) throws IdentityException
{
checkNotNullArgument(identity, "User");
checkNotNullArgument(groupType, "Group type");
@@ -441,7 +441,7 @@
return identities;
}
- public Collection<Group> findGroupsWithRelatedRole(String userName, String groupType, IdentitySearchConstraints controls) throws IdentityException
+ public Collection<Group> findGroupsWithRelatedRole(String userName, String groupType, IdentitySearchCriteria controls) throws IdentityException
{
checkNotNullArgument(userName, "User name");
checkNotNullArgument(groupType, "Group type");
Modified: idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/cache/IdentityStoreCacheSupport.java
===================================================================
--- idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/cache/IdentityStoreCacheSupport.java 2009-03-23 19:25:19 UTC (rev 399)
+++ idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/cache/IdentityStoreCacheSupport.java 2009-03-23 19:50:51 UTC (rev 400)
@@ -30,7 +30,7 @@
import org.jboss.identity.idm.spi.model.IdentityObjectType;
import org.jboss.identity.idm.spi.model.IdentityObjectRelationshipType;
import org.jboss.identity.idm.spi.model.IdentityObjectRelationship;
-import org.jboss.identity.idm.spi.search.IdentityObjectSearchConstraints;
+import org.jboss.identity.idm.spi.search.IdentityObjectSearchCriteria;
import java.util.logging.Logger;
import java.util.logging.Level;
@@ -456,7 +456,7 @@
}
protected void putIdentityObjectSearchIntoCache(IdentityObjectType identityType,
- IdentityObjectSearchConstraints controls,
+ IdentityObjectSearchCriteria controls,
Collection<IdentityObject> results)
{
Fqn nodeFqn = createIOTypeSearchNodeFQN(identityType, getControlsHash(controls));
@@ -472,7 +472,7 @@
}
protected Collection<IdentityObject> getIdentityObjectSearchFromCache(IdentityObjectType identityType,
- IdentityObjectSearchConstraints controls)
+ IdentityObjectSearchCriteria controls)
{
Fqn nodeFqn = createIOTypeSearchNodeFQN(identityType, getControlsHash(controls));
@@ -499,7 +499,7 @@
protected void putIdentityObjectSearchToCache(IdentityObject identity,
IdentityObjectRelationshipType relationshipType,
boolean parent,
- IdentityObjectSearchConstraints controls,
+ IdentityObjectSearchCriteria controls,
Collection<IdentityObject> results)
{
@@ -521,7 +521,7 @@
protected Collection<IdentityObject> getIdentityObjectSearchFromCache(IdentityObject identity,
IdentityObjectRelationshipType relationshipType,
boolean parent,
- IdentityObjectSearchConstraints controls)
+ IdentityObjectSearchCriteria controls)
{
Fqn nodeFqn = createIOSearchNodeFQN(identity, relationshipType, parent, getControlsHash(controls));
@@ -811,7 +811,7 @@
- protected void putRelationshipNamesSearchIntoCache(IdentityObjectSearchConstraints controls, Set<String> results)
+ protected void putRelationshipNamesSearchIntoCache(IdentityObjectSearchCriteria controls, Set<String> results)
{
Fqn fqn = createRelationshipNamesAllSearchFqn(getControlsHash(controls));
@@ -828,7 +828,7 @@
}
- protected Set<String> getRelationshipNamesSearchFromCache(IdentityObjectSearchConstraints controls)
+ protected Set<String> getRelationshipNamesSearchFromCache(IdentityObjectSearchCriteria controls)
{
Fqn fqn = createRelationshipNamesAllSearchFqn(getControlsHash(controls));
@@ -853,7 +853,7 @@
}
protected void putRelationshipNamesSearchIntoCache(IdentityObject identity,
- IdentityObjectSearchConstraints controls,
+ IdentityObjectSearchCriteria controls,
Set<String> results)
{
@@ -872,7 +872,7 @@
}
- protected Set<String> getRelationshipNamesSearchFromCache(IdentityObject identity, IdentityObjectSearchConstraints controls)
+ protected Set<String> getRelationshipNamesSearchFromCache(IdentityObject identity, IdentityObjectSearchCriteria controls)
{
@@ -896,7 +896,7 @@
return null;
}
- private int getControlsHash(IdentityObjectSearchConstraints controls)
+ private int getControlsHash(IdentityObjectSearchCriteria controls)
{
// Convert controls to Set to have the same hashcode regardles order of controls
int hashcode = 0;
Modified: idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/cache/JBossCacheIdentityStoreWrapper.java
===================================================================
--- idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/cache/JBossCacheIdentityStoreWrapper.java 2009-03-23 19:25:19 UTC (rev 399)
+++ idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/cache/JBossCacheIdentityStoreWrapper.java 2009-03-23 19:50:51 UTC (rev 400)
@@ -32,7 +32,7 @@
import org.jboss.identity.idm.spi.model.IdentityObjectCredential;
import org.jboss.identity.idm.spi.exception.OperationNotSupportedException;
import org.jboss.identity.idm.spi.configuration.IdentityStoreConfigurationContext;
-import org.jboss.identity.idm.spi.search.IdentityObjectSearchConstraints;
+import org.jboss.identity.idm.spi.search.IdentityObjectSearchCriteria;
import org.jboss.identity.idm.exception.IdentityException;
import java.util.Map;
@@ -190,7 +190,7 @@
public Collection<IdentityObject> findIdentityObject(IdentityStoreInvocationContext invocationCtx,
IdentityObjectType identityType,
- IdentityObjectSearchConstraints controls) throws IdentityException
+ IdentityObjectSearchCriteria controls) throws IdentityException
{
Collection<IdentityObject> results = getIdentityObjectSearchFromCache(identityType, controls);
@@ -220,7 +220,7 @@
IdentityObject identity,
IdentityObjectRelationshipType relationshipType,
boolean parent,
- IdentityObjectSearchConstraints controls) throws IdentityException
+ IdentityObjectSearchCriteria controls) throws IdentityException
{
Collection<IdentityObject> results = getIdentityObjectSearchFromCache(identity, relationshipType, parent, controls);
@@ -342,7 +342,7 @@
}
public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx,
- IdentityObjectSearchConstraints controls) throws IdentityException, OperationNotSupportedException
+ IdentityObjectSearchCriteria controls) throws IdentityException, OperationNotSupportedException
{
Set<String> results = getRelationshipNamesSearchFromCache(controls);
@@ -359,7 +359,7 @@
public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx,
IdentityObject identity,
- IdentityObjectSearchConstraints controls) throws IdentityException, OperationNotSupportedException
+ IdentityObjectSearchCriteria controls) throws IdentityException, OperationNotSupportedException
{
Modified: idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/repository/FallbackIdentityStoreRepository.java
===================================================================
--- idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/repository/FallbackIdentityStoreRepository.java 2009-03-23 19:25:19 UTC (rev 399)
+++ idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/repository/FallbackIdentityStoreRepository.java 2009-03-23 19:50:51 UTC (rev 400)
@@ -27,7 +27,7 @@
import org.jboss.identity.idm.spi.store.FeaturesMetaData;
import org.jboss.identity.idm.spi.store.IdentityStoreInvocationContext;
import org.jboss.identity.idm.spi.store.IdentityStoreSession;
-import org.jboss.identity.idm.spi.store.IdentityObjectSearchConstraintType;
+import org.jboss.identity.idm.spi.store.IdentityObjectSearchCriteriaType;
import org.jboss.identity.idm.spi.model.IdentityObject;
import org.jboss.identity.idm.spi.model.IdentityObjectType;
import org.jboss.identity.idm.spi.model.IdentityObjectRelationshipType;
@@ -40,7 +40,7 @@
import org.jboss.identity.idm.spi.model.IdentityObjectCredential;
import org.jboss.identity.idm.spi.model.IdentityObjectCredentialType;
import org.jboss.identity.idm.spi.model.IdentityObjectAttribute;
-import org.jboss.identity.idm.spi.search.IdentityObjectSearchConstraints;
+import org.jboss.identity.idm.spi.search.IdentityObjectSearchCriteria;
import org.jboss.identity.idm.exception.IdentityException;
import org.jboss.identity.idm.impl.store.SimpleIdentityStoreInvocationContext;
import org.jboss.identity.idm.impl.api.session.managers.RoleManagerImpl;
@@ -147,9 +147,9 @@
return defaultIdentityStore.getSupportedFeatures().isNamedRelationshipsSupported();
}
- public boolean isSearchConstraintTypeSupported(IdentityObjectType identityObjectType, IdentityObjectSearchConstraintType storeSearchConstraint)
+ public boolean isSearchCriteriaTypeSupported(IdentityObjectType identityObjectType, IdentityObjectSearchCriteriaType storeSearchConstraint)
{
- return resolveIdentityStore(identityObjectType).getSupportedFeatures().isSearchConstraintTypeSupported(identityObjectType, storeSearchConstraint);
+ return resolveIdentityStore(identityObjectType).getSupportedFeatures().isSearchCriteriaTypeSupported(identityObjectType, storeSearchConstraint);
}
public Set<String> getSupportedIdentityObjectTypes()
@@ -224,22 +224,22 @@
}
- public boolean isRoleNameSearchConstraintSupported(IdentityObjectSearchConstraintType constraint)
+ public boolean isRoleNameSearchCriteriaTypeSupported(IdentityObjectSearchCriteriaType constraint)
{
// If there is any IdentityStore that supports named relationships...
for (IdentityStore identityStore : getIdentityStoreMappings().values())
{
if (identityStore.getSupportedFeatures().isNamedRelationshipsSupported() &&
- identityStore.getSupportedFeatures().isRoleNameSearchConstraintSupported(constraint))
+ identityStore.getSupportedFeatures().isRoleNameSearchCriteriaTypeSupported(constraint))
{
return true;
}
}
return defaultIdentityStore.getSupportedFeatures().isNamedRelationshipsSupported() &&
- defaultIdentityStore.getSupportedFeatures().isRoleNameSearchConstraintSupported(constraint);
+ defaultIdentityStore.getSupportedFeatures().isRoleNameSearchCriteriaTypeSupported(constraint);
}
- };
+ };
}
@@ -390,7 +390,7 @@
return defaultIdentityStore.findIdentityObject(invocationContext, id);
}
- public Collection<IdentityObject> findIdentityObject(IdentityStoreInvocationContext invocationCtx, IdentityObjectType identityType, IdentityObjectSearchConstraints controls) throws IdentityException
+ public Collection<IdentityObject> findIdentityObject(IdentityStoreInvocationContext invocationCtx, IdentityObjectType identityType, IdentityObjectSearchCriteria controls) throws IdentityException
{
IdentityStore targetStore = resolveIdentityStore(identityType);
IdentityStoreInvocationContext targetCtx = resolveInvocationContext(targetStore, invocationCtx);
@@ -402,7 +402,7 @@
IdentityObject identity,
IdentityObjectRelationshipType relationshipType,
boolean parent,
- IdentityObjectSearchConstraints constraints) throws IdentityException
+ IdentityObjectSearchCriteria constraints) throws IdentityException
{
// Check in the mapped store and merge with default
@@ -650,7 +650,7 @@
return name;
}
- public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx, IdentityObjectSearchConstraints controls) throws IdentityException, OperationNotSupportedException
+ public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx, IdentityObjectSearchCriteria controls) throws IdentityException, OperationNotSupportedException
{
Set<String> results = new HashSet<String>();
@@ -668,7 +668,7 @@
return results;
}
- public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx, IdentityObject identity, IdentityObjectSearchConstraints controls) throws IdentityException, OperationNotSupportedException
+ public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx, IdentityObject identity, IdentityObjectSearchCriteria controls) throws IdentityException, OperationNotSupportedException
{
IdentityStore toStore = resolveIdentityStore(identity);
@@ -999,7 +999,7 @@
}
//TODO: other way
- private List<IdentityObject> cutPageFromResults(List<IdentityObject> objects, IdentityObjectSearchConstraints constraints)
+ private List<IdentityObject> cutPageFromResults(List<IdentityObject> objects, IdentityObjectSearchCriteria constraints)
{
List<IdentityObject> results = new LinkedList<IdentityObject>();
for (int i = constraints.getFirstResult(); i < constraints.getFirstResult() + constraints.getMaxResults(); i++)
Modified: idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/repository/WrapperIdentityStoreRepository.java
===================================================================
--- idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/repository/WrapperIdentityStoreRepository.java 2009-03-23 19:25:19 UTC (rev 399)
+++ idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/repository/WrapperIdentityStoreRepository.java 2009-03-23 19:50:51 UTC (rev 400)
@@ -37,7 +37,7 @@
import org.jboss.identity.idm.spi.model.IdentityObjectCredential;
import org.jboss.identity.idm.spi.model.IdentityObjectAttribute;
import org.jboss.identity.idm.spi.exception.OperationNotSupportedException;
-import org.jboss.identity.idm.spi.search.IdentityObjectSearchConstraints;
+import org.jboss.identity.idm.spi.search.IdentityObjectSearchCriteria;
import org.jboss.identity.idm.exception.IdentityException;
import org.jboss.identity.idm.impl.store.SimpleIdentityStoreInvocationContext;
@@ -163,7 +163,7 @@
public Collection<IdentityObject> findIdentityObject(IdentityStoreInvocationContext invocationCtx,
IdentityObjectType identityType,
- IdentityObjectSearchConstraints controls) throws IdentityException
+ IdentityObjectSearchCriteria controls) throws IdentityException
{
return defaultIdentityStore.findIdentityObject(resolveIdentityStoreInvocationContext(invocationCtx), identityType, controls);
}
@@ -172,7 +172,7 @@
IdentityObject identity,
IdentityObjectRelationshipType relationshipType,
boolean parent,
- IdentityObjectSearchConstraints controls) throws IdentityException
+ IdentityObjectSearchCriteria controls) throws IdentityException
{
return defaultIdentityStore.findIdentityObject(resolveIdentityStoreInvocationContext(invocationCtx), identity, relationshipType, parent, controls);
}
@@ -237,14 +237,14 @@
}
public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx,
- IdentityObjectSearchConstraints controls) throws IdentityException, OperationNotSupportedException
+ IdentityObjectSearchCriteria controls) throws IdentityException, OperationNotSupportedException
{
return defaultIdentityStore.getRelationshipNames(resolveIdentityStoreInvocationContext(ctx), controls);
}
public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx,
IdentityObject identity,
- IdentityObjectSearchConstraints controls) throws IdentityException, OperationNotSupportedException
+ IdentityObjectSearchCriteria controls) throws IdentityException, OperationNotSupportedException
{
return defaultIdentityStore.getRelationshipNames(resolveIdentityStoreInvocationContext(ctx), identity, controls);
}
Modified: idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/store/FeaturesMetaDataImpl.java
===================================================================
--- idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/store/FeaturesMetaDataImpl.java 2009-03-23 19:25:19 UTC (rev 399)
+++ idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/store/FeaturesMetaDataImpl.java 2009-03-23 19:50:51 UTC (rev 400)
@@ -36,7 +36,7 @@
import org.jboss.identity.idm.spi.model.IdentityObjectRelationshipType;
import org.jboss.identity.idm.spi.model.IdentityObjectType;
import org.jboss.identity.idm.spi.store.FeaturesMetaData;
-import org.jboss.identity.idm.spi.store.IdentityObjectSearchConstraintType;
+import org.jboss.identity.idm.spi.store.IdentityObjectSearchCriteriaType;
/**
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
@@ -46,7 +46,7 @@
{
private Set<String> supportedTypeNames = new HashSet<String>();
- private final Set<IdentityObjectSearchConstraintType> supportedSearchConstraintTypes;
+ private final Set<IdentityObjectSearchCriteriaType> supportedSearchConstraintTypes;
private final Map<String, Set<String>> supportedCredentials;
@@ -59,7 +59,7 @@
public FeaturesMetaDataImpl(IdentityStoreConfigurationMetaData configurationMD,
- Set<IdentityObjectSearchConstraintType> supportedControls,
+ Set<IdentityObjectSearchCriteriaType> supportedControls,
boolean namedRelationshipsSupport,
Set<String> readOnlyObjectTypes)
{
@@ -162,7 +162,7 @@
return namedRelationshipsSupport;
}
- public boolean isSearchConstraintTypeSupported(IdentityObjectType identityObjectType, IdentityObjectSearchConstraintType storeSearchConstraint)
+ public boolean isSearchCriteriaTypeSupported(IdentityObjectType identityObjectType, IdentityObjectSearchCriteriaType storeSearchConstraint)
{
if (supportedSearchConstraintTypes.contains(storeSearchConstraint))
{
@@ -213,10 +213,10 @@
return false;
}
- public boolean isRoleNameSearchConstraintSupported(IdentityObjectSearchConstraintType constraint)
+ public boolean isRoleNameSearchCriteriaTypeSupported(IdentityObjectSearchCriteriaType constraint)
{
// For now simple - use the same allowed controls list for everything
- return isNamedRelationshipsSupported() && isSearchConstraintTypeSupported(null, constraint);
+ return isNamedRelationshipsSupported() && isSearchCriteriaTypeSupported(null, constraint);
}
}
Modified: idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/store/hibernate/HibernateIdentityStoreImpl.java
===================================================================
--- idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/store/hibernate/HibernateIdentityStoreImpl.java 2009-03-23 19:25:19 UTC (rev 399)
+++ idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/store/hibernate/HibernateIdentityStoreImpl.java 2009-03-23 19:50:51 UTC (rev 400)
@@ -69,8 +69,8 @@
import org.jboss.identity.idm.spi.store.IdentityStore;
import org.jboss.identity.idm.spi.store.IdentityStoreInvocationContext;
import org.jboss.identity.idm.spi.store.IdentityStoreSession;
-import org.jboss.identity.idm.spi.store.IdentityObjectSearchConstraintType;
-import org.jboss.identity.idm.spi.search.IdentityObjectSearchConstraints;
+import org.jboss.identity.idm.spi.store.IdentityObjectSearchCriteriaType;
+import org.jboss.identity.idm.spi.search.IdentityObjectSearchCriteria;
//import javax.persistence.Persistence;
import javax.naming.InitialContext;
@@ -138,8 +138,8 @@
// TODO: rewrite this into some more handy object
private IdentityStoreConfigurationMetaData configurationMD;
- private static Set<IdentityObjectSearchConstraintType> supportedIdentityObjectSearchControls =
- new HashSet<IdentityObjectSearchConstraintType>();
+ private static Set<IdentityObjectSearchCriteriaType> supportedIdentityObjectSearchControls =
+ new HashSet<IdentityObjectSearchCriteriaType>();
private static Set<String> supportedCredentialTypes = new HashSet<String>();
@@ -155,10 +155,10 @@
static {
// List all supported controls classes
- supportedIdentityObjectSearchControls.add(IdentityObjectSearchConstraintType.ATTRIBUTE_FILTER);
- supportedIdentityObjectSearchControls.add(IdentityObjectSearchConstraintType.NAME_FILTER);
- supportedIdentityObjectSearchControls.add(IdentityObjectSearchConstraintType.PAGE);
- supportedIdentityObjectSearchControls.add(IdentityObjectSearchConstraintType.SORT);
+ supportedIdentityObjectSearchControls.add(IdentityObjectSearchCriteriaType.ATTRIBUTE_FILTER);
+ supportedIdentityObjectSearchControls.add(IdentityObjectSearchCriteriaType.NAME_FILTER);
+ supportedIdentityObjectSearchControls.add(IdentityObjectSearchCriteriaType.PAGE);
+ supportedIdentityObjectSearchControls.add(IdentityObjectSearchCriteriaType.SORT);
// credential types supported by this impl
supportedCredentialTypes.add(CREDENTIAL_TYPE_PASSWORD);
@@ -600,7 +600,7 @@
@SuppressWarnings("unchecked")
public Collection<IdentityObject> findIdentityObject(IdentityStoreInvocationContext ctx,
IdentityObjectType identityType,
- IdentityObjectSearchConstraints constraints) throws IdentityException
+ IdentityObjectSearchCriteria constraints) throws IdentityException
{
checkIOType(identityType);
@@ -684,7 +684,7 @@
IdentityObject identity,
IdentityObjectRelationshipType relationshipType,
boolean parent,
- IdentityObjectSearchConstraints constraints) throws IdentityException
+ IdentityObjectSearchCriteria constraints) throws IdentityException
{
//TODO:test
@@ -1110,7 +1110,7 @@
return name;
}
- public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx, IdentityObjectSearchConstraints constraints) throws IdentityException, OperationNotSupportedException
+ public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx, IdentityObjectSearchCriteria constraints) throws IdentityException, OperationNotSupportedException
{
Set<String> names = null;
@@ -1173,10 +1173,10 @@
public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx) throws IdentityException, OperationNotSupportedException
{
- return getRelationshipNames(ctx, (IdentityObjectSearchConstraints)null);
+ return getRelationshipNames(ctx, (IdentityObjectSearchCriteria)null);
}
- public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx, IdentityObject identity, IdentityObjectSearchConstraints constraints) throws IdentityException, OperationNotSupportedException
+ public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx, IdentityObject identity, IdentityObjectSearchCriteria constraints) throws IdentityException, OperationNotSupportedException
{
Set<String> names;
Modified: idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/store/ldap/LDAPIdentityStoreImpl.java
===================================================================
--- idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/store/ldap/LDAPIdentityStoreImpl.java 2009-03-23 19:25:19 UTC (rev 399)
+++ idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/store/ldap/LDAPIdentityStoreImpl.java 2009-03-23 19:50:51 UTC (rev 400)
@@ -78,8 +78,8 @@
import org.jboss.identity.idm.spi.store.IdentityStore;
import org.jboss.identity.idm.spi.store.IdentityStoreInvocationContext;
import org.jboss.identity.idm.spi.store.IdentityStoreSession;
-import org.jboss.identity.idm.spi.store.IdentityObjectSearchConstraintType;
-import org.jboss.identity.idm.spi.search.IdentityObjectSearchConstraints;
+import org.jboss.identity.idm.spi.store.IdentityObjectSearchCriteriaType;
+import org.jboss.identity.idm.spi.search.IdentityObjectSearchCriteria;
/**
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
@@ -102,8 +102,8 @@
IdentityStoreConfigurationMetaData configurationMD;
- private static Set<IdentityObjectSearchConstraintType> supportedSearchConstraintTypes =
- new HashSet<IdentityObjectSearchConstraintType>();
+ private static Set<IdentityObjectSearchCriteriaType> supportedSearchConstraintTypes =
+ new HashSet<IdentityObjectSearchCriteriaType>();
// <IdentityObjectType name, <Attribute name, MD>
private Map<String, Map<String, IdentityObjectAttributeMetaData>> attributesMetaData = new HashMap<String, Map<String, IdentityObjectAttributeMetaData>>();
@@ -112,9 +112,9 @@
// List all supported controls classes
//TODO: attribute filter
- supportedSearchConstraintTypes.add(IdentityObjectSearchConstraintType.SORT);
- supportedSearchConstraintTypes.add(IdentityObjectSearchConstraintType.PAGE);
- supportedSearchConstraintTypes.add(IdentityObjectSearchConstraintType.NAME_FILTER);
+ supportedSearchConstraintTypes.add(IdentityObjectSearchCriteriaType.SORT);
+ supportedSearchConstraintTypes.add(IdentityObjectSearchCriteriaType.PAGE);
+ supportedSearchConstraintTypes.add(IdentityObjectSearchCriteriaType.NAME_FILTER);
//supportedSearchControls.add(AttributeFilterSearchControl.class);
}
@@ -551,7 +551,7 @@
public Collection<IdentityObject> findIdentityObject(IdentityStoreInvocationContext invocationCtx,
IdentityObjectType type,
- IdentityObjectSearchConstraints constraints) throws IdentityException
+ IdentityObjectSearchCriteria constraints) throws IdentityException
{
//TODO: page control with LDAP request control
@@ -708,7 +708,7 @@
IdentityObject identity,
IdentityObjectRelationshipType relationshipType,
boolean parent,
- IdentityObjectSearchConstraints constraints) throws IdentityException
+ IdentityObjectSearchCriteria constraints) throws IdentityException
{
//TODO: relationshipType is ignored - maybe check and allow only MEMBERSHIP?
@@ -1324,7 +1324,7 @@
throw new OperationNotSupportedException("Named relationships are not supported by this implementation of LDAP IdentityStore");
}
- public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx, IdentityObjectSearchConstraints controls) throws IdentityException, OperationNotSupportedException
+ public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx, IdentityObjectSearchCriteria controls) throws IdentityException, OperationNotSupportedException
{
throw new OperationNotSupportedException("Named relationships are not supported by this implementation of LDAP IdentityStore");
}
@@ -1334,7 +1334,7 @@
throw new OperationNotSupportedException("Named relationships are not supported by this implementation of LDAP IdentityStore");
}
- public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx, IdentityObject identity, IdentityObjectSearchConstraints controls) throws IdentityException, OperationNotSupportedException
+ public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx, IdentityObject identity, IdentityObjectSearchCriteria controls) throws IdentityException, OperationNotSupportedException
{
throw new OperationNotSupportedException("Named relationships are not supported by this implementation of LDAP IdentityStore");
@@ -2058,7 +2058,7 @@
}
//TODO: dummy and inefficient temporary workaround. Need to be implemented with ldap request control
- private List<IdentityObject> cutPageFromResults(List<IdentityObject> objects, IdentityObjectSearchConstraints constraints)
+ private List<IdentityObject> cutPageFromResults(List<IdentityObject> objects, IdentityObjectSearchCriteria constraints)
{
List<IdentityObject> results = new LinkedList<IdentityObject>();
for (int i = constraints.getFirstResult(); i < constraints.getFirstResult() + constraints.getMaxResults(); i++)
Modified: idm/trunk/idm/src/test/java/org/jboss/identity/idm/impl/api/PersistenceManagerTest.java
===================================================================
--- idm/trunk/idm/src/test/java/org/jboss/identity/idm/impl/api/PersistenceManagerTest.java 2009-03-23 19:25:19 UTC (rev 399)
+++ idm/trunk/idm/src/test/java/org/jboss/identity/idm/impl/api/PersistenceManagerTest.java 2009-03-23 19:50:51 UTC (rev 400)
@@ -26,7 +26,7 @@
import org.jboss.identity.idm.api.Group;
import org.jboss.identity.idm.api.User;
import org.jboss.identity.idm.api.IdentitySessionFactory;
-import org.jboss.identity.idm.api.IdentitySearchConstraints;
+import org.jboss.identity.idm.api.IdentitySearchCriteria;
import junit.framework.Assert;
@@ -131,7 +131,7 @@
id = session.getPersistenceManager().createGroupId("groupName3", PROJECT);
session.getPersistenceManager().removeGroup(id, false);
- assertEquals(0, session.getPersistenceManager().findGroup(ORGANIZATION, (IdentitySearchConstraints)null).size());
+ assertEquals(0, session.getPersistenceManager().findGroup(ORGANIZATION, (IdentitySearchCriteria)null).size());
assertEquals(0, session.getPersistenceManager().findGroup(PROJECT).size());
assertEquals(0, session.getPersistenceManager().findGroup(DEPARTMENT).size());
@@ -157,7 +157,7 @@
//TODO: this should throw some meaningfull exception or simply return null
//assertNull(session.getPersistenceManager().findUser("olaf"));
- assertEquals(2, session.getPersistenceManager().findUser((IdentitySearchConstraints)null).size());
+ assertEquals(2, session.getPersistenceManager().findUser((IdentitySearchCriteria)null).size());
session.getPersistenceManager().removeUser(u1, false);
@@ -167,7 +167,7 @@
assertEquals(0, session.getPersistenceManager().getUserCount());
- assertEquals(0, session.getPersistenceManager().findUser((IdentitySearchConstraints)null).size());
+ assertEquals(0, session.getPersistenceManager().findUser((IdentitySearchCriteria)null).size());
session.getTransaction().commit();
Modified: idm/trunk/idm/src/test/java/org/jboss/identity/idm/impl/api/RelationshipManagerTest.java
===================================================================
--- idm/trunk/idm/src/test/java/org/jboss/identity/idm/impl/api/RelationshipManagerTest.java 2009-03-23 19:25:19 UTC (rev 399)
+++ idm/trunk/idm/src/test/java/org/jboss/identity/idm/impl/api/RelationshipManagerTest.java 2009-03-23 19:50:51 UTC (rev 400)
@@ -26,7 +26,7 @@
import org.jboss.identity.idm.api.Group;
import org.jboss.identity.idm.api.User;
import org.jboss.identity.idm.api.IdentitySessionFactory;
-import org.jboss.identity.idm.api.IdentitySearchConstraints;
+import org.jboss.identity.idm.api.IdentitySearchCriteria;
import java.util.Arrays;
@@ -358,10 +358,10 @@
assertEquals(0, session.getRelationshipManager().findAssociatedUsers(group2, false, null).size());
assertEquals(1, session.getRelationshipManager().findRelatedUsers(group2, null).size());
- assertEquals(0, session.getRelationshipManager().findAssociatedGroups(user3, (IdentitySearchConstraints)null).size());
+ assertEquals(0, session.getRelationshipManager().findAssociatedGroups(user3, (IdentitySearchCriteria)null).size());
assertEquals(2, session.getRelationshipManager().findRelatedGroups(user3, null, null).size());
- assertEquals(1, session.getRelationshipManager().findAssociatedGroups(user2, (IdentitySearchConstraints)null).size());
+ assertEquals(1, session.getRelationshipManager().findAssociatedGroups(user2, (IdentitySearchCriteria)null).size());
assertEquals(2, session.getRelationshipManager().findRelatedGroups(user2, null, null).size());
session.getTransaction().commit();
Modified: idm/trunk/idm/src/test/java/org/jboss/identity/idm/impl/store/CommonIdentityStoreTest.java
===================================================================
--- idm/trunk/idm/src/test/java/org/jboss/identity/idm/impl/store/CommonIdentityStoreTest.java 2009-03-23 19:25:19 UTC (rev 399)
+++ idm/trunk/idm/src/test/java/org/jboss/identity/idm/impl/store/CommonIdentityStoreTest.java 2009-03-23 19:50:51 UTC (rev 400)
@@ -25,12 +25,12 @@
import org.jboss.identity.idm.spi.model.IdentityObject;
import org.jboss.identity.idm.spi.model.IdentityObjectCredential;
import org.jboss.identity.idm.spi.model.IdentityObjectAttribute;
-import org.jboss.identity.idm.spi.search.IdentityObjectSearchConstraints;
-import org.jboss.identity.idm.spi.store.IdentityObjectSearchConstraintType;
+import org.jboss.identity.idm.spi.search.IdentityObjectSearchCriteria;
+import org.jboss.identity.idm.spi.store.IdentityObjectSearchCriteriaType;
import org.jboss.identity.idm.impl.api.PasswordCredential;
import org.jboss.identity.idm.impl.api.BinaryCredential;
import org.jboss.identity.idm.impl.api.SimpleAttribute;
-import org.jboss.identity.idm.impl.api.IdentitySearchConstraintsImpl;
+import org.jboss.identity.idm.impl.api.IdentitySearchCriteriaImpl;
import org.jboss.identity.idm.api.SortOrder;
import java.util.Collection;
@@ -370,50 +370,50 @@
IdentityObject group8 = testContext.getStore().createIdentityObject(testContext.getCtx(), "Entity3", IdentityTypeEnum.USER);
Collection<IdentityObject> results = null;
- IdentityObjectSearchConstraints constraints = null;
+ IdentityObjectSearchCriteria constraints = null;
// TODO: by RelationshipType
if (testContext.getStore().getSupportedFeatures().
- isSearchConstraintTypeSupported(IdentityTypeEnum.USER, IdentityObjectSearchConstraintType.NAME_FILTER))
+ isSearchCriteriaTypeSupported(IdentityTypeEnum.USER, IdentityObjectSearchCriteriaType.NAME_FILTER))
{
- constraints = (IdentityObjectSearchConstraints)new IdentitySearchConstraintsImpl().idFilter("*");
+ constraints = (IdentityObjectSearchCriteria)new IdentitySearchCriteriaImpl().idFilter("*");
results = testContext.getStore().
findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, constraints);
assertEquals(8, results.size());
- constraints = (IdentityObjectSearchConstraints)new IdentitySearchConstraintsImpl().idFilter("D*");
+ constraints = (IdentityObjectSearchCriteria)new IdentitySearchCriteriaImpl().idFilter("D*");
results = testContext.getStore().
findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, constraints);
assertEquals(3, results.size());
- constraints = (IdentityObjectSearchConstraints)new IdentitySearchConstraintsImpl().idFilter("*2");
+ constraints = (IdentityObjectSearchCriteria)new IdentitySearchCriteriaImpl().idFilter("*2");
results = testContext.getStore().
findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, constraints);
assertEquals(3, results.size());
- constraints = (IdentityObjectSearchConstraints)new IdentitySearchConstraintsImpl().idFilter("*3");
+ constraints = (IdentityObjectSearchCriteria)new IdentitySearchCriteriaImpl().idFilter("*3");
results = testContext.getStore().
findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, constraints);
assertEquals(2, results.size());
- constraints = (IdentityObjectSearchConstraints)new IdentitySearchConstraintsImpl().idFilter("Company1");
+ constraints = (IdentityObjectSearchCriteria)new IdentitySearchCriteriaImpl().idFilter("Company1");
results = testContext.getStore().
findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, constraints);
assertEquals(1, results.size());
- constraints = (IdentityObjectSearchConstraints)new IdentitySearchConstraintsImpl().idFilter("Toronto");
+ constraints = (IdentityObjectSearchCriteria)new IdentitySearchCriteriaImpl().idFilter("Toronto");
results = testContext.getStore().
findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, constraints);
@@ -423,17 +423,17 @@
if (testContext.getStore().getSupportedFeatures().
- isSearchConstraintTypeSupported(IdentityTypeEnum.USER, IdentityObjectSearchConstraintType.PAGE))
+ isSearchCriteriaTypeSupported(IdentityTypeEnum.USER, IdentityObjectSearchCriteriaType.PAGE))
{
- constraints = (IdentityObjectSearchConstraints)new IdentitySearchConstraintsImpl().page(0, 3);
+ constraints = (IdentityObjectSearchCriteria)new IdentitySearchCriteriaImpl().page(0, 3);
results = testContext.getStore().
findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, constraints);
assertEquals(3, results.size());
- constraints = (IdentityObjectSearchConstraints)new IdentitySearchConstraintsImpl().page(2, 2);
+ constraints = (IdentityObjectSearchCriteria)new IdentitySearchCriteriaImpl().page(2, 2);
results = testContext.getStore().
@@ -443,11 +443,11 @@
}
if (testContext.getStore().getSupportedFeatures().
- isSearchConstraintTypeSupported(IdentityTypeEnum.USER, IdentityObjectSearchConstraintType.SORT))
+ isSearchCriteriaTypeSupported(IdentityTypeEnum.USER, IdentityObjectSearchCriteriaType.SORT))
{
- constraints = (IdentityObjectSearchConstraints)new IdentitySearchConstraintsImpl().sort(SortOrder.ASCENDING);
+ constraints = (IdentityObjectSearchCriteria)new IdentitySearchCriteriaImpl().sort(SortOrder.ASCENDING);
results = testContext.getStore().
@@ -461,7 +461,7 @@
// And reverse order
- constraints = (IdentityObjectSearchConstraints)new IdentitySearchConstraintsImpl().sort(SortOrder.DESCENDING);
+ constraints = (IdentityObjectSearchCriteria)new IdentitySearchCriteriaImpl().sort(SortOrder.DESCENDING);
results = testContext.getStore().
@@ -479,10 +479,10 @@
// Combine controls to check that the results are diffrent for pagination
if (testContext.getStore().getSupportedFeatures().
- isSearchConstraintTypeSupported(IdentityTypeEnum.USER, IdentityObjectSearchConstraintType.PAGE))
+ isSearchCriteriaTypeSupported(IdentityTypeEnum.USER, IdentityObjectSearchCriteriaType.PAGE))
{
- constraints = (IdentityObjectSearchConstraints)new IdentitySearchConstraintsImpl().sort(SortOrder.ASCENDING).page(0,3);
+ constraints = (IdentityObjectSearchCriteria)new IdentitySearchCriteriaImpl().sort(SortOrder.ASCENDING).page(0,3);
@@ -493,7 +493,7 @@
assertEquals("Company1", ((List<IdentityObject>)results).get(0).getName());
assertEquals("Division1", ((List<IdentityObject>)results).get(2).getName());
- constraints = (IdentityObjectSearchConstraints)new IdentitySearchConstraintsImpl().sort(SortOrder.ASCENDING).page(3,1);
+ constraints = (IdentityObjectSearchCriteria)new IdentitySearchCriteriaImpl().sort(SortOrder.ASCENDING).page(3,1);
results = testContext.getStore().
findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, constraints);
@@ -508,7 +508,7 @@
}
if (testContext.getStore().getSupportedFeatures().
- isSearchConstraintTypeSupported(IdentityTypeEnum.USER, IdentityObjectSearchConstraintType.ATTRIBUTE_FILTER))
+ isSearchCriteriaTypeSupported(IdentityTypeEnum.USER, IdentityObjectSearchCriteriaType.ATTRIBUTE_FILTER))
{
IdentityObjectAttribute phone = new SimpleAttribute("phone", new String[] {"777 777 777"});
@@ -516,7 +516,7 @@
testContext.getStore().addAttributes(testContext.getCtx(), group1, new IdentityObjectAttribute[]{phone, description});
- constraints = (IdentityObjectSearchConstraints)new IdentitySearchConstraintsImpl()
+ constraints = (IdentityObjectSearchCriteria)new IdentitySearchCriteriaImpl()
.attributeValuesFilter("phone", new String[] {"777 777 777"})
.attributeValuesFilter("description", new String[] {"sample desc"});
Deleted: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchConstraintType.java
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchConstraintType.java 2009-03-23 19:25:19 UTC (rev 399)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchConstraintType.java 2009-03-23 19:50:51 UTC (rev 400)
@@ -1,38 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-
-
-package org.jboss.identity.idm.api;
-
-
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
- * @version : 0.1 $
- */
-public enum IdentitySearchConstraintType
-{
- SORT,
- PAGE,
- NAME_FILTER,
- ATTRIBUTE_FILTER
-}
Deleted: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchConstraints.java
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchConstraints.java 2009-03-23 19:25:19 UTC (rev 399)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchConstraints.java 2009-03-23 19:50:51 UTC (rev 400)
@@ -1,43 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-
-package org.jboss.identity.idm.api;
-
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
- * @version : 0.1 $
- */
-public interface IdentitySearchConstraints
-{
-
- IdentitySearchConstraints sort(SortOrder order) throws UnsupportedConstraint;
-
- IdentitySearchConstraints sortAttributeName(String name) throws UnsupportedConstraint;
-
- IdentitySearchConstraints page(int firstResult, int maxResults) throws UnsupportedConstraint;
-
- IdentitySearchConstraints attributeValuesFilter(String attributeName, String[] attributeValue) throws UnsupportedConstraint;
-
- IdentitySearchConstraints idFilter(String filter) throws UnsupportedConstraint;
-
-}
Copied: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchCriteria.java (from rev 398, idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchConstraints.java)
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchCriteria.java (rev 0)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchCriteria.java 2009-03-23 19:50:51 UTC (rev 400)
@@ -0,0 +1,43 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.api;
+
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface IdentitySearchCriteria
+{
+
+ IdentitySearchCriteria sort(SortOrder order) throws UnsupportedCriterium;
+
+ IdentitySearchCriteria sortAttributeName(String name) throws UnsupportedCriterium;
+
+ IdentitySearchCriteria page(int firstResult, int maxResults) throws UnsupportedCriterium;
+
+ IdentitySearchCriteria attributeValuesFilter(String attributeName, String[] attributeValue) throws UnsupportedCriterium;
+
+ IdentitySearchCriteria idFilter(String filter) throws UnsupportedCriterium;
+
+}
Copied: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchCriteriumType.java (from rev 398, idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchConstraintType.java)
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchCriteriumType.java (rev 0)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchCriteriumType.java 2009-03-23 19:50:51 UTC (rev 400)
@@ -0,0 +1,38 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+
+package org.jboss.identity.idm.api;
+
+
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public enum IdentitySearchCriteriumType
+{
+ SORT,
+ PAGE,
+ NAME_FILTER,
+ ATTRIBUTE_FILTER
+}
Modified: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/PersistenceManager.java
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/PersistenceManager.java 2009-03-23 19:25:19 UTC (rev 399)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/PersistenceManager.java 2009-03-23 19:50:51 UTC (rev 400)
@@ -46,7 +46,7 @@
*/
PersistenceManagerFeaturesDescription getFeaturesDescription();
- IdentitySearchConstraints createIdentitySearchConstraints();
+ IdentitySearchCriteria createIdentitySearchConstraints();
// Create
@@ -153,7 +153,7 @@
* @return
* @throws IdentityException
*/
- Collection<User> findUser(IdentitySearchConstraints controls) throws IdentityException;
+ Collection<User> findUser(IdentitySearchCriteria controls) throws IdentityException;
// Search Groups
@@ -184,7 +184,7 @@
* @return
* @throws IdentityException
*/
- Collection<Group> findGroup(String groupType, IdentitySearchConstraints controls) throws IdentityException;
+ Collection<Group> findGroup(String groupType, IdentitySearchCriteria controls) throws IdentityException;
/**
*
Modified: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/PersistenceManagerFeaturesDescription.java
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/PersistenceManagerFeaturesDescription.java 2009-03-23 19:25:19 UTC (rev 399)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/PersistenceManagerFeaturesDescription.java 2009-03-23 19:50:51 UTC (rev 400)
@@ -48,18 +48,18 @@
/**
* Check if control can be used in Identity search methods
*
- * @param constraint
+ * @param criteriumType
* @return
*/
- boolean isUsersSearchConstraintTypeSupported(IdentitySearchConstraintType constraint);
+ boolean isUsersSearchCriteriumTypeSupported(IdentitySearchCriteriumType criteriumType);
/**
* Check if control can be used in Group search methods
*
* @param groupType
- * @param constraint
+ * @param criteriumType
* @return
*/
- boolean isGroupsSearchConstraintTypeSupported(String groupType, IdentitySearchConstraintType constraint);
+ boolean isGroupsSearchCriteriumTypeSupported(String groupType, IdentitySearchCriteriumType criteriumType);
}
\ No newline at end of file
Modified: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RelationshipManager.java
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RelationshipManager.java 2009-03-23 19:25:19 UTC (rev 399)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RelationshipManager.java 2009-03-23 19:50:51 UTC (rev 400)
@@ -45,7 +45,7 @@
*/
RelationshipManagerFeaturesDescription getFeaturesDescription();
- IdentitySearchConstraints createIdentitySearchConstraints();
+ IdentitySearchCriteria createIdentitySearchConstraints();
// Assignation
@@ -308,7 +308,7 @@
String groupType,
boolean parent,
boolean inherited,
- IdentitySearchConstraints controls) throws IdentityException;
+ IdentitySearchCriteria controls) throws IdentityException;
/**
* Find groups that are associated with given group.
@@ -328,7 +328,7 @@
String groupType,
boolean parent,
boolean inherited,
- IdentitySearchConstraints controls) throws IdentityException;
+ IdentitySearchCriteria controls) throws IdentityException;
/**
* Find all groups that given identity is associated with.
@@ -350,7 +350,7 @@
*/
Collection<Group> findAssociatedGroups(User user,
String groupType,
- IdentitySearchConstraints controls) throws IdentityException;
+ IdentitySearchCriteria controls) throws IdentityException;
/**
* Find all groups that given identity is associated with.
@@ -362,7 +362,7 @@
*/
Collection<Group> findAssociatedGroups(String userId,
String groupType,
- IdentitySearchConstraints controls) throws IdentityException;
+ IdentitySearchCriteria controls) throws IdentityException;
/**
* Find all groups that given identity is associated with.
@@ -372,7 +372,7 @@
* @throws org.jboss.identity.idm.exception.IdentityException
*/
Collection<Group> findAssociatedGroups(User user,
- IdentitySearchConstraints controls) throws IdentityException;
+ IdentitySearchCriteria controls) throws IdentityException;
/**
* Find all groups that given identity is associated with.
@@ -382,7 +382,7 @@
* @throws org.jboss.identity.idm.exception.IdentityException
*/
Collection<Group> findAssociatedGroups(String userId,
- IdentitySearchConstraints controls) throws IdentityException;
+ IdentitySearchCriteria controls) throws IdentityException;
/**
* Find all groups that given identity is associated with.
@@ -414,7 +414,7 @@
*/
Collection<User> findAssociatedUsers(Group group,
boolean inherited,
- IdentitySearchConstraints controls) throws IdentityException;
+ IdentitySearchCriteria controls) throws IdentityException;
/**
* Find identities that have relationship with given parent group.
@@ -426,7 +426,7 @@
*/
Collection<User> findAssociatedUsers(String groupId,
boolean inherited,
- IdentitySearchConstraints controls) throws IdentityException;
+ IdentitySearchCriteria controls) throws IdentityException;
/**
@@ -439,7 +439,7 @@
*/
Collection<Group> findRelatedGroups(User user,
String groupType,
- IdentitySearchConstraints controls) throws IdentityException;
+ IdentitySearchCriteria controls) throws IdentityException;
/**
* Find all groups that given identity is associated with. Will return groups connected with a given user with a role
@@ -451,7 +451,7 @@
*/
Collection<Group> findRelatedGroups(String userId,
String groupType,
- IdentitySearchConstraints controls) throws IdentityException;
+ IdentitySearchCriteria controls) throws IdentityException;
/**
* Find identities that have relationship with given parent group. Will return users connected with a given group with a role
@@ -460,7 +460,7 @@
* @return
* @throws org.jboss.identity.idm.exception.IdentityException
*/
- Collection<User> findRelatedUsers(Group group, IdentitySearchConstraints controls) throws IdentityException;
+ Collection<User> findRelatedUsers(Group group, IdentitySearchCriteria controls) throws IdentityException;
/**
* Find identities that have relationship with given parent group. Will return users connected with a given group with a role
@@ -469,7 +469,7 @@
* @return
* @throws org.jboss.identity.idm.exception.IdentityException
*/
- Collection<User> findRelatedUsers(String groupId, IdentitySearchConstraints controls) throws IdentityException;
+ Collection<User> findRelatedUsers(String groupId, IdentitySearchCriteria controls) throws IdentityException;
}
Modified: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RelationshipManagerFeaturesDescription.java
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RelationshipManagerFeaturesDescription.java 2009-03-23 19:25:19 UTC (rev 399)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RelationshipManagerFeaturesDescription.java 2009-03-23 19:50:51 UTC (rev 400)
@@ -49,18 +49,18 @@
/**
* Check if control can be used in Identity search methods
*
- * @param constraint
+ * @param criteriumType
* @return
*/
- boolean isIdentitiesSearchConstraintTypeSupported(IdentitySearchConstraintType constraint);
+ boolean isIdentitiesSearchCriteriumTypeSupported(IdentitySearchCriteriumType criteriumType);
/**
* Check if control can be used in Group search methods
*
* @param groupType
- * @param constraintType
+ * @param criteriumType
* @return
*/
- boolean isGroupsSearchConstraintTypeSupported(String groupType, IdentitySearchConstraintType constraintType);
+ boolean isGroupsSearchCriteriumTypeSupported(String groupType, IdentitySearchCriteriumType criteriumType);
}
\ No newline at end of file
Modified: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RoleManager.java
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RoleManager.java 2009-03-23 19:25:19 UTC (rev 399)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RoleManager.java 2009-03-23 19:50:51 UTC (rev 400)
@@ -46,7 +46,7 @@
*/
RoleManagerFeaturesDescription getSupportedFeatures();
- IdentitySearchConstraints createIdentitySearchConstraints();
+ IdentitySearchCriteria createIdentitySearchConstraints();
// RoleType
@@ -85,7 +85,7 @@
* @return
* @throws IdentityException
*/
- Collection<RoleType> findRoleTypes(IdentitySearchConstraints controls) throws IdentityException;
+ Collection<RoleType> findRoleTypes(IdentitySearchCriteria controls) throws IdentityException;
// Role
@@ -162,7 +162,7 @@
* @throws IdentityException
*/
Collection<RoleType> findRoleTypes(User user, Group group,
- IdentitySearchConstraints controls) throws IdentityException;
+ IdentitySearchCriteria controls) throws IdentityException;
/**
* Find RoleType objects for roles associated with a given User and Group
@@ -172,7 +172,7 @@
* @throws IdentityException
*/
Collection<RoleType> findRoleTypes(String userId, String groupId,
- IdentitySearchConstraints controls) throws IdentityException;
+ IdentitySearchCriteria controls) throws IdentityException;
/**
* Find RoleType objects for roles associated with a given User and Group
@@ -197,7 +197,7 @@
* @return
* @throws IdentityException
*/
- Collection<RoleType> findUserRoleTypes(User user, IdentitySearchConstraints controls) throws IdentityException;
+ Collection<RoleType> findUserRoleTypes(User user, IdentitySearchCriteria controls) throws IdentityException;
/**
* Find RoleType objects for roles associated with a given Identity
@@ -205,7 +205,7 @@
* @return
* @throws IdentityException
*/
- Collection<RoleType> findUserRoleTypes(String userId, IdentitySearchConstraints controls) throws IdentityException;
+ Collection<RoleType> findUserRoleTypes(String userId, IdentitySearchCriteria controls) throws IdentityException;
/**
* Find RoleType objects for roles associated with a given Group
@@ -222,7 +222,7 @@
* @throws IdentityException
*/
Collection<RoleType> findGroupRoleTypes(Group group,
- IdentitySearchConstraints controls) throws IdentityException;
+ IdentitySearchCriteria controls) throws IdentityException;
/**
* Find RoleType objects for roles associated with a given Group
@@ -231,7 +231,7 @@
* @throws IdentityException
*/
Collection<RoleType> findGroupRoleTypes(String groupId,
- IdentitySearchConstraints controls) throws IdentityException;
+ IdentitySearchCriteria controls) throws IdentityException;
/**
* Find all Groups with which User has a Role association
@@ -242,7 +242,7 @@
* @throws IdentityException
*/
Collection<Group> findGroupsWithRelatedRole(User user,
- IdentitySearchConstraints controls) throws IdentityException;
+ IdentitySearchCriteria controls) throws IdentityException;
/**
* Find all Groups with which User has a Role association
@@ -253,7 +253,7 @@
* @throws IdentityException
*/
Collection<Group> findGroupsWithRelatedRole(String userId,
- IdentitySearchConstraints controls) throws IdentityException;
+ IdentitySearchCriteria controls) throws IdentityException;
/**
@@ -266,7 +266,7 @@
*/
Collection<Group> findGroupsWithRelatedRole(User user,
String groupType,
- IdentitySearchConstraints controls) throws IdentityException;
+ IdentitySearchCriteria controls) throws IdentityException;
/**
* Find all Groups with which User has a Role association
@@ -278,7 +278,7 @@
*/
Collection<Group> findGroupsWithRelatedRole(String userId,
String groupType,
- IdentitySearchConstraints controls) throws IdentityException;
+ IdentitySearchCriteria controls) throws IdentityException;
/**
* Find Role objects with a given RoleType associated with a given IdentityType
Modified: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RoleManagerFeaturesDescription.java
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RoleManagerFeaturesDescription.java 2009-03-23 19:25:19 UTC (rev 399)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RoleManagerFeaturesDescription.java 2009-03-23 19:50:51 UTC (rev 400)
@@ -37,8 +37,8 @@
boolean isRoleTypeAddRemoveSupported();
/**
- * @param constraintType
+ * @param criteriumType
* @return
*/
- boolean isRoleTypeSearchConstraintTypeSupported(IdentitySearchConstraintType constraintType);
+ boolean isRoleTypeSearchCriteriumTypeSupported(IdentitySearchCriteriumType criteriumType);
}
\ No newline at end of file
Deleted: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/UnsupportedConstraint.java
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/UnsupportedConstraint.java 2009-03-23 19:25:19 UTC (rev 399)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/UnsupportedConstraint.java 2009-03-23 19:50:51 UTC (rev 400)
@@ -1,50 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-
-package org.jboss.identity.idm.api;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
- * @version : 0.1 $
- */
-public class UnsupportedConstraint extends Exception
-{
- public UnsupportedConstraint()
- {
- super();
- }
-
- public UnsupportedConstraint(String message)
- {
- super(message);
- }
-
- public UnsupportedConstraint(String message, Throwable cause)
- {
- super(message, cause);
- }
-
- public UnsupportedConstraint(Throwable cause)
- {
- super(cause);
- }
-}
Copied: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/UnsupportedCriterium.java (from rev 398, idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/UnsupportedConstraint.java)
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/UnsupportedCriterium.java (rev 0)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/UnsupportedCriterium.java 2009-03-23 19:50:51 UTC (rev 400)
@@ -0,0 +1,50 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.api;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class UnsupportedCriterium extends Exception
+{
+ public UnsupportedCriterium()
+ {
+ super();
+ }
+
+ public UnsupportedCriterium(String message)
+ {
+ super(message);
+ }
+
+ public UnsupportedCriterium(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public UnsupportedCriterium(Throwable cause)
+ {
+ super(cause);
+ }
+}
Modified: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/GroupQuery.java
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/GroupQuery.java 2009-03-23 19:25:19 UTC (rev 399)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/GroupQuery.java 2009-03-23 19:50:51 UTC (rev 400)
@@ -78,13 +78,13 @@
GroupQuery addRelatedUser(String id);
- GroupQuery sort(SortOrder order) throws UnsupportedQueryConstraint;
+ GroupQuery sort(SortOrder order) throws UnsupportedQueryCriterium;
- GroupQuery sortAttributeName(String name) throws UnsupportedQueryConstraint;
+ GroupQuery sortAttributeName(String name) throws UnsupportedQueryCriterium;
- GroupQuery page(int firstResult, int maxResults) throws UnsupportedQueryConstraint;
+ GroupQuery page(int firstResult, int maxResults) throws UnsupportedQueryCriterium;
- GroupQuery attributeValuesFilter(String attributeName, String[] attributeValue) throws UnsupportedQueryConstraint;
+ GroupQuery attributeValuesFilter(String attributeName, String[] attributeValue) throws UnsupportedQueryCriterium;
Deleted: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/UnsupportedQueryConstraint.java
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/UnsupportedQueryConstraint.java 2009-03-23 19:25:19 UTC (rev 399)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/UnsupportedQueryConstraint.java 2009-03-23 19:50:51 UTC (rev 400)
@@ -1,51 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-
-package org.jboss.identity.idm.api.query;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
- * @version : 0.1 $
- */
-public class UnsupportedQueryConstraint extends QueryException
-{
-
- public UnsupportedQueryConstraint()
- {
- super();
- }
-
- public UnsupportedQueryConstraint(String message)
- {
- super(message);
- }
-
- public UnsupportedQueryConstraint(String message, Throwable cause)
- {
- super(message, cause);
- }
-
- public UnsupportedQueryConstraint(Throwable cause)
- {
- super(cause);
- }
-}
Copied: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/UnsupportedQueryCriterium.java (from rev 392, idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/UnsupportedQueryConstraint.java)
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/UnsupportedQueryCriterium.java (rev 0)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/UnsupportedQueryCriterium.java 2009-03-23 19:50:51 UTC (rev 400)
@@ -0,0 +1,51 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.api.query;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class UnsupportedQueryCriterium extends QueryException
+{
+
+ public UnsupportedQueryCriterium()
+ {
+ super();
+ }
+
+ public UnsupportedQueryCriterium(String message)
+ {
+ super(message);
+ }
+
+ public UnsupportedQueryCriterium(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public UnsupportedQueryCriterium(Throwable cause)
+ {
+ super(cause);
+ }
+}
Modified: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/UserQuery.java
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/UserQuery.java 2009-03-23 19:25:19 UTC (rev 399)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/UserQuery.java 2009-03-23 19:50:51 UTC (rev 400)
@@ -67,12 +67,12 @@
UserQuery addRelatedGroupsIds(Collection<String> ids);
- UserQuery sort(SortOrder order) throws UnsupportedQueryConstraint;
+ UserQuery sort(SortOrder order) throws UnsupportedQueryCriterium;
- UserQuery sortAttributeName(String name) throws UnsupportedQueryConstraint;
+ UserQuery sortAttributeName(String name) throws UnsupportedQueryCriterium;
- UserQuery page(int firstResult, int maxResults) throws UnsupportedQueryConstraint;
+ UserQuery page(int firstResult, int maxResults) throws UnsupportedQueryCriterium;
- UserQuery attributeValuesFilter(String attributeName, String[] attributeValue) throws UnsupportedQueryConstraint;
+ UserQuery attributeValuesFilter(String attributeName, String[] attributeValue) throws UnsupportedQueryCriterium;
}
Deleted: idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/search/IdentityObjectSearchConstraints.java
===================================================================
--- idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/search/IdentityObjectSearchConstraints.java 2009-03-23 19:25:19 UTC (rev 399)
+++ idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/search/IdentityObjectSearchConstraints.java 2009-03-23 19:50:51 UTC (rev 400)
@@ -1,50 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-
-package org.jboss.identity.idm.spi.search;
-
-import java.util.Map;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
- * @version : 0.1 $
- */
-public interface IdentityObjectSearchConstraints
-{
- boolean isSorted();
-
- boolean isAscending();
-
- String getSortAttributeName();
-
- boolean isPaged();
-
- int getFirstResult();
-
- int getMaxResults();
-
- boolean isFiltered();
-
- String getFilter();
-
- Map<String, String[]> getValues();
-}
Copied: idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/search/IdentityObjectSearchCriteria.java (from rev 398, idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/search/IdentityObjectSearchConstraints.java)
===================================================================
--- idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/search/IdentityObjectSearchCriteria.java (rev 0)
+++ idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/search/IdentityObjectSearchCriteria.java 2009-03-23 19:50:51 UTC (rev 400)
@@ -0,0 +1,50 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.spi.search;
+
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface IdentityObjectSearchCriteria
+{
+ boolean isSorted();
+
+ boolean isAscending();
+
+ String getSortAttributeName();
+
+ boolean isPaged();
+
+ int getFirstResult();
+
+ int getMaxResults();
+
+ boolean isFiltered();
+
+ String getFilter();
+
+ Map<String, String[]> getValues();
+}
Modified: idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/FeaturesMetaData.java
===================================================================
--- idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/FeaturesMetaData.java 2009-03-23 19:25:19 UTC (rev 399)
+++ idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/FeaturesMetaData.java 2009-03-23 19:50:51 UTC (rev 400)
@@ -59,14 +59,14 @@
* @param storeSearchConstraint
* @return
*/
- boolean isSearchConstraintTypeSupported(IdentityObjectType identityObjectType, IdentityObjectSearchConstraintType storeSearchConstraint);
+ boolean isSearchCriteriaTypeSupported(IdentityObjectType identityObjectType, IdentityObjectSearchCriteriaType storeSearchConstraint);
/**
*
* @param constraint
* @return
*/
- boolean isRoleNameSearchConstraintSupported(IdentityObjectSearchConstraintType constraint);
+ boolean isRoleNameSearchCriteriaTypeSupported(IdentityObjectSearchCriteriaType constraint);
/**
* @return set of identity types that can be persisted
Deleted: idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/IdentityObjectSearchConstraintType.java
===================================================================
--- idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/IdentityObjectSearchConstraintType.java 2009-03-23 19:25:19 UTC (rev 399)
+++ idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/IdentityObjectSearchConstraintType.java 2009-03-23 19:50:51 UTC (rev 400)
@@ -1,36 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-
-
-package org.jboss.identity.idm.spi.store;/**
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
- * @version : 0.1 $
- */
-public enum IdentityObjectSearchConstraintType
-{
- SORT,
- PAGE,
- NAME_FILTER,
- ATTRIBUTE_FILTER
-}
Copied: idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/IdentityObjectSearchCriteriaType.java (from rev 398, idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/IdentityObjectSearchConstraintType.java)
===================================================================
--- idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/IdentityObjectSearchCriteriaType.java (rev 0)
+++ idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/IdentityObjectSearchCriteriaType.java 2009-03-23 19:50:51 UTC (rev 400)
@@ -0,0 +1,36 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+
+package org.jboss.identity.idm.spi.store;/**
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public enum IdentityObjectSearchCriteriaType
+{
+ SORT,
+ PAGE,
+ NAME_FILTER,
+ ATTRIBUTE_FILTER
+}
Modified: idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/IdentityStore.java
===================================================================
--- idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/IdentityStore.java 2009-03-23 19:25:19 UTC (rev 399)
+++ idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/IdentityStore.java 2009-03-23 19:50:51 UTC (rev 400)
@@ -31,10 +31,9 @@
import org.jboss.identity.idm.spi.model.IdentityObjectRelationshipType;
import org.jboss.identity.idm.spi.model.IdentityObjectRelationship;
import org.jboss.identity.idm.spi.exception.OperationNotSupportedException;
-import org.jboss.identity.idm.spi.configuration.metadata.IdentityStoreConfigurationMetaData;
import org.jboss.identity.idm.spi.configuration.IdentityStoreConfigurationContext;
import org.jboss.identity.idm.spi.model.IdentityObjectCredential;
-import org.jboss.identity.idm.spi.search.IdentityObjectSearchConstraints;
+import org.jboss.identity.idm.spi.search.IdentityObjectSearchCriteria;
import org.jboss.identity.idm.exception.IdentityException;
/**
@@ -151,7 +150,7 @@
*/
Collection<IdentityObject> findIdentityObject(IdentityStoreInvocationContext invocationCtx,
IdentityObjectType identityType,
- IdentityObjectSearchConstraints controls) throws IdentityException;
+ IdentityObjectSearchCriteria controls) throws IdentityException;
/**
* Find identites that have relationship with given identity. Relationships are directional (from parent to child).
*
@@ -167,7 +166,7 @@
Collection<IdentityObject> findIdentityObject(IdentityStoreInvocationContext invocationCxt, IdentityObject identity,
IdentityObjectRelationshipType relationshipType,
boolean parent,
- IdentityObjectSearchConstraints controls) throws IdentityException;
+ IdentityObjectSearchCriteria controls) throws IdentityException;
@@ -282,7 +281,7 @@
* @throws OperationNotSupportedException
*/
Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx,
- IdentityObjectSearchConstraints controls) throws IdentityException, OperationNotSupportedException;
+ IdentityObjectSearchCriteria controls) throws IdentityException, OperationNotSupportedException;
/**
@@ -296,7 +295,7 @@
*/
Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx,
IdentityObject identity,
- IdentityObjectSearchConstraints controls) throws IdentityException, OperationNotSupportedException;
+ IdentityObjectSearchCriteria controls) throws IdentityException, OperationNotSupportedException;
// Credentials
15 years, 1 month
JBoss Identity SVN: r399 - idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api.
by jboss-identity-commits@lists.jboss.org
Author: bdaw
Date: 2009-03-23 15:25:19 -0400 (Mon, 23 Mar 2009)
New Revision: 399
Removed:
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchCriteria.java
Log:
cleanup
Deleted: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchCriteria.java
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchCriteria.java 2009-03-23 19:20:55 UTC (rev 398)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchCriteria.java 2009-03-23 19:25:19 UTC (rev 399)
@@ -1,34 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-
-package org.jboss.identity.idm.api;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
- * @version : 0.1 $
- */
-public interface IdentitySearchCriteria
-{
-
-
-
-}
15 years, 1 month
JBoss Identity SVN: r398 - in idm/trunk: idm/src/main/java/org/jboss/identity/idm/impl/api/model and 13 other directories.
by jboss-identity-commits@lists.jboss.org
Author: bdaw
Date: 2009-03-23 15:20:55 -0400 (Mon, 23 Mar 2009)
New Revision: 398
Added:
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchConstraintType.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchConstraints.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchCriteria.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/SortOrder.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/UnsupportedConstraint.java
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/search/
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/search/IdentityObjectSearchConstraints.java
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/IdentityObjectSearchConstraintType.java
idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/IdentitySearchConstraintsImpl.java
Removed:
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchControl.java
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/searchcontrol/
idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/AttributeFilterSearchControl.java
idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/NameFilterSearchControl.java
idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/PageSearchControl.java
idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/SortByNameSearchControl.java
Modified:
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/PersistenceManager.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/PersistenceManagerFeaturesDescription.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RelationshipManager.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RelationshipManagerFeaturesDescription.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RoleManager.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RoleManagerFeaturesDescription.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/GroupQuery.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/Query.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/RoleQuery.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/UserQuery.java
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/FeaturesMetaData.java
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/IdentityStore.java
idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/model/GroupId.java
idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/session/managers/AbstractManager.java
idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/session/managers/PersistenceManagerImpl.java
idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/session/managers/RelationshipManagerImpl.java
idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/session/managers/RoleManagerImpl.java
idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/cache/IdentityStoreCacheSupport.java
idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/cache/JBossCacheIdentityStoreWrapper.java
idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/repository/FallbackIdentityStoreRepository.java
idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/repository/WrapperIdentityStoreRepository.java
idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/store/FeaturesMetaDataImpl.java
idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/store/hibernate/HibernateIdentityStoreImpl.java
idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/store/ldap/LDAPIdentityStoreImpl.java
idm/trunk/idm/src/test/java/org/jboss/identity/idm/impl/api/ModelTestCase.java
idm/trunk/idm/src/test/java/org/jboss/identity/idm/impl/api/PersistenceManagerTest.java
idm/trunk/idm/src/test/java/org/jboss/identity/idm/impl/api/RelationshipManagerTest.java
idm/trunk/idm/src/test/java/org/jboss/identity/idm/impl/store/CommonIdentityStoreTest.java
Log:
Get rid of ugly search controls
Deleted: idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/AttributeFilterSearchControl.java
===================================================================
--- idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/AttributeFilterSearchControl.java 2009-03-23 03:05:44 UTC (rev 397)
+++ idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/AttributeFilterSearchControl.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -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.idm.impl.api;
-
-import org.jboss.identity.idm.api.IdentitySearchControl;
-import org.jboss.identity.idm.spi.searchcontrol.IdentityObjectSearchControl;
-
-import java.util.Map;
-import java.util.Collections;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
- * @version : 0.1 $
- */
-public class AttributeFilterSearchControl implements IdentitySearchControl, IdentityObjectSearchControl
-{
- private final Map<String, String[]> attributes;
-
- public AttributeFilterSearchControl(Map<String, String[]> attributes)
- {
- if (attributes == null)
- {
- throw new IllegalArgumentException("attributes is null");
- }
- this.attributes = Collections.unmodifiableMap(attributes);
- }
-
- public Map<String, String[]> getValues()
- {
- return attributes;
- }
-
- @Override
- public boolean equals(Object o)
- {
- if (this == o)
- {
- return true;
- }
- if (o == null || getClass() != o.getClass())
- {
- return false;
- }
-
- AttributeFilterSearchControl that = (AttributeFilterSearchControl)o;
-
- if (!attributes.equals(that.attributes))
- {
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode()
- {
- return attributes.hashCode();
- }
-}
Added: idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/IdentitySearchConstraintsImpl.java
===================================================================
--- idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/IdentitySearchConstraintsImpl.java (rev 0)
+++ idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/IdentitySearchConstraintsImpl.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -0,0 +1,242 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.impl.api;
+
+import org.jboss.identity.idm.api.IdentitySearchConstraints;
+import org.jboss.identity.idm.api.SortOrder;
+import org.jboss.identity.idm.api.UnsupportedConstraint;
+import org.jboss.identity.idm.spi.search.IdentityObjectSearchConstraints;
+
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class IdentitySearchConstraintsImpl implements IdentitySearchConstraints, IdentityObjectSearchConstraints
+{
+
+ private boolean sorted = false;
+
+ private String sortByName;
+
+ private boolean ascending = true;
+
+ private boolean paged = false;
+
+ private int firstResult;
+
+ private int maxResults;
+
+ private boolean filtered = false;
+
+ private final Map<String, String[]> attributes = new HashMap<String, String[]>();
+
+ private String filter;
+
+ public IdentitySearchConstraintsImpl()
+ {
+
+ }
+
+ public IdentitySearchConstraints sort(SortOrder order) throws UnsupportedConstraint
+ {
+ sorted = true;
+ if (order.equals(SortOrder.ASCENDING))
+ {
+ ascending = true;
+ }
+ else
+ {
+ ascending = false;
+ }
+
+ return this;
+ }
+
+ public IdentitySearchConstraints sortAttributeName(String name) throws UnsupportedConstraint
+ {
+ sorted = true;
+ sortByName = name;
+
+ return this;
+ }
+
+ public IdentitySearchConstraints page(int firstResult, int maxResults) throws UnsupportedConstraint
+ {
+ paged = true;
+
+ this.firstResult = firstResult;
+ this.maxResults = maxResults;
+
+
+ return this;
+ }
+
+ public IdentitySearchConstraints attributeValuesFilter(String attributeName, String[] attributeValue) throws UnsupportedConstraint
+ {
+ if (attributeName == null)
+ {
+ throw new IllegalArgumentException("Attribute name is null");
+ }
+
+ if (attributeValue == null)
+ {
+ throw new IllegalArgumentException("Attribute values are null");
+
+ }
+
+ filtered = true;
+
+ attributes.put(attributeName, attributeValue);
+
+ return this;
+ }
+
+ public IdentitySearchConstraints idFilter(String filter) throws UnsupportedConstraint
+ {
+ if (filter == null)
+ {
+ throw new IllegalArgumentException("ID filter is null");
+ }
+
+ this.filter = filter;
+
+ return this;
+ }
+
+ public String getFilter()
+ {
+ return filter;
+ }
+
+ public boolean isSorted()
+ {
+ return sorted;
+ }
+
+ public boolean isAscending()
+ {
+ return ascending;
+ }
+
+ public String getSortAttributeName()
+ {
+ return sortByName;
+ }
+
+ public boolean isPaged()
+ {
+ return paged;
+ }
+
+ public int getFirstResult()
+ {
+ return firstResult;
+ }
+
+ public int getMaxResults()
+ {
+ return maxResults;
+ }
+
+ public boolean isFiltered()
+ {
+ return filtered;
+ }
+
+ public Map<String, String[]> getValues()
+ {
+ return attributes;
+ }
+
+ @Override
+ public boolean equals(Object o)
+ {
+ if (this == o)
+ {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass())
+ {
+ return false;
+ }
+
+ IdentitySearchConstraintsImpl that = (IdentitySearchConstraintsImpl)o;
+
+ if (ascending != that.ascending)
+ {
+ return false;
+ }
+ if (filtered != that.filtered)
+ {
+ return false;
+ }
+ if (firstResult != that.firstResult)
+ {
+ return false;
+ }
+ if (maxResults != that.maxResults)
+ {
+ return false;
+ }
+ if (paged != that.paged)
+ {
+ return false;
+ }
+ if (sorted != that.sorted)
+ {
+ return false;
+ }
+ if (!attributes.equals(that.attributes))
+ {
+ return false;
+ }
+ if (filter != null ? !filter.equals(that.filter) : that.filter != null)
+ {
+ return false;
+ }
+ if (sortByName != null ? !sortByName.equals(that.sortByName) : that.sortByName != null)
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ int result = (sorted ? 1 : 0);
+ result = 31 * result + (sortByName != null ? sortByName.hashCode() : 0);
+ result = 31 * result + (ascending ? 1 : 0);
+ result = 31 * result + (paged ? 1 : 0);
+ result = 31 * result + firstResult;
+ result = 31 * result + maxResults;
+ result = 31 * result + (filtered ? 1 : 0);
+ result = 31 * result + attributes.hashCode();
+ result = 31 * result + (filter != null ? filter.hashCode() : 0);
+ return result;
+ }
+}
Deleted: idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/NameFilterSearchControl.java
===================================================================
--- idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/NameFilterSearchControl.java 2009-03-23 03:05:44 UTC (rev 397)
+++ idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/NameFilterSearchControl.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -1,74 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-
-package org.jboss.identity.idm.impl.api;
-
-import org.jboss.identity.idm.api.IdentitySearchControl;
-import org.jboss.identity.idm.spi.searchcontrol.IdentityObjectSearchControl;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
- * @version : 0.1 $
- */
-public class NameFilterSearchControl implements IdentitySearchControl, IdentityObjectSearchControl
-{
-
- private final String filter;
-
- public NameFilterSearchControl(String filter)
- {
- this.filter = filter;
- }
-
- public String getFilter()
- {
- return filter;
- }
-
- @Override
- public boolean equals(Object o)
- {
- if (this == o)
- {
- return true;
- }
- if (o == null || getClass() != o.getClass())
- {
- return false;
- }
-
- NameFilterSearchControl that = (NameFilterSearchControl)o;
-
- if (filter != null ? !filter.equals(that.filter) : that.filter != null)
- {
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode()
- {
- return filter != null ? filter.hashCode() : 0;
- }
-}
Deleted: idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/PageSearchControl.java
===================================================================
--- idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/PageSearchControl.java 2009-03-23 03:05:44 UTC (rev 397)
+++ idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/PageSearchControl.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -1,87 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-
-package org.jboss.identity.idm.impl.api;
-
-import org.jboss.identity.idm.api.IdentitySearchControl;
-import org.jboss.identity.idm.spi.searchcontrol.IdentityObjectSearchControl;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
- * @version : 0.1 $
- */
-public class PageSearchControl implements IdentitySearchControl, IdentityObjectSearchControl
-{
- private final int offset;
-
- private final int limit;
-
- public PageSearchControl(int offset, int limit)
- {
- this.offset = offset;
- this.limit = limit;
- }
-
- public int getOffset()
- {
- return offset;
- }
-
- public int getLimit()
- {
- return limit;
- }
-
- @Override
- public boolean equals(Object o)
- {
- if (this == o)
- {
- return true;
- }
- if (o == null || getClass() != o.getClass())
- {
- return false;
- }
-
- PageSearchControl that = (PageSearchControl)o;
-
- if (limit != that.limit)
- {
- return false;
- }
- if (offset != that.offset)
- {
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode()
- {
- int result = offset;
- result = 31 * result + limit;
- return result;
- }
-}
Deleted: idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/SortByNameSearchControl.java
===================================================================
--- idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/SortByNameSearchControl.java 2009-03-23 03:05:44 UTC (rev 397)
+++ idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/SortByNameSearchControl.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -1,73 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-
-package org.jboss.identity.idm.impl.api;
-
-import org.jboss.identity.idm.spi.searchcontrol.IdentityObjectSearchControl;
-import org.jboss.identity.idm.api.IdentitySearchControl;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
- * @version : 0.1 $
- */
-public class SortByNameSearchControl implements IdentitySearchControl, IdentityObjectSearchControl
-{
- private final boolean ascending;
-
- public SortByNameSearchControl(boolean ascending)
- {
- this.ascending = ascending;
- }
-
- public boolean isAscending()
- {
- return ascending;
- }
-
- @Override
- public boolean equals(Object o)
- {
- if (this == o)
- {
- return true;
- }
- if (o == null || getClass() != o.getClass())
- {
- return false;
- }
-
- SortByNameSearchControl that = (SortByNameSearchControl)o;
-
- if (ascending != that.ascending)
- {
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode()
- {
- return (ascending ? 1 : 0);
- }
-}
Modified: idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/model/GroupId.java
===================================================================
--- idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/model/GroupId.java 2009-03-23 03:05:44 UTC (rev 397)
+++ idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/model/GroupId.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -28,8 +28,12 @@
*/
public class GroupId
{
- public static final String PREFIX = "group:/";
+ public static final String PREFIX = "jbpid_group_id";
+ public static final String SEPARATOR = "_._._";
+
+ public static final String SEPARATOR_REGEX = "_\\._\\._";
+
private String name;
private String type;
@@ -56,11 +60,12 @@
throw new IllegalArgumentException("id is null");
}
- String[] parts = id.split("/");
+ String[] parts = id.split(SEPARATOR_REGEX);
if (!validateId(id))
{
- throw new IllegalArgumentException("group id not following required format: group/type/name: " + id);
+ throw new IllegalArgumentException("group id not following required format: " +
+ PREFIX + SEPARATOR + "groupType" + SEPARATOR + "name : " + id);
}
name = parts[2];
@@ -69,9 +74,9 @@
public static boolean validateId(String id)
{
- String[] parts = id.split("/");
+ String[] parts = id.split(SEPARATOR_REGEX);
- if (parts == null || parts.length != 3 || parts[0].equals(PREFIX.substring(0, PREFIX.length())))
+ if (parts == null || parts.length != 3 || parts[0].equals(PREFIX.substring(0, PREFIX.length() - 1)))
{
return false;
}
@@ -91,6 +96,6 @@
public String getId()
{
- return PREFIX + type + "/" + name;
+ return PREFIX + SEPARATOR + type + SEPARATOR + name;
}
}
Modified: idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/session/managers/AbstractManager.java
===================================================================
--- idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/session/managers/AbstractManager.java 2009-03-23 03:05:44 UTC (rev 397)
+++ idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/session/managers/AbstractManager.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -26,14 +26,14 @@
import org.jboss.identity.idm.api.User;
import org.jboss.identity.idm.api.Group;
import org.jboss.identity.idm.api.IdentityType;
-import org.jboss.identity.idm.api.IdentitySearchControl;
import org.jboss.identity.idm.api.Attribute;
+import org.jboss.identity.idm.api.IdentitySearchConstraints;
import org.jboss.identity.idm.spi.repository.IdentityStoreRepository;
import org.jboss.identity.idm.spi.store.IdentityStoreInvocationContext;
-import org.jboss.identity.idm.spi.searchcontrol.IdentityObjectSearchControl;
import org.jboss.identity.idm.spi.model.IdentityObject;
import org.jboss.identity.idm.spi.model.IdentityObjectType;
import org.jboss.identity.idm.spi.model.IdentityObjectAttribute;
+import org.jboss.identity.idm.spi.search.IdentityObjectSearchConstraints;
import org.jboss.identity.idm.impl.types.SimpleIdentityObject;
import org.jboss.identity.idm.impl.api.session.context.IdentitySessionContext;
import org.jboss.identity.idm.impl.api.session.IdentitySessionImpl;
@@ -41,6 +41,8 @@
import org.jboss.identity.idm.impl.api.model.SimpleGroup;
import org.jboss.identity.idm.impl.api.model.GroupId;
import org.jboss.identity.idm.impl.api.SimpleAttribute;
+import org.jboss.identity.idm.impl.api.IdentitySearchConstraintsImpl;
+import org.jboss.identity.idm.exception.IdentityException;
import java.util.List;
import java.util.LinkedList;
@@ -63,6 +65,11 @@
return identitySession;
}
+ public IdentitySearchConstraints createIdentitySearchConstraints()
+ {
+ return new IdentitySearchConstraintsImpl();
+ }
+
protected IdentitySessionContext getSessionContext()
{
if (identitySession instanceof IdentitySessionImpl)
@@ -176,31 +183,21 @@
return new SimpleGroup(new GroupId(id));
}
- protected IdentityObjectSearchControl[] convertSearchControls(IdentitySearchControl[] controls)
+ protected IdentityObjectSearchConstraints convertSearchControls(IdentitySearchConstraints controls)
{
if (controls == null)
{
return null;
}
- //TODO: simple check
- List<IdentityObjectSearchControl> result = new LinkedList<IdentityObjectSearchControl>();
-
- for (IdentitySearchControl control : controls)
+ if (controls instanceof IdentityObjectSearchConstraints)
{
- if (control instanceof IdentityObjectSearchControl)
- {
- result.add((IdentityObjectSearchControl)control);
- }
+ return (IdentityObjectSearchConstraints)controls;
}
-
- if (result.size() == 0)
+ else
{
- return null;
+ throw new IllegalArgumentException("Not supported IdentitySearchConstraints implementation: " + controls.getClass());
}
-
- return result.toArray(new IdentityObjectSearchControl[result.size()]);
-
}
protected IdentityObjectType getUserObjectType()
Modified: idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/session/managers/PersistenceManagerImpl.java
===================================================================
--- idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/session/managers/PersistenceManagerImpl.java 2009-03-23 03:05:44 UTC (rev 397)
+++ idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/session/managers/PersistenceManagerImpl.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -27,12 +27,12 @@
import org.jboss.identity.idm.api.Group;
import org.jboss.identity.idm.api.IdentitySession;
import org.jboss.identity.idm.api.PersistenceManagerFeaturesDescription;
-import org.jboss.identity.idm.api.IdentitySearchControl;
+import org.jboss.identity.idm.api.IdentitySearchConstraints;
+import org.jboss.identity.idm.api.IdentitySearchConstraintType;
import org.jboss.identity.idm.exception.IdentityException;
import org.jboss.identity.idm.spi.model.IdentityObjectType;
import org.jboss.identity.idm.spi.model.IdentityObject;
-import org.jboss.identity.idm.spi.searchcontrol.IdentityObjectSearchControl;
-import org.jboss.identity.idm.impl.NotYetImplementedException;
+import org.jboss.identity.idm.spi.store.IdentityObjectSearchConstraintType;
import org.jboss.identity.idm.impl.api.session.managers.AbstractManager;
import org.jboss.identity.idm.impl.api.model.GroupId;
@@ -73,49 +73,38 @@
isIdentityObjectAddRemoveSupported(objectType);
}
- public boolean isUsersSearchControlSupported(IdentitySearchControl control)
+ public boolean isUsersSearchConstraintTypeSupported(IdentitySearchConstraintType constraintType)
{
IdentityObjectType objectType = getSessionContext().getIdentityObjectTypeMapper().getIdentityObjectType();
- if (control instanceof IdentityObjectSearchControl)
+ IdentityObjectSearchConstraintType constraint = IdentityObjectSearchConstraintType.valueOf(constraintType.name());
+
+
+ if (constraint != null)
{
return getSessionContext().getIdentityStoreRepository().getSupportedFeatures().
- isControlSupported(objectType, (IdentityObjectSearchControl)control);
+ isSearchConstraintTypeSupported(objectType, constraint);
}
return false;
}
- public boolean isUsersSearchControlSupported(Class controlClazz)
+ public boolean isGroupsSearchConstraintTypeSupported(String groupType, IdentitySearchConstraintType constraintType)
{
- IdentityObjectType objectType = getSessionContext().getIdentityObjectTypeMapper().getIdentityObjectType();
-
- return getSessionContext().getIdentityStoreRepository().getSupportedFeatures().
- isControlSupported(objectType, controlClazz);
-
- }
-
- public boolean isGroupsSearchControlSupported(String groupType, IdentitySearchControl control)
- {
IdentityObjectType objectType = getSessionContext().getIdentityObjectTypeMapper().getIdentityObjectType(groupType);
- if (control instanceof IdentityObjectSearchControl)
+ IdentityObjectSearchConstraintType constraint = IdentityObjectSearchConstraintType.valueOf(constraintType.name());
+
+ if (constraint != null)
{
return getSessionContext().getIdentityStoreRepository().getSupportedFeatures().
- isControlSupported(objectType, (IdentityObjectSearchControl)control);
+ isSearchConstraintTypeSupported(objectType, constraint);
}
return false;
}
- public boolean isGroupsSearchControlSupported(String groupType, Class controlClazz)
- {
- IdentityObjectType objectType = getSessionContext().getIdentityObjectTypeMapper().getIdentityObjectType(groupType);
-
- return getSessionContext().getIdentityStoreRepository().getSupportedFeatures().
- isControlSupported(objectType, controlClazz);
- }
};
}
@@ -213,7 +202,7 @@
return createUser(getRepository().findIdentityObject(getInvocationContext(), name, getUserObjectType()));
}
- public Collection<User> findUser(IdentitySearchControl[] controls) throws IdentityException
+ public Collection<User> findUser(IdentitySearchConstraints controls) throws IdentityException
{
@@ -243,7 +232,7 @@
return createGroup(getRepository().findIdentityObject(getInvocationContext(), id));
}
- public Collection<Group> findGroup(String groupType, IdentitySearchControl[] controls) throws IdentityException
+ public Collection<Group> findGroup(String groupType, IdentitySearchConstraints controls) throws IdentityException
{
checkNotNullArgument(groupType, "Group type");
@@ -263,7 +252,7 @@
{
checkNotNullArgument(groupType, "Group type");
- return findGroup(groupType, (IdentitySearchControl[]) null);
+ return findGroup(groupType, (IdentitySearchConstraints) null);
}
// public boolean isVirtual(User identity)
Modified: idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/session/managers/RelationshipManagerImpl.java
===================================================================
--- idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/session/managers/RelationshipManagerImpl.java 2009-03-23 03:05:44 UTC (rev 397)
+++ idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/session/managers/RelationshipManagerImpl.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -28,13 +28,14 @@
import org.jboss.identity.idm.api.User;
import org.jboss.identity.idm.api.IdentityType;
import org.jboss.identity.idm.api.RelationshipManagerFeaturesDescription;
-import org.jboss.identity.idm.api.IdentitySearchControl;
+import org.jboss.identity.idm.api.IdentitySearchConstraints;
+import org.jboss.identity.idm.api.IdentitySearchConstraintType;
import org.jboss.identity.idm.exception.IdentityException;
import org.jboss.identity.idm.spi.model.IdentityObjectRelationshipType;
import org.jboss.identity.idm.spi.model.IdentityObjectRelationship;
import org.jboss.identity.idm.spi.model.IdentityObject;
import org.jboss.identity.idm.spi.model.IdentityObjectType;
-import org.jboss.identity.idm.spi.searchcontrol.IdentityObjectSearchControl;
+import org.jboss.identity.idm.spi.store.IdentityObjectSearchConstraintType;
import org.jboss.identity.idm.impl.NotYetImplementedException;
import org.jboss.identity.idm.impl.api.session.managers.AbstractManager;
@@ -102,49 +103,36 @@
}
}
- public boolean isIdentitiesSearchControlSupported(IdentitySearchControl control)
+ public boolean isIdentitiesSearchConstraintTypeSupported(IdentitySearchConstraintType constraintType)
{
IdentityObjectType objectType = getSessionContext().getIdentityObjectTypeMapper().getIdentityObjectType();
- if (control instanceof IdentityObjectSearchControl)
+ IdentityObjectSearchConstraintType constraint = IdentityObjectSearchConstraintType.valueOf(constraintType.name());
+
+
+ if (constraint != null)
{
return getSessionContext().getIdentityStoreRepository().getSupportedFeatures().
- isControlSupported(objectType, (IdentityObjectSearchControl)control);
+ isSearchConstraintTypeSupported(objectType, constraint);
}
return false;
}
-
- public boolean isIdentitiesSearchControlSupported(Class controlClazz)
+ public boolean isGroupsSearchConstraintTypeSupported(String groupType, IdentitySearchConstraintType constraintType)
{
- IdentityObjectType objectType = getSessionContext().getIdentityObjectTypeMapper().getIdentityObjectType();
-
- return getSessionContext().getIdentityStoreRepository().getSupportedFeatures().
- isControlSupported(objectType, controlClazz);
-
- }
-
- public boolean isGroupsSearchControlSupported(String groupType, IdentitySearchControl control)
- {
IdentityObjectType objectType = getSessionContext().getIdentityObjectTypeMapper().getIdentityObjectType(groupType);
- if (control instanceof IdentityObjectSearchControl)
+ IdentityObjectSearchConstraintType constraint = IdentityObjectSearchConstraintType.valueOf(constraintType.name());
+
+ if (constraint != null)
{
return getSessionContext().getIdentityStoreRepository().getSupportedFeatures().
- isControlSupported(objectType, (IdentityObjectSearchControl)control);
+ isSearchConstraintTypeSupported(objectType, constraint);
}
return false;
}
-
- public boolean isGroupsSearchControlSupported(String groupType, Class controlClazz)
- {
- IdentityObjectType objectType = getSessionContext().getIdentityObjectTypeMapper().getIdentityObjectType(groupType);
-
- return getSessionContext().getIdentityStoreRepository().getSupportedFeatures().
- isControlSupported(objectType, controlClazz);
- }
};
}
@@ -479,7 +467,7 @@
return true;
}
- public Collection<Group> findAssociatedGroups(Group group, String groupType, boolean parent, boolean inherited, IdentitySearchControl[] controls) throws IdentityException
+ public Collection<Group> findAssociatedGroups(Group group, String groupType, boolean parent, boolean inherited, IdentitySearchConstraints controls) throws IdentityException
{
checkNotNullArgument(group, "Group");
@@ -509,7 +497,7 @@
}
- public Collection<Group> findAssociatedGroups(String groupId, String groupType, boolean parent, boolean inherited, IdentitySearchControl[] controls) throws IdentityException
+ public Collection<Group> findAssociatedGroups(String groupId, String groupType, boolean parent, boolean inherited, IdentitySearchConstraints controls) throws IdentityException
{
checkNotNullArgument(groupId, "Group Id");
// checkNotNullArgument(groupType, "Group type");
@@ -527,7 +515,7 @@
return findAssociatedGroups(group, groupType, parent, inherited, null);
}
- public Collection<Group> findAssociatedGroups(User identity, String groupType, IdentitySearchControl[] controls) throws IdentityException
+ public Collection<Group> findAssociatedGroups(User identity, String groupType, IdentitySearchConstraints controls) throws IdentityException
{
checkNotNullArgument(identity, "User");
//checkNotNullArgument(groupType, "Group type");
@@ -549,7 +537,7 @@
return identities;
}
- public Collection<Group> findAssociatedGroups(String userName, String groupType, IdentitySearchControl[] controls) throws IdentityException
+ public Collection<Group> findAssociatedGroups(String userName, String groupType, IdentitySearchConstraints controls) throws IdentityException
{
checkNotNullArgument(userName, "User name");
//checkNotNullArgument(groupType, "Group type");
@@ -567,7 +555,7 @@
return findAssociatedGroups(identity, groupType, null);
}
- public Collection<Group> findAssociatedGroups(User identity, IdentitySearchControl[] controls) throws IdentityException
+ public Collection<Group> findAssociatedGroups(User identity, IdentitySearchConstraints controls) throws IdentityException
{
checkNotNullArgument(identity, "User");
@@ -589,7 +577,7 @@
return identities;
}
- public Collection<Group> findAssociatedGroups(String userName, IdentitySearchControl[] controls) throws IdentityException
+ public Collection<Group> findAssociatedGroups(String userName, IdentitySearchConstraints controls) throws IdentityException
{
checkNotNullArgument(userName, "User name");
@@ -602,10 +590,10 @@
{
checkNotNullArgument(identity, "User");
- return findAssociatedGroups(identity, new IdentitySearchControl[] {});
+ return findAssociatedGroups(identity, (IdentitySearchConstraints)null);
}
- public Collection<User> findAssociatedUsers(Group group, boolean inherited, IdentitySearchControl[] controls) throws IdentityException
+ public Collection<User> findAssociatedUsers(Group group, boolean inherited, IdentitySearchConstraints controls) throws IdentityException
{
checkNotNullArgument(group, "Group");
@@ -633,7 +621,7 @@
return identities;
}
- public Collection<User> findAssociatedUsers(String groupId, boolean inherited, IdentitySearchControl[] controls) throws IdentityException
+ public Collection<User> findAssociatedUsers(String groupId, boolean inherited, IdentitySearchConstraints controls) throws IdentityException
{
checkNotNullArgument(groupId, "Group Id");
@@ -649,7 +637,7 @@
return findAssociatedUsers(group, inherited, null);
}
- public Collection<Group> findRelatedGroups(User user, String groupType, IdentitySearchControl[] controls) throws IdentityException
+ public Collection<Group> findRelatedGroups(User user, String groupType, IdentitySearchConstraints controls) throws IdentityException
{
checkNotNullArgument(user, "User");
@@ -670,7 +658,7 @@
return identities;
}
- public Collection<Group> findRelatedGroups(String userName, String groupType, IdentitySearchControl[] controls) throws IdentityException
+ public Collection<Group> findRelatedGroups(String userName, String groupType, IdentitySearchConstraints controls) throws IdentityException
{
checkNotNullArgument(userName, "User name");
@@ -679,7 +667,7 @@
return findRelatedGroups(user, groupType, controls);
}
- public Collection<User> findRelatedUsers(Group group, IdentitySearchControl[] controls) throws IdentityException
+ public Collection<User> findRelatedUsers(Group group, IdentitySearchConstraints controls) throws IdentityException
{
checkNotNullArgument(group, "Group");
@@ -705,7 +693,7 @@
return identities;
}
- public Collection<User> findRelatedUsers(String groupId, IdentitySearchControl[] controls) throws IdentityException
+ public Collection<User> findRelatedUsers(String groupId, IdentitySearchConstraints controls) throws IdentityException
{
checkNotNullArgument(groupId, "Group Id");
Modified: idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/session/managers/RoleManagerImpl.java
===================================================================
--- idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/session/managers/RoleManagerImpl.java 2009-03-23 03:05:44 UTC (rev 397)
+++ idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/api/session/managers/RoleManagerImpl.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -30,15 +30,15 @@
import org.jboss.identity.idm.api.Group;
import org.jboss.identity.idm.api.IdentityType;
import org.jboss.identity.idm.api.RoleManagerFeaturesDescription;
-import org.jboss.identity.idm.api.IdentitySearchControl;
+import org.jboss.identity.idm.api.IdentitySearchConstraints;
+import org.jboss.identity.idm.api.IdentitySearchConstraintType;
import org.jboss.identity.idm.exception.IdentityException;
import org.jboss.identity.idm.spi.model.IdentityObjectRelationshipType;
import org.jboss.identity.idm.spi.model.IdentityObjectRelationship;
import org.jboss.identity.idm.spi.model.IdentityObjectType;
import org.jboss.identity.idm.spi.model.IdentityObject;
import org.jboss.identity.idm.spi.exception.OperationNotSupportedException;
-import org.jboss.identity.idm.spi.searchcontrol.IdentityObjectSearchControl;
-import org.jboss.identity.idm.impl.api.session.managers.AbstractManager;
+import org.jboss.identity.idm.spi.store.IdentityObjectSearchConstraintType;
import org.jboss.identity.idm.impl.api.model.SimpleRoleType;
import org.jboss.identity.idm.impl.api.model.SimpleRole;
@@ -75,17 +75,14 @@
return getSessionContext().getIdentityStoreRepository().getSupportedFeatures().isRelationshipNameAddRemoveSupported();
}
- public boolean isRoleTypeSearchControlSupported(Class controlClazz)
+ public boolean isRoleTypeSearchConstraintTypeSupported(IdentitySearchConstraintType constraintType)
{
- return getSessionContext().getIdentityStoreRepository().getSupportedFeatures().isRoleNameControlSupported(controlClazz);
- }
+ IdentityObjectSearchConstraintType constraint = IdentityObjectSearchConstraintType.valueOf(constraintType.name());
- public boolean isRoleTypeSearchControlSupported(IdentitySearchControl control)
- {
- if (control instanceof IdentityObjectSearchControl)
+ if (constraint != null)
{
return getSessionContext().getIdentityStoreRepository().getSupportedFeatures().
- isRoleNameControlSupported((IdentityObjectSearchControl)control);
+ isRoleNameSearchConstraintSupported(constraint);
}
else
{
@@ -160,7 +157,7 @@
return null;
}
- public Collection<RoleType> findRoleTypes(IdentitySearchControl[] controls) throws IdentityException
+ public Collection<RoleType> findRoleTypes(IdentitySearchConstraints controls) throws IdentityException
{
@@ -280,7 +277,7 @@
return findRoleTypes(identity, group, null);
}
- public Collection<RoleType> findRoleTypes(User identity, Group group, IdentitySearchControl[] controls) throws IdentityException
+ public Collection<RoleType> findRoleTypes(User identity, Group group, IdentitySearchConstraints controls) throws IdentityException
{
checkNotNullArgument(identity, "User");
checkNotNullArgument(group, "Group");
@@ -298,7 +295,7 @@
}
- public Collection<RoleType> findRoleTypes(String userName, String groupId, IdentitySearchControl[] controls) throws IdentityException
+ public Collection<RoleType> findRoleTypes(String userName, String groupId, IdentitySearchConstraints controls) throws IdentityException
{
checkNotNullArgument(userName, "User name");
checkNotNullArgument(groupId, "Group Id");
@@ -316,7 +313,7 @@
return findUserRoleTypes(identity, null);
}
- public Collection<RoleType> findUserRoleTypes(User identity, IdentitySearchControl[] controls) throws IdentityException
+ public Collection<RoleType> findUserRoleTypes(User identity, IdentitySearchConstraints controls) throws IdentityException
{
checkNotNullArgument(identity, "User");
@@ -341,7 +338,7 @@
}
- public Collection<RoleType> findUserRoleTypes(String userName, IdentitySearchControl[] controls) throws IdentityException
+ public Collection<RoleType> findUserRoleTypes(String userName, IdentitySearchConstraints controls) throws IdentityException
{
checkNotNullArgument(userName, "User name");
@@ -357,7 +354,7 @@
return findGroupRoleTypes(group, null);
}
- public Collection<RoleType> findGroupRoleTypes(String groupId, IdentitySearchControl[] controls) throws IdentityException
+ public Collection<RoleType> findGroupRoleTypes(String groupId, IdentitySearchConstraints controls) throws IdentityException
{
checkNotNullArgument(groupId, "Group Id");
@@ -366,7 +363,7 @@
return findGroupRoleTypes(group, controls);
}
- public Collection<RoleType> findGroupRoleTypes(Group group, IdentitySearchControl[] controls) throws IdentityException
+ public Collection<RoleType> findGroupRoleTypes(Group group, IdentitySearchConstraints controls) throws IdentityException
{
checkNotNullArgument(group, "Group");
@@ -391,7 +388,7 @@
}
- public Collection<Group> findGroupsWithRelatedRole(User identity, IdentitySearchControl[] controls) throws IdentityException
+ public Collection<Group> findGroupsWithRelatedRole(User identity, IdentitySearchConstraints controls) throws IdentityException
{
checkNotNullArgument(identity, "User");
@@ -411,7 +408,7 @@
return identities;
}
- public Collection<Group> findGroupsWithRelatedRole(String userName, IdentitySearchControl[] controls) throws IdentityException
+ public Collection<Group> findGroupsWithRelatedRole(String userName, IdentitySearchConstraints controls) throws IdentityException
{
checkNotNullArgument(userName, "User name");
@@ -420,7 +417,7 @@
return findGroupsWithRelatedRole(user, controls);
}
- public Collection<Group> findGroupsWithRelatedRole(User identity, String groupType, IdentitySearchControl[] controls) throws IdentityException
+ public Collection<Group> findGroupsWithRelatedRole(User identity, String groupType, IdentitySearchConstraints controls) throws IdentityException
{
checkNotNullArgument(identity, "User");
checkNotNullArgument(groupType, "Group type");
@@ -444,7 +441,7 @@
return identities;
}
- public Collection<Group> findGroupsWithRelatedRole(String userName, String groupType, IdentitySearchControl[] controls) throws IdentityException
+ public Collection<Group> findGroupsWithRelatedRole(String userName, String groupType, IdentitySearchConstraints controls) throws IdentityException
{
checkNotNullArgument(userName, "User name");
checkNotNullArgument(groupType, "Group type");
Modified: idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/cache/IdentityStoreCacheSupport.java
===================================================================
--- idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/cache/IdentityStoreCacheSupport.java 2009-03-23 03:05:44 UTC (rev 397)
+++ idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/cache/IdentityStoreCacheSupport.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -30,16 +30,13 @@
import org.jboss.identity.idm.spi.model.IdentityObjectType;
import org.jboss.identity.idm.spi.model.IdentityObjectRelationshipType;
import org.jboss.identity.idm.spi.model.IdentityObjectRelationship;
-import org.jboss.identity.idm.spi.searchcontrol.IdentityObjectSearchControl;
+import org.jboss.identity.idm.spi.search.IdentityObjectSearchConstraints;
import java.util.logging.Logger;
import java.util.logging.Level;
import java.util.Map;
import java.util.Set;
import java.util.Collection;
-import java.util.List;
-import java.util.Arrays;
-import java.util.HashSet;
/**
* Helper class providing caching support for IdentityStore. Stores search methods results using hash from a set of used
@@ -459,7 +456,7 @@
}
protected void putIdentityObjectSearchIntoCache(IdentityObjectType identityType,
- IdentityObjectSearchControl[] controls,
+ IdentityObjectSearchConstraints controls,
Collection<IdentityObject> results)
{
Fqn nodeFqn = createIOTypeSearchNodeFQN(identityType, getControlsHash(controls));
@@ -475,7 +472,7 @@
}
protected Collection<IdentityObject> getIdentityObjectSearchFromCache(IdentityObjectType identityType,
- IdentityObjectSearchControl[] controls)
+ IdentityObjectSearchConstraints controls)
{
Fqn nodeFqn = createIOTypeSearchNodeFQN(identityType, getControlsHash(controls));
@@ -502,7 +499,7 @@
protected void putIdentityObjectSearchToCache(IdentityObject identity,
IdentityObjectRelationshipType relationshipType,
boolean parent,
- IdentityObjectSearchControl[] controls,
+ IdentityObjectSearchConstraints controls,
Collection<IdentityObject> results)
{
@@ -524,7 +521,7 @@
protected Collection<IdentityObject> getIdentityObjectSearchFromCache(IdentityObject identity,
IdentityObjectRelationshipType relationshipType,
boolean parent,
- IdentityObjectSearchControl[] controls)
+ IdentityObjectSearchConstraints controls)
{
Fqn nodeFqn = createIOSearchNodeFQN(identity, relationshipType, parent, getControlsHash(controls));
@@ -814,7 +811,7 @@
- protected void putRelationshipNamesSearchIntoCache(IdentityObjectSearchControl[] controls, Set<String> results)
+ protected void putRelationshipNamesSearchIntoCache(IdentityObjectSearchConstraints controls, Set<String> results)
{
Fqn fqn = createRelationshipNamesAllSearchFqn(getControlsHash(controls));
@@ -831,7 +828,7 @@
}
- protected Set<String> getRelationshipNamesSearchFromCache(IdentityObjectSearchControl[] controls)
+ protected Set<String> getRelationshipNamesSearchFromCache(IdentityObjectSearchConstraints controls)
{
Fqn fqn = createRelationshipNamesAllSearchFqn(getControlsHash(controls));
@@ -856,7 +853,7 @@
}
protected void putRelationshipNamesSearchIntoCache(IdentityObject identity,
- IdentityObjectSearchControl[] controls,
+ IdentityObjectSearchConstraints controls,
Set<String> results)
{
@@ -875,7 +872,7 @@
}
- protected Set<String> getRelationshipNamesSearchFromCache(IdentityObject identity, IdentityObjectSearchControl[] controls)
+ protected Set<String> getRelationshipNamesSearchFromCache(IdentityObject identity, IdentityObjectSearchConstraints controls)
{
@@ -899,16 +896,14 @@
return null;
}
- private int getControlsHash(IdentityObjectSearchControl[] controls)
+ private int getControlsHash(IdentityObjectSearchConstraints controls)
{
// Convert controls to Set to have the same hashcode regardles order of controls
int hashcode = 0;
if (controls != null)
{
- List<IdentityObjectSearchControl> list = Arrays.asList(controls);
- Set<IdentityObjectSearchControl> controlsSet = new HashSet<IdentityObjectSearchControl>(list);
- hashcode = controlsSet.hashCode();
+ hashcode = controls.hashCode();
}
return hashcode;
Modified: idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/cache/JBossCacheIdentityStoreWrapper.java
===================================================================
--- idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/cache/JBossCacheIdentityStoreWrapper.java 2009-03-23 03:05:44 UTC (rev 397)
+++ idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/cache/JBossCacheIdentityStoreWrapper.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -25,31 +25,20 @@
import org.jboss.identity.idm.spi.store.IdentityStore;
import org.jboss.identity.idm.spi.store.FeaturesMetaData;
import org.jboss.identity.idm.spi.store.IdentityStoreInvocationContext;
-import org.jboss.identity.idm.spi.store.IdentityStoreSession;
import org.jboss.identity.idm.spi.model.IdentityObject;
import org.jboss.identity.idm.spi.model.IdentityObjectType;
import org.jboss.identity.idm.spi.model.IdentityObjectRelationshipType;
import org.jboss.identity.idm.spi.model.IdentityObjectRelationship;
import org.jboss.identity.idm.spi.model.IdentityObjectCredential;
-import org.jboss.identity.idm.spi.model.IdentityObjectAttribute;
-import org.jboss.identity.idm.spi.searchcontrol.IdentityObjectSearchControl;
import org.jboss.identity.idm.spi.exception.OperationNotSupportedException;
-import org.jboss.identity.idm.spi.configuration.metadata.IdentityObjectAttributeMetaData;
-import org.jboss.identity.idm.spi.configuration.metadata.IdentityStoreConfigurationMetaData;
import org.jboss.identity.idm.spi.configuration.IdentityStoreConfigurationContext;
+import org.jboss.identity.idm.spi.search.IdentityObjectSearchConstraints;
import org.jboss.identity.idm.exception.IdentityException;
-import org.jboss.cache.Cache;
-import org.jboss.cache.DefaultCacheFactory;
-import org.jboss.cache.CacheFactory;
-import org.jboss.cache.lock.IsolationLevel;
-import org.jboss.cache.transaction.GenericTransactionManagerLookup;
-import org.jboss.cache.config.Configuration;
import java.util.Map;
import java.util.Collection;
import java.util.Set;
import java.util.logging.Logger;
-import java.io.File;
/**
* IdentityStore implementation that wraps another IdentityStore and uses JBossCache to cache results.
@@ -201,7 +190,7 @@
public Collection<IdentityObject> findIdentityObject(IdentityStoreInvocationContext invocationCtx,
IdentityObjectType identityType,
- IdentityObjectSearchControl[] controls) throws IdentityException
+ IdentityObjectSearchConstraints controls) throws IdentityException
{
Collection<IdentityObject> results = getIdentityObjectSearchFromCache(identityType, controls);
@@ -231,7 +220,7 @@
IdentityObject identity,
IdentityObjectRelationshipType relationshipType,
boolean parent,
- IdentityObjectSearchControl[] controls) throws IdentityException
+ IdentityObjectSearchConstraints controls) throws IdentityException
{
Collection<IdentityObject> results = getIdentityObjectSearchFromCache(identity, relationshipType, parent, controls);
@@ -353,7 +342,7 @@
}
public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx,
- IdentityObjectSearchControl[] controls) throws IdentityException, OperationNotSupportedException
+ IdentityObjectSearchConstraints controls) throws IdentityException, OperationNotSupportedException
{
Set<String> results = getRelationshipNamesSearchFromCache(controls);
@@ -370,7 +359,7 @@
public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx,
IdentityObject identity,
- IdentityObjectSearchControl[] controls) throws IdentityException, OperationNotSupportedException
+ IdentityObjectSearchConstraints controls) throws IdentityException, OperationNotSupportedException
{
Modified: idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/repository/FallbackIdentityStoreRepository.java
===================================================================
--- idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/repository/FallbackIdentityStoreRepository.java 2009-03-23 03:05:44 UTC (rev 397)
+++ idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/repository/FallbackIdentityStoreRepository.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -27,13 +27,12 @@
import org.jboss.identity.idm.spi.store.FeaturesMetaData;
import org.jboss.identity.idm.spi.store.IdentityStoreInvocationContext;
import org.jboss.identity.idm.spi.store.IdentityStoreSession;
-import org.jboss.identity.idm.spi.searchcontrol.IdentityObjectSearchControl;
+import org.jboss.identity.idm.spi.store.IdentityObjectSearchConstraintType;
import org.jboss.identity.idm.spi.model.IdentityObject;
import org.jboss.identity.idm.spi.model.IdentityObjectType;
import org.jboss.identity.idm.spi.model.IdentityObjectRelationshipType;
import org.jboss.identity.idm.spi.model.IdentityObjectRelationship;
import org.jboss.identity.idm.spi.exception.OperationNotSupportedException;
-import org.jboss.identity.idm.spi.configuration.metadata.IdentityStoreConfigurationMetaData;
import org.jboss.identity.idm.spi.configuration.metadata.IdentityRepositoryConfigurationMetaData;
import org.jboss.identity.idm.spi.configuration.metadata.IdentityObjectAttributeMetaData;
import org.jboss.identity.idm.spi.configuration.IdentityRepositoryConfigurationContext;
@@ -41,10 +40,9 @@
import org.jboss.identity.idm.spi.model.IdentityObjectCredential;
import org.jboss.identity.idm.spi.model.IdentityObjectCredentialType;
import org.jboss.identity.idm.spi.model.IdentityObjectAttribute;
+import org.jboss.identity.idm.spi.search.IdentityObjectSearchConstraints;
import org.jboss.identity.idm.exception.IdentityException;
import org.jboss.identity.idm.impl.store.SimpleIdentityStoreInvocationContext;
-import org.jboss.identity.idm.impl.api.PageSearchControl;
-import org.jboss.identity.idm.impl.api.SortByNameSearchControl;
import org.jboss.identity.idm.impl.api.session.managers.RoleManagerImpl;
import java.util.Map;
@@ -58,7 +56,6 @@
import java.util.Comparator;
import java.util.Arrays;
import java.util.ArrayList;
-import java.util.LinkedHashSet;
/**
* <p>In FallbackIdentityStoreRepository one IdentityStore plays the role of default store. Any operation that cannot be
@@ -150,16 +147,11 @@
return defaultIdentityStore.getSupportedFeatures().isNamedRelationshipsSupported();
}
- public boolean isControlSupported(IdentityObjectType identityObjectType, IdentityObjectSearchControl control)
+ public boolean isSearchConstraintTypeSupported(IdentityObjectType identityObjectType, IdentityObjectSearchConstraintType storeSearchConstraint)
{
- return resolveIdentityStore(identityObjectType).getSupportedFeatures().isControlSupported(identityObjectType, control);
+ return resolveIdentityStore(identityObjectType).getSupportedFeatures().isSearchConstraintTypeSupported(identityObjectType, storeSearchConstraint);
}
- public boolean isControlSupported(IdentityObjectType identityObjectType, Class<?> controlClazz)
- {
- return resolveIdentityStore(identityObjectType).getSupportedFeatures().isControlSupported(identityObjectType, controlClazz);
- }
-
public Set<String> getSupportedIdentityObjectTypes()
{
Set<String> supportedIOTs = new HashSet<String>();
@@ -232,36 +224,22 @@
}
- public boolean isRoleNameControlSupported(IdentityObjectSearchControl control)
+ public boolean isRoleNameSearchConstraintSupported(IdentityObjectSearchConstraintType constraint)
{
// If there is any IdentityStore that supports named relationships...
for (IdentityStore identityStore : getIdentityStoreMappings().values())
{
if (identityStore.getSupportedFeatures().isNamedRelationshipsSupported() &&
- identityStore.getSupportedFeatures().isRoleNameControlSupported(control))
+ identityStore.getSupportedFeatures().isRoleNameSearchConstraintSupported(constraint))
{
return true;
}
}
return defaultIdentityStore.getSupportedFeatures().isNamedRelationshipsSupported() &&
- defaultIdentityStore.getSupportedFeatures().isRoleNameControlSupported(control);
+ defaultIdentityStore.getSupportedFeatures().isRoleNameSearchConstraintSupported(constraint);
}
- public boolean isRoleNameControlSupported(Class<?> controlClazz)
- {
- // If there is any IdentityStore that supports named relationships...
- for (IdentityStore identityStore : getIdentityStoreMappings().values())
- {
- if (identityStore.getSupportedFeatures().isNamedRelationshipsSupported() &&
- identityStore.getSupportedFeatures().isRoleNameControlSupported(controlClazz))
- {
- return true;
- }
- }
- return defaultIdentityStore.getSupportedFeatures().isNamedRelationshipsSupported() &&
- defaultIdentityStore.getSupportedFeatures().isRoleNameControlSupported(controlClazz);
- }
- };
+ };
}
@@ -412,7 +390,7 @@
return defaultIdentityStore.findIdentityObject(invocationContext, id);
}
- public Collection<IdentityObject> findIdentityObject(IdentityStoreInvocationContext invocationCtx, IdentityObjectType identityType, IdentityObjectSearchControl[] controls) throws IdentityException
+ public Collection<IdentityObject> findIdentityObject(IdentityStoreInvocationContext invocationCtx, IdentityObjectType identityType, IdentityObjectSearchConstraints controls) throws IdentityException
{
IdentityStore targetStore = resolveIdentityStore(identityType);
IdentityStoreInvocationContext targetCtx = resolveInvocationContext(targetStore, invocationCtx);
@@ -424,7 +402,7 @@
IdentityObject identity,
IdentityObjectRelationshipType relationshipType,
boolean parent,
- IdentityObjectSearchControl[] controls) throws IdentityException
+ IdentityObjectSearchConstraints constraints) throws IdentityException
{
// Check in the mapped store and merge with default
@@ -437,7 +415,7 @@
if (mappedStore == defaultIdentityStore)
{
- return defaultIdentityStore.findIdentityObject(defaultCtx, identity, relationshipType, parent, controls);
+ return defaultIdentityStore.findIdentityObject(defaultCtx, identity, relationshipType, parent, constraints);
}
Collection<IdentityObject> results = new LinkedList<IdentityObject>();
@@ -445,7 +423,7 @@
if (relationshipType == null || !RoleManagerImpl.ROLE.getName().equals(relationshipType.getName()) ||
mappedStore.getSupportedFeatures().isNamedRelationshipsSupported())
{
- results = mappedStore.findIdentityObject(mappedCtx, identity, relationshipType, parent, controls);
+ results = mappedStore.findIdentityObject(mappedCtx, identity, relationshipType, parent, constraints);
}
IdentityObject defaultStoreIdentityObject = null;
@@ -461,27 +439,8 @@
if (defaultStoreIdentityObject != null)
{
- Collection<IdentityObject> objects = defaultIdentityStore.findIdentityObject(defaultCtx, identity, relationshipType, parent, controls);
+ Collection<IdentityObject> objects = defaultIdentityStore.findIdentityObject(defaultCtx, identity, relationshipType, parent, constraints);
- PageSearchControl pageSearchControl = null;
- SortByNameSearchControl sortSearchControl = null;
-
- if (controls != null)
- {
- for (IdentityObjectSearchControl control : controls)
- {
- if (control instanceof PageSearchControl)
- {
- pageSearchControl = (PageSearchControl)control;
- }
- else if (control instanceof SortByNameSearchControl)
- {
- sortSearchControl = (SortByNameSearchControl)control;
- }
- }
- }
-
-
// If default store contain related relationships merge and sort/page once more
if (objects != null && objects.size() != 0)
{
@@ -489,15 +448,15 @@
results.addAll(objects);
//TODO: hardcoded - expects List
- if (pageSearchControl != null && results instanceof List)
+ if (constraints != null && constraints.isPaged() && results instanceof List)
{
- results = cutPageFromResults((List<IdentityObject>)results, pageSearchControl);
+ results = cutPageFromResults((List<IdentityObject>)results, constraints);
}
//TODO: hardcoded - expects List
- if (sortSearchControl != null && results instanceof List)
+ if (constraints != null && constraints.isSorted() && results instanceof List)
{
- sortByName((List<IdentityObject>)results, sortSearchControl.isAscending());
+ sortByName((List<IdentityObject>)results, constraints.isAscending());
}
}
}
@@ -691,7 +650,7 @@
return name;
}
- public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx, IdentityObjectSearchControl[] controls) throws IdentityException, OperationNotSupportedException
+ public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx, IdentityObjectSearchConstraints controls) throws IdentityException, OperationNotSupportedException
{
Set<String> results = new HashSet<String>();
@@ -709,7 +668,7 @@
return results;
}
- public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx, IdentityObject identity, IdentityObjectSearchControl[] controls) throws IdentityException, OperationNotSupportedException
+ public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx, IdentityObject identity, IdentityObjectSearchConstraints controls) throws IdentityException, OperationNotSupportedException
{
IdentityStore toStore = resolveIdentityStore(identity);
@@ -1040,10 +999,10 @@
}
//TODO: other way
- private List<IdentityObject> cutPageFromResults(List<IdentityObject> objects, PageSearchControl pageControl)
+ private List<IdentityObject> cutPageFromResults(List<IdentityObject> objects, IdentityObjectSearchConstraints constraints)
{
List<IdentityObject> results = new LinkedList<IdentityObject>();
- for (int i = pageControl.getOffset(); i < pageControl.getOffset() + pageControl.getLimit(); i++)
+ for (int i = constraints.getFirstResult(); i < constraints.getFirstResult() + constraints.getMaxResults(); i++)
{
if (i < objects.size())
{
Modified: idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/repository/WrapperIdentityStoreRepository.java
===================================================================
--- idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/repository/WrapperIdentityStoreRepository.java 2009-03-23 03:05:44 UTC (rev 397)
+++ idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/repository/WrapperIdentityStoreRepository.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -27,9 +27,7 @@
import org.jboss.identity.idm.spi.store.IdentityStoreSession;
import org.jboss.identity.idm.spi.store.FeaturesMetaData;
import org.jboss.identity.idm.spi.store.IdentityStoreInvocationContext;
-import org.jboss.identity.idm.spi.configuration.metadata.IdentityStoreConfigurationMetaData;
import org.jboss.identity.idm.spi.configuration.metadata.IdentityObjectAttributeMetaData;
-import org.jboss.identity.idm.spi.configuration.metadata.IdentityRepositoryConfigurationMetaData;
import org.jboss.identity.idm.spi.configuration.IdentityRepositoryConfigurationContext;
import org.jboss.identity.idm.spi.configuration.IdentityStoreConfigurationContext;
import org.jboss.identity.idm.spi.model.IdentityObject;
@@ -39,7 +37,7 @@
import org.jboss.identity.idm.spi.model.IdentityObjectCredential;
import org.jboss.identity.idm.spi.model.IdentityObjectAttribute;
import org.jboss.identity.idm.spi.exception.OperationNotSupportedException;
-import org.jboss.identity.idm.spi.searchcontrol.IdentityObjectSearchControl;
+import org.jboss.identity.idm.spi.search.IdentityObjectSearchConstraints;
import org.jboss.identity.idm.exception.IdentityException;
import org.jboss.identity.idm.impl.store.SimpleIdentityStoreInvocationContext;
@@ -165,7 +163,7 @@
public Collection<IdentityObject> findIdentityObject(IdentityStoreInvocationContext invocationCtx,
IdentityObjectType identityType,
- IdentityObjectSearchControl[] controls) throws IdentityException
+ IdentityObjectSearchConstraints controls) throws IdentityException
{
return defaultIdentityStore.findIdentityObject(resolveIdentityStoreInvocationContext(invocationCtx), identityType, controls);
}
@@ -174,7 +172,7 @@
IdentityObject identity,
IdentityObjectRelationshipType relationshipType,
boolean parent,
- IdentityObjectSearchControl[] controls) throws IdentityException
+ IdentityObjectSearchConstraints controls) throws IdentityException
{
return defaultIdentityStore.findIdentityObject(resolveIdentityStoreInvocationContext(invocationCtx), identity, relationshipType, parent, controls);
}
@@ -239,14 +237,14 @@
}
public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx,
- IdentityObjectSearchControl[] controls) throws IdentityException, OperationNotSupportedException
+ IdentityObjectSearchConstraints controls) throws IdentityException, OperationNotSupportedException
{
return defaultIdentityStore.getRelationshipNames(resolveIdentityStoreInvocationContext(ctx), controls);
}
public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx,
IdentityObject identity,
- IdentityObjectSearchControl[] controls) throws IdentityException, OperationNotSupportedException
+ IdentityObjectSearchConstraints controls) throws IdentityException, OperationNotSupportedException
{
return defaultIdentityStore.getRelationshipNames(resolveIdentityStoreInvocationContext(ctx), identity, controls);
}
Modified: idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/store/FeaturesMetaDataImpl.java
===================================================================
--- idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/store/FeaturesMetaDataImpl.java 2009-03-23 03:05:44 UTC (rev 397)
+++ idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/store/FeaturesMetaDataImpl.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -35,8 +35,8 @@
import org.jboss.identity.idm.spi.model.IdentityObjectCredentialType;
import org.jboss.identity.idm.spi.model.IdentityObjectRelationshipType;
import org.jboss.identity.idm.spi.model.IdentityObjectType;
-import org.jboss.identity.idm.spi.searchcontrol.IdentityObjectSearchControl;
import org.jboss.identity.idm.spi.store.FeaturesMetaData;
+import org.jboss.identity.idm.spi.store.IdentityObjectSearchConstraintType;
/**
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
@@ -46,7 +46,7 @@
{
private Set<String> supportedTypeNames = new HashSet<String>();
- private final Set<Class<?>> supportedSearchControls;
+ private final Set<IdentityObjectSearchConstraintType> supportedSearchConstraintTypes;
private final Map<String, Set<String>> supportedCredentials;
@@ -59,7 +59,7 @@
public FeaturesMetaDataImpl(IdentityStoreConfigurationMetaData configurationMD,
- Set<Class<?>> supportedControls,
+ Set<IdentityObjectSearchConstraintType> supportedControls,
boolean namedRelationshipsSupport,
Set<String> readOnlyObjectTypes)
{
@@ -84,7 +84,7 @@
this.supportedCredentials = Collections.unmodifiableMap(supportedCredentials);
- this.supportedSearchControls = Collections.unmodifiableSet(supportedControls);
+ this.supportedSearchConstraintTypes = Collections.unmodifiableSet(supportedControls);
@@ -162,24 +162,15 @@
return namedRelationshipsSupport;
}
- public boolean isControlSupported(IdentityObjectType identityObjectType, IdentityObjectSearchControl control)
+ public boolean isSearchConstraintTypeSupported(IdentityObjectType identityObjectType, IdentityObjectSearchConstraintType storeSearchConstraint)
{
- if (supportedSearchControls.contains(control.getClass()))
+ if (supportedSearchConstraintTypes.contains(storeSearchConstraint))
{
return true;
}
return false;
}
- public boolean isControlSupported(IdentityObjectType identityObjectType, Class<?> controlClazz)
- {
- if (supportedSearchControls.contains(controlClazz))
- {
- return true;
- }
- return false;
- }
-
public Set<String> getSupportedIdentityObjectTypes()
{
return supportedTypeNames;
@@ -222,15 +213,10 @@
return false;
}
- public boolean isRoleNameControlSupported(IdentityObjectSearchControl control)
+ public boolean isRoleNameSearchConstraintSupported(IdentityObjectSearchConstraintType constraint)
{
// For now simple - use the same allowed controls list for everything
- return isNamedRelationshipsSupported() && isControlSupported(null, control);
+ return isNamedRelationshipsSupported() && isSearchConstraintTypeSupported(null, constraint);
}
- public boolean isRoleNameControlSupported(Class<?> controlClazz)
- {
- // For now simple - use the same allowed controls list for everything
- return isNamedRelationshipsSupported() && isControlSupported(null, controlClazz);
- }
}
Modified: idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/store/hibernate/HibernateIdentityStoreImpl.java
===================================================================
--- idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/store/hibernate/HibernateIdentityStoreImpl.java 2009-03-23 03:05:44 UTC (rev 397)
+++ idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/store/hibernate/HibernateIdentityStoreImpl.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -41,10 +41,6 @@
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.criterion.Restrictions;
import org.jboss.identity.idm.exception.IdentityException;
-import org.jboss.identity.idm.impl.api.AttributeFilterSearchControl;
-import org.jboss.identity.idm.impl.api.NameFilterSearchControl;
-import org.jboss.identity.idm.impl.api.PageSearchControl;
-import org.jboss.identity.idm.impl.api.SortByNameSearchControl;
import org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject;
import org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute;
import org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute;
@@ -69,11 +65,12 @@
import org.jboss.identity.idm.spi.model.IdentityObjectRelationship;
import org.jboss.identity.idm.spi.model.IdentityObjectRelationshipType;
import org.jboss.identity.idm.spi.model.IdentityObjectType;
-import org.jboss.identity.idm.spi.searchcontrol.IdentityObjectSearchControl;
import org.jboss.identity.idm.spi.store.FeaturesMetaData;
import org.jboss.identity.idm.spi.store.IdentityStore;
import org.jboss.identity.idm.spi.store.IdentityStoreInvocationContext;
import org.jboss.identity.idm.spi.store.IdentityStoreSession;
+import org.jboss.identity.idm.spi.store.IdentityObjectSearchConstraintType;
+import org.jboss.identity.idm.spi.search.IdentityObjectSearchConstraints;
//import javax.persistence.Persistence;
import javax.naming.InitialContext;
@@ -141,7 +138,8 @@
// TODO: rewrite this into some more handy object
private IdentityStoreConfigurationMetaData configurationMD;
- private static Set<Class<?>> supportedIdentityObjectSearchControls = new HashSet<Class<?>>();
+ private static Set<IdentityObjectSearchConstraintType> supportedIdentityObjectSearchControls =
+ new HashSet<IdentityObjectSearchConstraintType>();
private static Set<String> supportedCredentialTypes = new HashSet<String>();
@@ -157,10 +155,10 @@
static {
// List all supported controls classes
- supportedIdentityObjectSearchControls.add(PageSearchControl.class);
- supportedIdentityObjectSearchControls.add(SortByNameSearchControl.class);
- supportedIdentityObjectSearchControls.add(AttributeFilterSearchControl.class);
- supportedIdentityObjectSearchControls.add(NameFilterSearchControl.class);
+ supportedIdentityObjectSearchControls.add(IdentityObjectSearchConstraintType.ATTRIBUTE_FILTER);
+ supportedIdentityObjectSearchControls.add(IdentityObjectSearchConstraintType.NAME_FILTER);
+ supportedIdentityObjectSearchControls.add(IdentityObjectSearchConstraintType.PAGE);
+ supportedIdentityObjectSearchControls.add(IdentityObjectSearchConstraintType.SORT);
// credential types supported by this impl
supportedCredentialTypes.add(CREDENTIAL_TYPE_PASSWORD);
@@ -602,40 +600,10 @@
@SuppressWarnings("unchecked")
public Collection<IdentityObject> findIdentityObject(IdentityStoreInvocationContext ctx,
IdentityObjectType identityType,
- IdentityObjectSearchControl[] controls) throws IdentityException
+ IdentityObjectSearchConstraints constraints) throws IdentityException
{
checkIOType(identityType);
- checkControls(controls);
-
- PageSearchControl pageSearchControl = null;
- SortByNameSearchControl sortSearchControl = null;
- AttributeFilterSearchControl attributeFilterControl = null;
- NameFilterSearchControl nameFilterSearchControl = null;
-
- if (controls != null)
- {
- for (IdentityObjectSearchControl control : controls)
- {
- if (control instanceof PageSearchControl)
- {
- pageSearchControl = (PageSearchControl)control;
- }
- else if (control instanceof SortByNameSearchControl)
- {
- sortSearchControl = (SortByNameSearchControl)control;
- }
- else if (control instanceof AttributeFilterSearchControl)
- {
- attributeFilterControl = (AttributeFilterSearchControl)control;
- }
- else if (control instanceof NameFilterSearchControl)
- {
- nameFilterSearchControl = (NameFilterSearchControl)control;
- }
- }
- }
-
HibernateIdentityObjectType hibernateType = getHibernateIdentityObjectType(ctx, identityType);
List<IdentityObject> results;
@@ -647,9 +615,9 @@
Query q = null;
- if (sortSearchControl != null)
+ if (constraints != null && constraints.isSorted())
{
- if (sortSearchControl.isAscending())
+ if (constraints.isAscending())
{
q = hibernateSession.createQuery(HibernateIdentityObject.findIdentityObjectsByTypeOrderedByNameAsc);
}
@@ -663,22 +631,22 @@
q = hibernateSession.createQuery(HibernateIdentityObject.findIdentityObjectsByType);
}
- if (pageSearchControl != null)
+ if (constraints != null && constraints.isPaged())
{
- if (pageSearchControl.getLimit() > 0)
+ if (constraints.getMaxResults() > 0)
{
- q.setMaxResults(pageSearchControl.getLimit());
+ q.setMaxResults(constraints.getMaxResults());
}
- q.setFirstResult(pageSearchControl.getOffset());
+ q.setFirstResult(constraints.getFirstResult());
}
q.setParameter("realm", getRealm(hibernateSession, ctx))
.setParameter("typeName", hibernateType.getName());
- if (nameFilterSearchControl != null)
+ if (constraints != null && constraints.getFilter() != null)
{
- q.setParameter("nameFilter", nameFilterSearchControl.getFilter().replaceAll("\\*", "%"));
+ q.setParameter("nameFilter", constraints.getFilter().replaceAll("\\*", "%"));
}
else
{
@@ -695,9 +663,9 @@
throw new IdentityException("Cannot find IdentityObjects with type '" + identityType.getName() + "'", e);
}
- if (attributeFilterControl != null)
+ if (constraints != null && constraints.isFiltered())
{
- filterByAttributesValues(results, attributeFilterControl.getValues());
+ filterByAttributesValues(results, constraints.getValues());
}
return results;
@@ -716,7 +684,7 @@
IdentityObject identity,
IdentityObjectRelationshipType relationshipType,
boolean parent,
- IdentityObjectSearchControl[] controls) throws IdentityException
+ IdentityObjectSearchConstraints constraints) throws IdentityException
{
//TODO:test
@@ -724,43 +692,13 @@
List<IdentityObject> results;
- checkControls(controls);
-
- PageSearchControl pageSearchControl = null;
- SortByNameSearchControl sortSearchControl = null;
- AttributeFilterSearchControl attributeFilterControl = null;
- NameFilterSearchControl nameFilterSearchControl = null;
-
- if (controls != null)
- {
- for (IdentityObjectSearchControl control : controls)
- {
- if (control instanceof PageSearchControl)
- {
- pageSearchControl = (PageSearchControl)control;
- }
- else if (control instanceof SortByNameSearchControl)
- {
- sortSearchControl = (SortByNameSearchControl)control;
- }
- else if (control instanceof AttributeFilterSearchControl)
- {
- attributeFilterControl = (AttributeFilterSearchControl)control;
- }
- else if (control instanceof NameFilterSearchControl)
- {
- nameFilterSearchControl = (NameFilterSearchControl)control;
- }
- }
- }
-
boolean orderByName = false;
boolean ascending = true;
- if (sortSearchControl != null)
+ if (constraints != null && constraints.isSorted())
{
orderByName = true;
- ascending = sortSearchControl.isAscending();
+ ascending = constraints.isAscending();
}
try
@@ -834,9 +772,9 @@
q.setParameter("relType", relationshipType.getName());
}
- if (nameFilterSearchControl != null)
+ if (constraints != null && constraints.getFilter() != null)
{
- q.setParameter("nameFilter", nameFilterSearchControl.getFilter().replaceAll("\\*", "%"));
+ q.setParameter("nameFilter", constraints.getFilter().replaceAll("\\*", "%"));
}
else
{
@@ -844,12 +782,12 @@
}
- if (pageSearchControl != null)
+ if (constraints != null && constraints.isPaged())
{
- q.setFirstResult(pageSearchControl.getOffset());
- if (pageSearchControl.getLimit() > 0)
+ q.setFirstResult(constraints.getFirstResult());
+ if (constraints.getMaxResults() > 0)
{
- q.setMaxResults(pageSearchControl.getLimit());
+ q.setMaxResults(constraints.getMaxResults());
}
}
@@ -864,9 +802,9 @@
throw new IdentityException("Cannot find IdentityObjects", e);
}
- if (attributeFilterControl != null)
+ if (constraints != null && constraints.isFiltered())
{
- filterByAttributesValues(results, attributeFilterControl.getValues());
+ filterByAttributesValues(results, constraints.getValues());
}
return results;
@@ -1172,51 +1110,20 @@
return name;
}
- public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx, IdentityObjectSearchControl[] controls) throws IdentityException, OperationNotSupportedException
+ public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx, IdentityObjectSearchConstraints constraints) throws IdentityException, OperationNotSupportedException
{
Set<String> names = null;
Session em = getHibernateSession(ctx);
- checkControls(controls);
-
- PageSearchControl pageSearchControl = null;
- SortByNameSearchControl sortSearchControl = null;
- AttributeFilterSearchControl attributeFilterControl = null;
- NameFilterSearchControl nameFilterSearchControl = null;
-
- if (controls != null)
- {
- for (IdentityObjectSearchControl control : controls)
- {
- if (control instanceof PageSearchControl)
- {
- pageSearchControl = (PageSearchControl)control;
- }
- else if (control instanceof SortByNameSearchControl)
- {
- sortSearchControl = (SortByNameSearchControl)control;
- }
- else if (control instanceof AttributeFilterSearchControl)
- {
- attributeFilterControl = (AttributeFilterSearchControl)control;
- }
- else if (control instanceof NameFilterSearchControl)
- {
- nameFilterSearchControl = (NameFilterSearchControl)control;
- }
- }
- }
-
-
try
{
Query q = null;
- if (sortSearchControl != null)
+ if (constraints != null && constraints.isSorted())
{
- if (sortSearchControl.isAscending())
+ if (constraints.isAscending())
{
q = em.createQuery(HibernateIdentityObjectRelationshipName.findIdentityObjectRelationshipNamesOrderedByNameAsc);
}
@@ -1232,9 +1139,9 @@
q.setParameter("realm", getRealm(em, ctx));
- if (nameFilterSearchControl != null)
+ if (constraints != null && constraints.getFilter() != null)
{
- q.setParameter("nameFilter", nameFilterSearchControl.getFilter().replaceAll("\\*", "%"));
+ q.setParameter("nameFilter", constraints.getFilter().replaceAll("\\*", "%"));
}
else
{
@@ -1242,12 +1149,12 @@
}
- if (pageSearchControl != null)
+ if (constraints != null && constraints.isPaged())
{
- q.setFirstResult(pageSearchControl.getOffset());
- if (pageSearchControl.getLimit() > 0)
+ q.setFirstResult(constraints.getMaxResults());
+ if (constraints.getFirstResult() > 0)
{
- q.setMaxResults(pageSearchControl.getLimit());
+ q.setMaxResults(constraints.getMaxResults());
}
}
@@ -1266,10 +1173,10 @@
public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx) throws IdentityException, OperationNotSupportedException
{
- return getRelationshipNames(ctx, new IdentityObjectSearchControl[]{});
+ return getRelationshipNames(ctx, (IdentityObjectSearchConstraints)null);
}
- public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx, IdentityObject identity, IdentityObjectSearchControl[] controls) throws IdentityException, OperationNotSupportedException
+ public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx, IdentityObject identity, IdentityObjectSearchConstraints constraints) throws IdentityException, OperationNotSupportedException
{
Set<String> names;
@@ -1278,33 +1185,13 @@
Session em = getHibernateSession(ctx);
- checkControls(controls);
-
- PageSearchControl pageSearchControl = null;
- SortByNameSearchControl sortSearchControl = null;
-
- if (controls != null)
- {
- for (IdentityObjectSearchControl control : controls)
- {
- if (control instanceof PageSearchControl)
- {
- pageSearchControl = (PageSearchControl)control;
- }
- else if (control instanceof SortByNameSearchControl)
- {
- sortSearchControl = (SortByNameSearchControl)control;
- }
- }
- }
-
try
{
Query q = null;
- if (sortSearchControl != null)
+ if (constraints != null)
{
- if (sortSearchControl.isAscending())
+ if (constraints.isAscending())
{
q = em.createQuery(HibernateIdentityObjectRelationshipName.findIdentityObjectRelationshipNamesForIdentityObjectOrderedByNameAsc);
}
@@ -1320,12 +1207,12 @@
q.setParameter("identityObject", hibernateObject);
- if (pageSearchControl != null)
+ if (constraints != null && constraints.isPaged())
{
- q.setFirstResult(pageSearchControl.getOffset());
- if (pageSearchControl.getLimit() > 0)
+ q.setFirstResult(constraints.getFirstResult());
+ if (constraints.getMaxResults() > 0)
{
- q.setMaxResults(pageSearchControl.getLimit());
+ q.setMaxResults(constraints.getMaxResults());
}
}
@@ -2152,19 +2039,19 @@
return isAllowNotDefinedAttributes;
}
- private void checkControls(IdentityObjectSearchControl[] controls) throws IdentityException
- {
- if (controls != null)
- {
- for (IdentityObjectSearchControl control : controls)
- {
- if (!supportedIdentityObjectSearchControls.contains(control.getClass()))
- {
- throw new IdentityException("IdentityObjectSearchControl not supported by this IdentityStore: " + control.getClass());
- }
- }
- }
- }
+// private void checkControls(IdentityObjectSearchConstraints controls) throws IdentityException
+// {
+// if (controls != null)
+// {
+// for (IdentityObjectSearchControl control : controls)
+// {
+// if (!supportedIdentityObjectSearchControls.contains(control.getClass()))
+// {
+// throw new IdentityException("IdentityObjectSearchControl not supported by this IdentityStore: " + control.getClass());
+// }
+// }
+// }
+// }
/**
* Resolve store mapping for attribute name. If attribute is not mapped and store doesn't allow not defined
Modified: idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/store/ldap/LDAPIdentityStoreImpl.java
===================================================================
--- idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/store/ldap/LDAPIdentityStoreImpl.java 2009-03-23 03:05:44 UTC (rev 397)
+++ idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/store/ldap/LDAPIdentityStoreImpl.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -58,11 +58,7 @@
import org.jboss.identity.idm.exception.IdentityException;
import org.jboss.identity.idm.impl.NotYetImplementedException;
-import org.jboss.identity.idm.impl.api.AttributeFilterSearchControl;
-import org.jboss.identity.idm.impl.api.NameFilterSearchControl;
-import org.jboss.identity.idm.impl.api.PageSearchControl;
import org.jboss.identity.idm.impl.api.SimpleAttribute;
-import org.jboss.identity.idm.impl.api.SortByNameSearchControl;
import org.jboss.identity.idm.impl.helper.Tools;
import org.jboss.identity.idm.impl.model.ldap.LDAPIdentityObjectImpl;
import org.jboss.identity.idm.impl.model.ldap.LDAPIdentityObjectRelationshipImpl;
@@ -78,11 +74,12 @@
import org.jboss.identity.idm.spi.model.IdentityObjectRelationship;
import org.jboss.identity.idm.spi.model.IdentityObjectRelationshipType;
import org.jboss.identity.idm.spi.model.IdentityObjectType;
-import org.jboss.identity.idm.spi.searchcontrol.IdentityObjectSearchControl;
import org.jboss.identity.idm.spi.store.FeaturesMetaData;
import org.jboss.identity.idm.spi.store.IdentityStore;
import org.jboss.identity.idm.spi.store.IdentityStoreInvocationContext;
import org.jboss.identity.idm.spi.store.IdentityStoreSession;
+import org.jboss.identity.idm.spi.store.IdentityObjectSearchConstraintType;
+import org.jboss.identity.idm.spi.search.IdentityObjectSearchConstraints;
/**
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
@@ -105,7 +102,8 @@
IdentityStoreConfigurationMetaData configurationMD;
- private static Set<Class<?>> supportedSearchControls = new HashSet<Class<?>>();
+ private static Set<IdentityObjectSearchConstraintType> supportedSearchConstraintTypes =
+ new HashSet<IdentityObjectSearchConstraintType>();
// <IdentityObjectType name, <Attribute name, MD>
private Map<String, Map<String, IdentityObjectAttributeMetaData>> attributesMetaData = new HashMap<String, Map<String, IdentityObjectAttributeMetaData>>();
@@ -114,9 +112,9 @@
// List all supported controls classes
//TODO: attribute filter
- supportedSearchControls.add(SortByNameSearchControl.class);
- supportedSearchControls.add(PageSearchControl.class);
- supportedSearchControls.add(NameFilterSearchControl.class);
+ supportedSearchConstraintTypes.add(IdentityObjectSearchConstraintType.SORT);
+ supportedSearchConstraintTypes.add(IdentityObjectSearchConstraintType.PAGE);
+ supportedSearchConstraintTypes.add(IdentityObjectSearchConstraintType.NAME_FILTER);
//supportedSearchControls.add(AttributeFilterSearchControl.class);
}
@@ -146,7 +144,7 @@
}
}
- supportedFeatures = new FeaturesMetaDataImpl(configurationMD, supportedSearchControls, false, readOnlyObjectTypes);
+ supportedFeatures = new FeaturesMetaDataImpl(configurationMD, supportedSearchConstraintTypes, false, readOnlyObjectTypes);
// Attribute mappings - helper structures
@@ -551,48 +549,21 @@
return null;
}
- public Collection<IdentityObject> findIdentityObject(IdentityStoreInvocationContext invocationCtx, IdentityObjectType type, IdentityObjectSearchControl[] controls) throws IdentityException
+ public Collection<IdentityObject> findIdentityObject(IdentityStoreInvocationContext invocationCtx,
+ IdentityObjectType type,
+ IdentityObjectSearchConstraints constraints) throws IdentityException
{
- checkControls(controls);
-
//TODO: page control with LDAP request control
- PageSearchControl pageSearchControl = null;
- SortByNameSearchControl sortSearchControl = null;
- AttributeFilterSearchControl attributeFilterSearchControl = null;
- NameFilterSearchControl nameFilterSearchControl = null;
- if (controls != null)
- {
- for (IdentityObjectSearchControl control : controls)
- {
- if (control instanceof PageSearchControl)
- {
- pageSearchControl = (PageSearchControl)control;
- }
- else if (control instanceof SortByNameSearchControl)
- {
- sortSearchControl = (SortByNameSearchControl)control;
- }
- else if (control instanceof AttributeFilterSearchControl)
- {
- attributeFilterSearchControl = (AttributeFilterSearchControl)control;
- }
- else if (control instanceof NameFilterSearchControl)
- {
- nameFilterSearchControl = (NameFilterSearchControl)control;
- }
- }
- }
-
String nameFilter = "*";
//Filter by name
- if (nameFilterSearchControl != null)
+ if (constraints != null && constraints.getFilter() != null)
{
- nameFilter = nameFilterSearchControl.getFilter();
+ nameFilter = constraints.getFilter();
}
@@ -610,9 +581,10 @@
Control[] requestControls = null;
// Sort control
- if (sortSearchControl != null)
+ if (constraints != null && constraints.isSorted())
{
//TODO: make criticallity optional
+ //TODO sort by attribute name
requestControls = new Control[]{
new SortControl(typeConfiguration.getIdAttributeName(), Control.NONCRITICAL)
};
@@ -621,11 +593,11 @@
StringBuilder af = new StringBuilder();
// Filter by attribute values
- if (attributeFilterSearchControl != null)
+ if (constraints != null && constraints.isFiltered())
{
af.append("(&");
- for (Map.Entry<String, String[]> stringEntry : attributeFilterSearchControl.getValues().entrySet())
+ for (Map.Entry<String, String[]> stringEntry : constraints.getValues().entrySet())
{
for (String value : stringEntry.getValue())
{
@@ -672,11 +644,11 @@
{
ctx = (LdapContext)res.getObject();
String dn = ctx.getNameInNamespace();
- if (sortSearchControl != null)
+ if (constraints != null && constraints.isSorted())
{
// It seams that the sort order is not configurable and
// sort control returns entries in descending order by default...
- if (!sortSearchControl.isAscending())
+ if (!constraints.isAscending())
{
objects.addFirst(createIdentityObjectInstance(invocationCtx, type, res.getAttributes(), dn));
}
@@ -718,9 +690,9 @@
}
}
- if (pageSearchControl != null)
+ if (constraints != null && constraints.isPaged())
{
- objects = (LinkedList)cutPageFromResults(objects, pageSearchControl);
+ objects = (LinkedList)cutPageFromResults(objects, constraints);
}
return objects;
@@ -732,44 +704,17 @@
}
- public Collection<IdentityObject> findIdentityObject(IdentityStoreInvocationContext ctx, IdentityObject identity, IdentityObjectRelationshipType relationshipType, boolean parent, IdentityObjectSearchControl[] controls) throws IdentityException
+ public Collection<IdentityObject> findIdentityObject(IdentityStoreInvocationContext ctx,
+ IdentityObject identity,
+ IdentityObjectRelationshipType relationshipType,
+ boolean parent,
+ IdentityObjectSearchConstraints constraints) throws IdentityException
{
//TODO: relationshipType is ignored - maybe check and allow only MEMBERSHIP?
- checkControls(controls);
-
- PageSearchControl pageSearchControl = null;
- SortByNameSearchControl sortSearchControl = null;
- AttributeFilterSearchControl attributeFilterSearchControl = null;
- NameFilterSearchControl nameFilterSearchControl = null;
-
- if (controls != null)
- {
- for (IdentityObjectSearchControl control : controls)
- {
- if (control instanceof PageSearchControl)
- {
- pageSearchControl = (PageSearchControl)control;
- }
- else if (control instanceof SortByNameSearchControl)
- {
- sortSearchControl = (SortByNameSearchControl)control;
- }
- else if (control instanceof AttributeFilterSearchControl)
- {
- attributeFilterSearchControl = (AttributeFilterSearchControl)control;
- }
- else if (control instanceof NameFilterSearchControl)
- {
- nameFilterSearchControl = (NameFilterSearchControl)control;
- }
-
- }
- }
-
LDAPIdentityObjectImpl ldapFromIO = getSafeLDAPIO(ctx, identity);
LDAPIdentityObjectTypeConfiguration typeConfig = getTypeConfiguration(ctx, identity.getIdentityType());
@@ -804,10 +749,10 @@
{
//TODO: use direct LDAP query instaed of other find method and add attributesFilter
- if (nameFilterSearchControl != null)
+ if (constraints != null && constraints.getFilter() != null)
{
String name = Tools.stripDnToName(memberRef);
- String regex = Tools.wildcardToRegex(nameFilterSearchControl.getFilter());
+ String regex = Tools.wildcardToRegex(constraints.getFilter());
if (Pattern.matches(regex, name))
{
@@ -853,9 +798,9 @@
String nameFilter = "*";
//Filter by name
- if (nameFilterSearchControl != null)
+ if (constraints != null && constraints.getFilter() != null)
{
- nameFilter = nameFilterSearchControl.getFilter();
+ nameFilter = constraints.getFilter();
}
Control[] requestControls = null;
@@ -863,11 +808,11 @@
StringBuilder af = new StringBuilder();
// Filter by attribute values
- if (attributeFilterSearchControl != null)
+ if (constraints != null && constraints.isFiltered())
{
af.append("(&");
- for (Map.Entry<String, String[]> stringEntry : attributeFilterSearchControl.getValues().entrySet())
+ for (Map.Entry<String, String[]> stringEntry : constraints.getValues().entrySet())
{
for (String value : stringEntry.getValue())
{
@@ -954,14 +899,14 @@
}
}
- if (pageSearchControl != null)
+ if (constraints != null && constraints.isPaged())
{
- objects = cutPageFromResults(objects, pageSearchControl);
+ objects = cutPageFromResults(objects, constraints);
}
- if (sortSearchControl != null)
+ if (constraints != null && constraints.isSorted())
{
- sortByName(objects, sortSearchControl.isAscending());
+ sortByName(objects, constraints.isAscending());
}
return objects;
@@ -1379,7 +1324,7 @@
throw new OperationNotSupportedException("Named relationships are not supported by this implementation of LDAP IdentityStore");
}
- public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx, IdentityObjectSearchControl[] controls) throws IdentityException, OperationNotSupportedException
+ public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx, IdentityObjectSearchConstraints controls) throws IdentityException, OperationNotSupportedException
{
throw new OperationNotSupportedException("Named relationships are not supported by this implementation of LDAP IdentityStore");
}
@@ -1389,7 +1334,7 @@
throw new OperationNotSupportedException("Named relationships are not supported by this implementation of LDAP IdentityStore");
}
- public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx, IdentityObject identity, IdentityObjectSearchControl[] controls) throws IdentityException, OperationNotSupportedException
+ public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx, IdentityObject identity, IdentityObjectSearchConstraints controls) throws IdentityException, OperationNotSupportedException
{
throw new OperationNotSupportedException("Named relationships are not supported by this implementation of LDAP IdentityStore");
@@ -2095,20 +2040,6 @@
return this.getClass().getName() + "[" + getId() +"]";
}
- private void checkControls(IdentityObjectSearchControl[] controls) throws IdentityException
- {
- if (controls != null)
- {
- for (IdentityObjectSearchControl control : controls)
- {
- if (!supportedSearchControls.contains(control.getClass()))
- {
- throw new IdentityException("IdentityObjectSearchControl not supported by this IdentityStore: " + control.getClass());
- }
- }
- }
- }
-
private void sortByName(List<IdentityObject> objects, final boolean ascending)
{
Collections.sort(objects, new Comparator<IdentityObject>(){
@@ -2127,10 +2058,10 @@
}
//TODO: dummy and inefficient temporary workaround. Need to be implemented with ldap request control
- private List<IdentityObject> cutPageFromResults(List<IdentityObject> objects, PageSearchControl pageControl)
+ private List<IdentityObject> cutPageFromResults(List<IdentityObject> objects, IdentityObjectSearchConstraints constraints)
{
List<IdentityObject> results = new LinkedList<IdentityObject>();
- for (int i = pageControl.getOffset(); i < pageControl.getOffset() + pageControl.getLimit(); i++)
+ for (int i = constraints.getFirstResult(); i < constraints.getFirstResult() + constraints.getMaxResults(); i++)
{
if (i < objects.size())
{
Modified: idm/trunk/idm/src/test/java/org/jboss/identity/idm/impl/api/ModelTestCase.java
===================================================================
--- idm/trunk/idm/src/test/java/org/jboss/identity/idm/impl/api/ModelTestCase.java 2009-03-23 03:05:44 UTC (rev 397)
+++ idm/trunk/idm/src/test/java/org/jboss/identity/idm/impl/api/ModelTestCase.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -35,7 +35,7 @@
public void testGroupId() throws Exception
{
- GroupId id = new GroupId(GroupId.PREFIX + "groupTypeName/groupName");
+ GroupId id = new GroupId(GroupId.PREFIX + GroupId.SEPARATOR + "groupTypeName" + GroupId.SEPARATOR + "groupName");
assertEquals("groupName", id.getName());
assertEquals("groupTypeName", id.getType());
Modified: idm/trunk/idm/src/test/java/org/jboss/identity/idm/impl/api/PersistenceManagerTest.java
===================================================================
--- idm/trunk/idm/src/test/java/org/jboss/identity/idm/impl/api/PersistenceManagerTest.java 2009-03-23 03:05:44 UTC (rev 397)
+++ idm/trunk/idm/src/test/java/org/jboss/identity/idm/impl/api/PersistenceManagerTest.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -26,7 +26,7 @@
import org.jboss.identity.idm.api.Group;
import org.jboss.identity.idm.api.User;
import org.jboss.identity.idm.api.IdentitySessionFactory;
-import org.jboss.identity.idm.api.IdentitySearchControl;
+import org.jboss.identity.idm.api.IdentitySearchConstraints;
import junit.framework.Assert;
@@ -131,7 +131,7 @@
id = session.getPersistenceManager().createGroupId("groupName3", PROJECT);
session.getPersistenceManager().removeGroup(id, false);
- assertEquals(0, session.getPersistenceManager().findGroup(ORGANIZATION, (IdentitySearchControl[])null).size());
+ assertEquals(0, session.getPersistenceManager().findGroup(ORGANIZATION, (IdentitySearchConstraints)null).size());
assertEquals(0, session.getPersistenceManager().findGroup(PROJECT).size());
assertEquals(0, session.getPersistenceManager().findGroup(DEPARTMENT).size());
@@ -157,7 +157,7 @@
//TODO: this should throw some meaningfull exception or simply return null
//assertNull(session.getPersistenceManager().findUser("olaf"));
- assertEquals(2, session.getPersistenceManager().findUser((IdentitySearchControl[])null).size());
+ assertEquals(2, session.getPersistenceManager().findUser((IdentitySearchConstraints)null).size());
session.getPersistenceManager().removeUser(u1, false);
@@ -167,7 +167,7 @@
assertEquals(0, session.getPersistenceManager().getUserCount());
- assertEquals(0, session.getPersistenceManager().findUser((IdentitySearchControl[])null).size());
+ assertEquals(0, session.getPersistenceManager().findUser((IdentitySearchConstraints)null).size());
session.getTransaction().commit();
Modified: idm/trunk/idm/src/test/java/org/jboss/identity/idm/impl/api/RelationshipManagerTest.java
===================================================================
--- idm/trunk/idm/src/test/java/org/jboss/identity/idm/impl/api/RelationshipManagerTest.java 2009-03-23 03:05:44 UTC (rev 397)
+++ idm/trunk/idm/src/test/java/org/jboss/identity/idm/impl/api/RelationshipManagerTest.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -26,7 +26,7 @@
import org.jboss.identity.idm.api.Group;
import org.jboss.identity.idm.api.User;
import org.jboss.identity.idm.api.IdentitySessionFactory;
-import org.jboss.identity.idm.api.IdentitySearchControl;
+import org.jboss.identity.idm.api.IdentitySearchConstraints;
import java.util.Arrays;
@@ -358,10 +358,10 @@
assertEquals(0, session.getRelationshipManager().findAssociatedUsers(group2, false, null).size());
assertEquals(1, session.getRelationshipManager().findRelatedUsers(group2, null).size());
- assertEquals(0, session.getRelationshipManager().findAssociatedGroups(user3, (IdentitySearchControl[])null).size());
+ assertEquals(0, session.getRelationshipManager().findAssociatedGroups(user3, (IdentitySearchConstraints)null).size());
assertEquals(2, session.getRelationshipManager().findRelatedGroups(user3, null, null).size());
- assertEquals(1, session.getRelationshipManager().findAssociatedGroups(user2, (IdentitySearchControl[])null).size());
+ assertEquals(1, session.getRelationshipManager().findAssociatedGroups(user2, (IdentitySearchConstraints)null).size());
assertEquals(2, session.getRelationshipManager().findRelatedGroups(user2, null, null).size());
session.getTransaction().commit();
Modified: idm/trunk/idm/src/test/java/org/jboss/identity/idm/impl/store/CommonIdentityStoreTest.java
===================================================================
--- idm/trunk/idm/src/test/java/org/jboss/identity/idm/impl/store/CommonIdentityStoreTest.java 2009-03-23 03:05:44 UTC (rev 397)
+++ idm/trunk/idm/src/test/java/org/jboss/identity/idm/impl/store/CommonIdentityStoreTest.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -25,18 +25,16 @@
import org.jboss.identity.idm.spi.model.IdentityObject;
import org.jboss.identity.idm.spi.model.IdentityObjectCredential;
import org.jboss.identity.idm.spi.model.IdentityObjectAttribute;
-import org.jboss.identity.idm.spi.searchcontrol.IdentityObjectSearchControl;
+import org.jboss.identity.idm.spi.search.IdentityObjectSearchConstraints;
+import org.jboss.identity.idm.spi.store.IdentityObjectSearchConstraintType;
import org.jboss.identity.idm.impl.api.PasswordCredential;
import org.jboss.identity.idm.impl.api.BinaryCredential;
-import org.jboss.identity.idm.impl.api.NameFilterSearchControl;
-import org.jboss.identity.idm.impl.api.SortByNameSearchControl;
-import org.jboss.identity.idm.impl.api.AttributeFilterSearchControl;
-import org.jboss.identity.idm.impl.api.PageSearchControl;
import org.jboss.identity.idm.impl.api.SimpleAttribute;
+import org.jboss.identity.idm.impl.api.IdentitySearchConstraintsImpl;
+import org.jboss.identity.idm.api.SortOrder;
import java.util.Collection;
import java.util.Map;
-import java.util.HashMap;
import java.util.Random;
import java.util.List;
@@ -372,82 +370,88 @@
IdentityObject group8 = testContext.getStore().createIdentityObject(testContext.getCtx(), "Entity3", IdentityTypeEnum.USER);
Collection<IdentityObject> results = null;
- IdentityObjectSearchControl control = null;
+ IdentityObjectSearchConstraints constraints = null;
// TODO: by RelationshipType
- if (testContext.getStore().getSupportedFeatures().isControlSupported(IdentityTypeEnum.USER, NameFilterSearchControl.class))
+ if (testContext.getStore().getSupportedFeatures().
+ isSearchConstraintTypeSupported(IdentityTypeEnum.USER, IdentityObjectSearchConstraintType.NAME_FILTER))
{
- control = new NameFilterSearchControl("*");
+ constraints = (IdentityObjectSearchConstraints)new IdentitySearchConstraintsImpl().idFilter("*");
+
results = testContext.getStore().
- findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, new IdentityObjectSearchControl[]{control});
+ findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, constraints);
assertEquals(8, results.size());
- control = new NameFilterSearchControl("D*");
+ constraints = (IdentityObjectSearchConstraints)new IdentitySearchConstraintsImpl().idFilter("D*");
results = testContext.getStore().
- findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, new IdentityObjectSearchControl[]{control});
+ findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, constraints);
assertEquals(3, results.size());
- control = new NameFilterSearchControl("*2");
+ constraints = (IdentityObjectSearchConstraints)new IdentitySearchConstraintsImpl().idFilter("*2");
results = testContext.getStore().
- findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, new IdentityObjectSearchControl[]{control});
+ findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, constraints);
assertEquals(3, results.size());
- control = new NameFilterSearchControl("*3");
+ constraints = (IdentityObjectSearchConstraints)new IdentitySearchConstraintsImpl().idFilter("*3");
results = testContext.getStore().
- findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, new IdentityObjectSearchControl[]{control});
+ findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, constraints);
assertEquals(2, results.size());
- control = new NameFilterSearchControl("Company1");
+ constraints = (IdentityObjectSearchConstraints)new IdentitySearchConstraintsImpl().idFilter("Company1");
results = testContext.getStore().
- findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, new IdentityObjectSearchControl[]{control});
+ findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, constraints);
assertEquals(1, results.size());
- control = new NameFilterSearchControl("Totoro");
+ constraints = (IdentityObjectSearchConstraints)new IdentitySearchConstraintsImpl().idFilter("Toronto");
results = testContext.getStore().
- findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, new IdentityObjectSearchControl[]{control});
+ findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, constraints);
assertEquals(0, results.size());
}
- if (testContext.getStore().getSupportedFeatures().isControlSupported(IdentityTypeEnum.USER, PageSearchControl.class))
+ if (testContext.getStore().getSupportedFeatures().
+ isSearchConstraintTypeSupported(IdentityTypeEnum.USER, IdentityObjectSearchConstraintType.PAGE))
{
- control = new PageSearchControl(0, 3);
+ constraints = (IdentityObjectSearchConstraints)new IdentitySearchConstraintsImpl().page(0, 3);
results = testContext.getStore().
- findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, new IdentityObjectSearchControl[]{control});
+ findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, constraints);
assertEquals(3, results.size());
- control = new PageSearchControl(2, 2);
+ constraints = (IdentityObjectSearchConstraints)new IdentitySearchConstraintsImpl().page(2, 2);
+
results = testContext.getStore().
- findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, new IdentityObjectSearchControl[]{control});
+ findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, constraints);
assertEquals(2, results.size());
}
- if (testContext.getStore().getSupportedFeatures().isControlSupported(IdentityTypeEnum.USER, SortByNameSearchControl.class))
+ if (testContext.getStore().getSupportedFeatures().
+ isSearchConstraintTypeSupported(IdentityTypeEnum.USER, IdentityObjectSearchConstraintType.SORT))
{
- control = new SortByNameSearchControl(true);
+ constraints = (IdentityObjectSearchConstraints)new IdentitySearchConstraintsImpl().sort(SortOrder.ASCENDING);
+
results = testContext.getStore().
- findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, new IdentityObjectSearchControl[]{control});
+ findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, constraints);
assertEquals(8, results.size());
@@ -457,10 +461,11 @@
// And reverse order
- control = new SortByNameSearchControl(false);
+ constraints = (IdentityObjectSearchConstraints)new IdentitySearchConstraintsImpl().sort(SortOrder.DESCENDING);
+
results = testContext.getStore().
- findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, new IdentityObjectSearchControl[]{control});
+ findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, constraints);
assertEquals(8, results.size());
@@ -473,22 +478,25 @@
// Combine controls to check that the results are diffrent for pagination
- if (testContext.getStore().getSupportedFeatures().isControlSupported(IdentityTypeEnum.USER, PageSearchControl.class))
+ if (testContext.getStore().getSupportedFeatures().
+ isSearchConstraintTypeSupported(IdentityTypeEnum.USER, IdentityObjectSearchConstraintType.PAGE))
{
- control = new SortByNameSearchControl(true);
- IdentityObjectSearchControl control2 = new PageSearchControl(0, 3);
+ constraints = (IdentityObjectSearchConstraints)new IdentitySearchConstraintsImpl().sort(SortOrder.ASCENDING).page(0,3);
+
+
+
results = testContext.getStore().
- findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, new IdentityObjectSearchControl[]{control, control2});
+ findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, constraints);
assertEquals(3, results.size());
assertEquals("Company1", ((List<IdentityObject>)results).get(0).getName());
assertEquals("Division1", ((List<IdentityObject>)results).get(2).getName());
- control2 = new PageSearchControl(3, 1);
+ constraints = (IdentityObjectSearchConstraints)new IdentitySearchConstraintsImpl().sort(SortOrder.ASCENDING).page(3,1);
results = testContext.getStore().
- findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, new IdentityObjectSearchControl[]{control, control2});
+ findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, constraints);
assertEquals(1, results.size());
@@ -499,21 +507,23 @@
}
- if (testContext.getStore().getSupportedFeatures().isControlSupported(IdentityTypeEnum.USER, AttributeFilterSearchControl.class))
+ if (testContext.getStore().getSupportedFeatures().
+ isSearchConstraintTypeSupported(IdentityTypeEnum.USER, IdentityObjectSearchConstraintType.ATTRIBUTE_FILTER))
{
- Map<String, String[]> attrs = new HashMap<String, String[]>();
- attrs.put("phone", new String[] {"777 777 777"});
- attrs.put("description", new String[] {"sample desc"});
IdentityObjectAttribute phone = new SimpleAttribute("phone", new String[] {"777 777 777"});
IdentityObjectAttribute description = new SimpleAttribute("description", new String[] {"sample desc"});
testContext.getStore().addAttributes(testContext.getCtx(), group1, new IdentityObjectAttribute[]{phone, description});
- control = new AttributeFilterSearchControl(attrs);
+ constraints = (IdentityObjectSearchConstraints)new IdentitySearchConstraintsImpl()
+ .attributeValuesFilter("phone", new String[] {"777 777 777"})
+ .attributeValuesFilter("description", new String[] {"sample desc"});
+
+
results = testContext.getStore().
- findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, new IdentityObjectSearchControl[]{control});
+ findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, constraints);
assertEquals(1, results.size());
Added: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchConstraintType.java
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchConstraintType.java (rev 0)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchConstraintType.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -0,0 +1,38 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+
+package org.jboss.identity.idm.api;
+
+
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public enum IdentitySearchConstraintType
+{
+ SORT,
+ PAGE,
+ NAME_FILTER,
+ ATTRIBUTE_FILTER
+}
Added: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchConstraints.java
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchConstraints.java (rev 0)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchConstraints.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -0,0 +1,43 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.api;
+
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface IdentitySearchConstraints
+{
+
+ IdentitySearchConstraints sort(SortOrder order) throws UnsupportedConstraint;
+
+ IdentitySearchConstraints sortAttributeName(String name) throws UnsupportedConstraint;
+
+ IdentitySearchConstraints page(int firstResult, int maxResults) throws UnsupportedConstraint;
+
+ IdentitySearchConstraints attributeValuesFilter(String attributeName, String[] attributeValue) throws UnsupportedConstraint;
+
+ IdentitySearchConstraints idFilter(String filter) throws UnsupportedConstraint;
+
+}
Deleted: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchControl.java
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchControl.java 2009-03-23 03:05:44 UTC (rev 397)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchControl.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -1,33 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-
-package org.jboss.identity.idm.api;
-
-/**
- * IdentitySearchControl enables to add additional constraints to the results of operations on identity objects
- *
- * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
- * @version : 0.1 $
- */
-public interface IdentitySearchControl
-{
-}
Added: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchCriteria.java
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchCriteria.java (rev 0)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchCriteria.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -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.idm.api;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface IdentitySearchCriteria
+{
+
+
+
+}
Modified: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/PersistenceManager.java
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/PersistenceManager.java 2009-03-23 03:05:44 UTC (rev 397)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/PersistenceManager.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -46,7 +46,9 @@
*/
PersistenceManagerFeaturesDescription getFeaturesDescription();
+ IdentitySearchConstraints createIdentitySearchConstraints();
+
// Create
/**
@@ -151,7 +153,7 @@
* @return
* @throws IdentityException
*/
- Collection<User> findUser(IdentitySearchControl[] controls) throws IdentityException;
+ Collection<User> findUser(IdentitySearchConstraints controls) throws IdentityException;
// Search Groups
@@ -182,7 +184,7 @@
* @return
* @throws IdentityException
*/
- Collection<Group> findGroup(String groupType, IdentitySearchControl[] controls) throws IdentityException;
+ Collection<Group> findGroup(String groupType, IdentitySearchConstraints controls) throws IdentityException;
/**
*
Modified: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/PersistenceManagerFeaturesDescription.java
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/PersistenceManagerFeaturesDescription.java 2009-03-23 03:05:44 UTC (rev 397)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/PersistenceManagerFeaturesDescription.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -48,34 +48,18 @@
/**
* Check if control can be used in Identity search methods
*
- * @param control
+ * @param constraint
* @return
*/
- boolean isUsersSearchControlSupported(IdentitySearchControl control);
+ boolean isUsersSearchConstraintTypeSupported(IdentitySearchConstraintType constraint);
/**
- * Check if control can be used in Identity search methods
- *
- * @param controlClazz
- * @return
- */
- boolean isUsersSearchControlSupported(Class<?> controlClazz);
-
- /**
* Check if control can be used in Group search methods
*
* @param groupType
- * @param control
+ * @param constraint
* @return
*/
- boolean isGroupsSearchControlSupported(String groupType, IdentitySearchControl control);
+ boolean isGroupsSearchConstraintTypeSupported(String groupType, IdentitySearchConstraintType constraint);
- /**
- * Check if control can be used in Group search methods
- *
- * @param groupType
- * @param controlClazz
- * @return
- */
- boolean isGroupsSearchControlSupported(String groupType, Class<?> controlClazz);
}
\ No newline at end of file
Modified: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RelationshipManager.java
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RelationshipManager.java 2009-03-23 03:05:44 UTC (rev 397)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RelationshipManager.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -45,6 +45,8 @@
*/
RelationshipManagerFeaturesDescription getFeaturesDescription();
+ IdentitySearchConstraints createIdentitySearchConstraints();
+
// Assignation
/**
@@ -306,7 +308,7 @@
String groupType,
boolean parent,
boolean inherited,
- IdentitySearchControl[] controls) throws IdentityException;
+ IdentitySearchConstraints controls) throws IdentityException;
/**
* Find groups that are associated with given group.
@@ -326,7 +328,7 @@
String groupType,
boolean parent,
boolean inherited,
- IdentitySearchControl[] controls) throws IdentityException;
+ IdentitySearchConstraints controls) throws IdentityException;
/**
* Find all groups that given identity is associated with.
@@ -348,7 +350,7 @@
*/
Collection<Group> findAssociatedGroups(User user,
String groupType,
- IdentitySearchControl[] controls) throws IdentityException;
+ IdentitySearchConstraints controls) throws IdentityException;
/**
* Find all groups that given identity is associated with.
@@ -360,7 +362,7 @@
*/
Collection<Group> findAssociatedGroups(String userId,
String groupType,
- IdentitySearchControl[] controls) throws IdentityException;
+ IdentitySearchConstraints controls) throws IdentityException;
/**
* Find all groups that given identity is associated with.
@@ -370,7 +372,7 @@
* @throws org.jboss.identity.idm.exception.IdentityException
*/
Collection<Group> findAssociatedGroups(User user,
- IdentitySearchControl[] controls) throws IdentityException;
+ IdentitySearchConstraints controls) throws IdentityException;
/**
* Find all groups that given identity is associated with.
@@ -380,7 +382,7 @@
* @throws org.jboss.identity.idm.exception.IdentityException
*/
Collection<Group> findAssociatedGroups(String userId,
- IdentitySearchControl[] controls) throws IdentityException;
+ IdentitySearchConstraints controls) throws IdentityException;
/**
* Find all groups that given identity is associated with.
@@ -412,7 +414,7 @@
*/
Collection<User> findAssociatedUsers(Group group,
boolean inherited,
- IdentitySearchControl[] controls) throws IdentityException;
+ IdentitySearchConstraints controls) throws IdentityException;
/**
* Find identities that have relationship with given parent group.
@@ -424,7 +426,7 @@
*/
Collection<User> findAssociatedUsers(String groupId,
boolean inherited,
- IdentitySearchControl[] controls) throws IdentityException;
+ IdentitySearchConstraints controls) throws IdentityException;
/**
@@ -437,7 +439,7 @@
*/
Collection<Group> findRelatedGroups(User user,
String groupType,
- IdentitySearchControl[] controls) throws IdentityException;
+ IdentitySearchConstraints controls) throws IdentityException;
/**
* Find all groups that given identity is associated with. Will return groups connected with a given user with a role
@@ -449,7 +451,7 @@
*/
Collection<Group> findRelatedGroups(String userId,
String groupType,
- IdentitySearchControl[] controls) throws IdentityException;
+ IdentitySearchConstraints controls) throws IdentityException;
/**
* Find identities that have relationship with given parent group. Will return users connected with a given group with a role
@@ -458,7 +460,7 @@
* @return
* @throws org.jboss.identity.idm.exception.IdentityException
*/
- Collection<User> findRelatedUsers(Group group, IdentitySearchControl[] controls) throws IdentityException;
+ Collection<User> findRelatedUsers(Group group, IdentitySearchConstraints controls) throws IdentityException;
/**
* Find identities that have relationship with given parent group. Will return users connected with a given group with a role
@@ -467,7 +469,7 @@
* @return
* @throws org.jboss.identity.idm.exception.IdentityException
*/
- Collection<User> findRelatedUsers(String groupId, IdentitySearchControl[] controls) throws IdentityException;
+ Collection<User> findRelatedUsers(String groupId, IdentitySearchConstraints controls) throws IdentityException;
}
Modified: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RelationshipManagerFeaturesDescription.java
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RelationshipManagerFeaturesDescription.java 2009-03-23 03:05:44 UTC (rev 397)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RelationshipManagerFeaturesDescription.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -49,34 +49,18 @@
/**
* Check if control can be used in Identity search methods
*
- * @param control
+ * @param constraint
* @return
*/
- boolean isIdentitiesSearchControlSupported(IdentitySearchControl control);
+ boolean isIdentitiesSearchConstraintTypeSupported(IdentitySearchConstraintType constraint);
/**
- * Check if control can be used in Identity search methods
- *
- * @param controlClazz
- * @return
- */
- boolean isIdentitiesSearchControlSupported(Class<?> controlClazz);
-
- /**
* Check if control can be used in Group search methods
*
* @param groupType
- * @param control
+ * @param constraintType
* @return
*/
- boolean isGroupsSearchControlSupported(String groupType, IdentitySearchControl control);
+ boolean isGroupsSearchConstraintTypeSupported(String groupType, IdentitySearchConstraintType constraintType);
- /**
- * Check if control can be used in Group search methods
- *
- * @param groupType
- * @param controlClazz
- * @return
- */
- boolean isGroupsSearchControlSupported(String groupType, Class<?> controlClazz);
}
\ No newline at end of file
Modified: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RoleManager.java
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RoleManager.java 2009-03-23 03:05:44 UTC (rev 397)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RoleManager.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -46,6 +46,8 @@
*/
RoleManagerFeaturesDescription getSupportedFeatures();
+ IdentitySearchConstraints createIdentitySearchConstraints();
+
// RoleType
/**
@@ -83,7 +85,7 @@
* @return
* @throws IdentityException
*/
- Collection<RoleType> findRoleTypes(IdentitySearchControl[] controls) throws IdentityException;
+ Collection<RoleType> findRoleTypes(IdentitySearchConstraints controls) throws IdentityException;
// Role
@@ -160,7 +162,7 @@
* @throws IdentityException
*/
Collection<RoleType> findRoleTypes(User user, Group group,
- IdentitySearchControl[] controls) throws IdentityException;
+ IdentitySearchConstraints controls) throws IdentityException;
/**
* Find RoleType objects for roles associated with a given User and Group
@@ -170,7 +172,7 @@
* @throws IdentityException
*/
Collection<RoleType> findRoleTypes(String userId, String groupId,
- IdentitySearchControl[] controls) throws IdentityException;
+ IdentitySearchConstraints controls) throws IdentityException;
/**
* Find RoleType objects for roles associated with a given User and Group
@@ -195,7 +197,7 @@
* @return
* @throws IdentityException
*/
- Collection<RoleType> findUserRoleTypes(User user, IdentitySearchControl[] controls) throws IdentityException;
+ Collection<RoleType> findUserRoleTypes(User user, IdentitySearchConstraints controls) throws IdentityException;
/**
* Find RoleType objects for roles associated with a given Identity
@@ -203,7 +205,7 @@
* @return
* @throws IdentityException
*/
- Collection<RoleType> findUserRoleTypes(String userId, IdentitySearchControl[] controls) throws IdentityException;
+ Collection<RoleType> findUserRoleTypes(String userId, IdentitySearchConstraints controls) throws IdentityException;
/**
* Find RoleType objects for roles associated with a given Group
@@ -220,7 +222,7 @@
* @throws IdentityException
*/
Collection<RoleType> findGroupRoleTypes(Group group,
- IdentitySearchControl[] controls) throws IdentityException;
+ IdentitySearchConstraints controls) throws IdentityException;
/**
* Find RoleType objects for roles associated with a given Group
@@ -229,7 +231,7 @@
* @throws IdentityException
*/
Collection<RoleType> findGroupRoleTypes(String groupId,
- IdentitySearchControl[] controls) throws IdentityException;
+ IdentitySearchConstraints controls) throws IdentityException;
/**
* Find all Groups with which User has a Role association
@@ -240,7 +242,7 @@
* @throws IdentityException
*/
Collection<Group> findGroupsWithRelatedRole(User user,
- IdentitySearchControl[] controls) throws IdentityException;
+ IdentitySearchConstraints controls) throws IdentityException;
/**
* Find all Groups with which User has a Role association
@@ -251,7 +253,7 @@
* @throws IdentityException
*/
Collection<Group> findGroupsWithRelatedRole(String userId,
- IdentitySearchControl[] controls) throws IdentityException;
+ IdentitySearchConstraints controls) throws IdentityException;
/**
@@ -264,7 +266,7 @@
*/
Collection<Group> findGroupsWithRelatedRole(User user,
String groupType,
- IdentitySearchControl[] controls) throws IdentityException;
+ IdentitySearchConstraints controls) throws IdentityException;
/**
* Find all Groups with which User has a Role association
@@ -276,7 +278,7 @@
*/
Collection<Group> findGroupsWithRelatedRole(String userId,
String groupType,
- IdentitySearchControl[] controls) throws IdentityException;
+ IdentitySearchConstraints controls) throws IdentityException;
/**
* Find Role objects with a given RoleType associated with a given IdentityType
Modified: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RoleManagerFeaturesDescription.java
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RoleManagerFeaturesDescription.java 2009-03-23 03:05:44 UTC (rev 397)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RoleManagerFeaturesDescription.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -37,14 +37,8 @@
boolean isRoleTypeAddRemoveSupported();
/**
- * @param controlClazz
+ * @param constraintType
* @return
*/
- boolean isRoleTypeSearchControlSupported(Class<?> controlClazz);
-
- /**
- * @param control
- * @return
- */
- boolean isRoleTypeSearchControlSupported(IdentitySearchControl control);
+ boolean isRoleTypeSearchConstraintTypeSupported(IdentitySearchConstraintType constraintType);
}
\ No newline at end of file
Added: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/SortOrder.java
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/SortOrder.java (rev 0)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/SortOrder.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -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.idm.api;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public enum SortOrder
+{
+ ASCENDING,
+ DESCENDING
+
+}
Added: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/UnsupportedConstraint.java
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/UnsupportedConstraint.java (rev 0)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/UnsupportedConstraint.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -0,0 +1,50 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.api;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class UnsupportedConstraint extends Exception
+{
+ public UnsupportedConstraint()
+ {
+ super();
+ }
+
+ public UnsupportedConstraint(String message)
+ {
+ super(message);
+ }
+
+ public UnsupportedConstraint(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public UnsupportedConstraint(Throwable cause)
+ {
+ super(cause);
+ }
+}
Modified: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/GroupQuery.java
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/GroupQuery.java 2009-03-23 03:05:44 UTC (rev 397)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/GroupQuery.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -24,8 +24,10 @@
import org.jboss.identity.idm.api.Group;
import org.jboss.identity.idm.api.User;
+import org.jboss.identity.idm.api.SortOrder;
import java.util.Collection;
+import java.util.List;
/**
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
@@ -34,10 +36,16 @@
public interface GroupQuery extends Query
{
+ Collection<Group> execute() throws QueryException;
+
+ Group uniqueResult() throws QueryException;
+
+ List<Group> list() throws QueryException;
+
GroupQuery setId(String id);
GroupQuery setNameAndType(String name, String type);
-
+
GroupQuery setName(String name);
GroupQuery setType(String type);
@@ -70,8 +78,14 @@
GroupQuery addRelatedUser(String id);
- GroupQuery sort(QuerySortOrder order) throws UnsupportedQueryConstraint;
+ GroupQuery sort(SortOrder order) throws UnsupportedQueryConstraint;
+ GroupQuery sortAttributeName(String name) throws UnsupportedQueryConstraint;
+
GroupQuery page(int firstResult, int maxResults) throws UnsupportedQueryConstraint;
+ GroupQuery attributeValuesFilter(String attributeName, String[] attributeValue) throws UnsupportedQueryConstraint;
+
+
+
}
Modified: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/Query.java
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/Query.java 2009-03-23 03:05:44 UTC (rev 397)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/Query.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -32,10 +32,6 @@
public interface Query
{
- Collection execute() throws QueryException;
-
- Object singleResult() throws QueryException;
-
- List list() throws QueryException;
+
}
Modified: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/RoleQuery.java
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/RoleQuery.java 2009-03-23 03:05:44 UTC (rev 397)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/RoleQuery.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -26,7 +26,11 @@
import org.jboss.identity.idm.api.Group;
import org.jboss.identity.idm.api.RoleType;
import org.jboss.identity.idm.api.IdentityType;
+import org.jboss.identity.idm.api.Role;
+import java.util.Collection;
+import java.util.List;
+
/**
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
* @version : 0.1 $
@@ -34,6 +38,12 @@
public interface RoleQuery extends Query
{
+ Collection<Role> execute() throws QueryException;
+
+ Role uniqueResult() throws QueryException;
+
+ List<Role> list() throws QueryException;
+
RoleQuery setUser(User user);
RoleQuery setUser(String id);
Modified: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/UserQuery.java
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/UserQuery.java 2009-03-23 03:05:44 UTC (rev 397)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/UserQuery.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -23,8 +23,11 @@
package org.jboss.identity.idm.api.query;
import org.jboss.identity.idm.api.Group;
+import org.jboss.identity.idm.api.User;
+import org.jboss.identity.idm.api.SortOrder;
import java.util.Collection;
+import java.util.List;
/**
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
@@ -32,7 +35,12 @@
*/
public interface UserQuery extends Query
{
+ Collection<User> execute() throws QueryException;
+ User uniqueResult() throws QueryException;
+
+ List<User> list() throws QueryException;
+
UserQuery withUserId(String id);
UserQuery addAssociatedGroup(Group group);
@@ -59,8 +67,12 @@
UserQuery addRelatedGroupsIds(Collection<String> ids);
- UserQuery sort(QuerySortOrder order) throws UnsupportedQueryConstraint;
+ UserQuery sort(SortOrder order) throws UnsupportedQueryConstraint;
+ UserQuery sortAttributeName(String name) throws UnsupportedQueryConstraint;
+
UserQuery page(int firstResult, int maxResults) throws UnsupportedQueryConstraint;
+ UserQuery attributeValuesFilter(String attributeName, String[] attributeValue) throws UnsupportedQueryConstraint;
+
}
Added: idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/search/IdentityObjectSearchConstraints.java
===================================================================
--- idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/search/IdentityObjectSearchConstraints.java (rev 0)
+++ idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/search/IdentityObjectSearchConstraints.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -0,0 +1,50 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.spi.search;
+
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface IdentityObjectSearchConstraints
+{
+ boolean isSorted();
+
+ boolean isAscending();
+
+ String getSortAttributeName();
+
+ boolean isPaged();
+
+ int getFirstResult();
+
+ int getMaxResults();
+
+ boolean isFiltered();
+
+ String getFilter();
+
+ Map<String, String[]> getValues();
+}
Modified: idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/FeaturesMetaData.java
===================================================================
--- idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/FeaturesMetaData.java 2009-03-23 03:05:44 UTC (rev 397)
+++ idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/FeaturesMetaData.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -26,7 +26,6 @@
import org.jboss.identity.idm.spi.model.IdentityObjectType;
import org.jboss.identity.idm.spi.model.IdentityObjectRelationshipType;
import org.jboss.identity.idm.spi.model.IdentityObjectCredentialType;
-import org.jboss.identity.idm.spi.searchcontrol.IdentityObjectSearchControl;
import org.jboss.identity.idm.exception.IdentityException;
/**
@@ -57,34 +56,19 @@
/**
*
* @param identityObjectType
- * @param control
+ * @param storeSearchConstraint
* @return
*/
- boolean isControlSupported(IdentityObjectType identityObjectType, IdentityObjectSearchControl control);
+ boolean isSearchConstraintTypeSupported(IdentityObjectType identityObjectType, IdentityObjectSearchConstraintType storeSearchConstraint);
/**
- *
- * @param identityObjectType
- * @param controlClazz
- * @return
- */
- boolean isControlSupported(IdentityObjectType identityObjectType, Class<?> controlClazz);
-
- /**
*
- * @param control
+ * @param constraint
* @return
*/
- boolean isRoleNameControlSupported(IdentityObjectSearchControl control);
+ boolean isRoleNameSearchConstraintSupported(IdentityObjectSearchConstraintType constraint);
/**
- *
- * @param controlClazz
- * @return
- */
- boolean isRoleNameControlSupported(Class<?> controlClazz);
-
- /**
* @return set of identity types that can be persisted
*/
Set<String> getSupportedIdentityObjectTypes();
Added: idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/IdentityObjectSearchConstraintType.java
===================================================================
--- idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/IdentityObjectSearchConstraintType.java (rev 0)
+++ idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/IdentityObjectSearchConstraintType.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -0,0 +1,36 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+
+package org.jboss.identity.idm.spi.store;/**
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public enum IdentityObjectSearchConstraintType
+{
+ SORT,
+ PAGE,
+ NAME_FILTER,
+ ATTRIBUTE_FILTER
+}
Modified: idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/IdentityStore.java
===================================================================
--- idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/IdentityStore.java 2009-03-23 03:05:44 UTC (rev 397)
+++ idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/IdentityStore.java 2009-03-23 19:20:55 UTC (rev 398)
@@ -34,7 +34,7 @@
import org.jboss.identity.idm.spi.configuration.metadata.IdentityStoreConfigurationMetaData;
import org.jboss.identity.idm.spi.configuration.IdentityStoreConfigurationContext;
import org.jboss.identity.idm.spi.model.IdentityObjectCredential;
-import org.jboss.identity.idm.spi.searchcontrol.IdentityObjectSearchControl;
+import org.jboss.identity.idm.spi.search.IdentityObjectSearchConstraints;
import org.jboss.identity.idm.exception.IdentityException;
/**
@@ -151,7 +151,7 @@
*/
Collection<IdentityObject> findIdentityObject(IdentityStoreInvocationContext invocationCtx,
IdentityObjectType identityType,
- IdentityObjectSearchControl[] controls) throws IdentityException;
+ IdentityObjectSearchConstraints controls) throws IdentityException;
/**
* Find identites that have relationship with given identity. Relationships are directional (from parent to child).
*
@@ -167,7 +167,7 @@
Collection<IdentityObject> findIdentityObject(IdentityStoreInvocationContext invocationCxt, IdentityObject identity,
IdentityObjectRelationshipType relationshipType,
boolean parent,
- IdentityObjectSearchControl[] controls) throws IdentityException;
+ IdentityObjectSearchConstraints controls) throws IdentityException;
@@ -282,7 +282,7 @@
* @throws OperationNotSupportedException
*/
Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx,
- IdentityObjectSearchControl[] controls) throws IdentityException, OperationNotSupportedException;
+ IdentityObjectSearchConstraints controls) throws IdentityException, OperationNotSupportedException;
/**
@@ -296,7 +296,7 @@
*/
Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx,
IdentityObject identity,
- IdentityObjectSearchControl[] controls) throws IdentityException, OperationNotSupportedException;
+ IdentityObjectSearchConstraints controls) throws IdentityException, OperationNotSupportedException;
// Credentials
15 years, 1 month
JBoss Identity SVN: r397 - identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/factories.
by jboss-identity-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2009-03-22 23:05:44 -0400 (Sun, 22 Mar 2009)
New Revision: 397
Modified:
identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/factories/JBossSAMLAuthnResponseFactory.java
Log:
JBID-67: saml response needs issueInstant
Modified: identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/factories/JBossSAMLAuthnResponseFactory.java
===================================================================
--- identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/factories/JBossSAMLAuthnResponseFactory.java 2009-03-22 03:32:13 UTC (rev 396)
+++ identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/factories/JBossSAMLAuthnResponseFactory.java 2009-03-23 03:05:44 UTC (rev 397)
@@ -145,6 +145,8 @@
//IssueInstant
responseType.setIssueInstant(issueInstant);
+ if(assertionType.getIssueInstant() == null)
+ assertionType.setIssueInstant(issueInstant);
responseType.getAssertionOrEncryptedAssertion().add(assertionType);
return responseType;
15 years, 1 month
JBoss Identity SVN: r396 - identity-federation/trunk/identity-bindings/src/test/java/org/jboss/test/identity/federation/bindings/servlets.
by jboss-identity-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2009-03-21 23:32:13 -0400 (Sat, 21 Mar 2009)
New Revision: 396
Modified:
identity-federation/trunk/identity-bindings/src/test/java/org/jboss/test/identity/federation/bindings/servlets/InteropEndpointDebugTestCase.java
Log:
fix test
Modified: identity-federation/trunk/identity-bindings/src/test/java/org/jboss/test/identity/federation/bindings/servlets/InteropEndpointDebugTestCase.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/test/java/org/jboss/test/identity/federation/bindings/servlets/InteropEndpointDebugTestCase.java 2009-03-22 03:31:26 UTC (rev 395)
+++ identity-federation/trunk/identity-bindings/src/test/java/org/jboss/test/identity/federation/bindings/servlets/InteropEndpointDebugTestCase.java 2009-03-22 03:32:13 UTC (rev 396)
@@ -52,9 +52,9 @@
*/
public class InteropEndpointDebugTestCase extends TestCase
{
- //String endpoint = null;
+ String endpoint = null;
//String endpoint = "http://interop.demo.jboss.com/test/SOAPServlet";
- String endpoint = "http://localhost:8080/test/SOAPServlet";
+ //String endpoint = "http://localhost:8080/test/SOAPServlet";
public void AtestUseCase1() throws Exception
{
15 years, 1 month
JBoss Identity SVN: r395 - in identity-federation/trunk/identity-bindings/src: test/java/org/jboss/test/identity/federation/bindings/servlets and 1 other directories.
by jboss-identity-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2009-03-21 23:31:26 -0400 (Sat, 21 Mar 2009)
New Revision: 395
Modified:
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/servlets/SOAPSAMLXACMLServlet.java
identity-federation/trunk/identity-bindings/src/test/java/org/jboss/test/identity/federation/bindings/servlets/InteropEndpointDebugTestCase.java
identity-federation/trunk/identity-bindings/src/test/resources/xacml/requests/soap-request.xml
Log:
JBID-66: servlet init params
Modified: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/servlets/SOAPSAMLXACMLServlet.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/servlets/SOAPSAMLXACMLServlet.java 2009-03-22 02:54:29 UTC (rev 394)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/servlets/SOAPSAMLXACMLServlet.java 2009-03-22 03:31:26 UTC (rev 395)
@@ -29,7 +29,6 @@
import java.security.PrivilegedExceptionAction;
import javax.servlet.ServletConfig;
-import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@@ -85,22 +84,21 @@
boolean debug = false;
- public void init() throws ServletException
- {
- ServletContext servletContext = getServletContext();
- issuerId = servletContext.getInitParameter("issuerID");
+ public void init(ServletConfig config) throws ServletException
+ {
+ issuerId = config.getInitParameter("issuerID");
if(issuerId == null)
issuerId = "issue-id:1";
- issuer = servletContext.getInitParameter("issuer");
+ issuer = config.getInitParameter("issuer");
if(issuer == null)
issuer = "urn:jboss-identity";
- policyConfigFileName = servletContext.getInitParameter("policyConfigFileName");
+ policyConfigFileName = config.getInitParameter("policyConfigFileName");
if(policyConfigFileName == null)
policyConfigFileName = "policyConfig.xml";
- String debugStr = servletContext.getInitParameter("debug");
+ String debugStr = config.getInitParameter("debug");
try
{
debug = Boolean.parseBoolean(debugStr);
@@ -110,6 +108,7 @@
debug = false;
}
+ log.trace("Issuer=" + issuer + " :: issuerID=" + issuerId);
log.trace("PolicyConfig File:" + policyConfigFileName);
log.trace("Debug="+debug);
@@ -117,13 +116,8 @@
{
SecurityActions.setSystemProperty("jaxb.debug", "true");
}
- super.init();
+ super.init(config);
}
-
- public void init(ServletConfig config) throws ServletException
- {
- super.init(config);
- }
@SuppressWarnings("unchecked")
Modified: identity-federation/trunk/identity-bindings/src/test/java/org/jboss/test/identity/federation/bindings/servlets/InteropEndpointDebugTestCase.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/test/java/org/jboss/test/identity/federation/bindings/servlets/InteropEndpointDebugTestCase.java 2009-03-22 02:54:29 UTC (rev 394)
+++ identity-federation/trunk/identity-bindings/src/test/java/org/jboss/test/identity/federation/bindings/servlets/InteropEndpointDebugTestCase.java 2009-03-22 03:31:26 UTC (rev 395)
@@ -22,6 +22,7 @@
package org.jboss.test.identity.federation.bindings.servlets;
import java.io.InputStream;
+import java.net.URI;
import java.net.URL;
import java.net.URLConnection;
@@ -51,11 +52,11 @@
*/
public class InteropEndpointDebugTestCase extends TestCase
{
- String endpoint = null;
- // String endpoint = "http://interop.demo.jboss.com/test/SOAPServlet";
- //String endpoint = "http://localhost:8080/test/SOAPServlet";
+ //String endpoint = null;
+ //String endpoint = "http://interop.demo.jboss.com/test/SOAPServlet";
+ String endpoint = "http://localhost:8080/test/SOAPServlet";
- public void testUseCase1() throws Exception
+ public void AtestUseCase1() throws Exception
{
if(endpoint != null)
{
@@ -65,7 +66,7 @@
}
}
- public void testUseCase2() throws Exception
+ public void BtestUseCase2() throws Exception
{
if(endpoint != null)
{
@@ -75,8 +76,29 @@
}
}
- public void testSAMLXACML() throws Exception
+ public void testHimss() throws Exception
{
+ if(endpoint != null)
+ {
+ JAXBElement<?> jb = getResponse("xacml/requests/himss-soap-request.xml");
+ Envelope env = (Envelope) jb.getValue();
+ Marshaller marshaller = SOAPSAMLXACMLUtil.getMarshaller();
+ marshaller.setProperty( Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE );
+ marshaller.marshal(jb, System.out);
+
+ check(env, false);
+ }
+ }
+
+ public void BtestA() throws Exception
+ {
+ String u = "http://www.w3.org/2001/XMLSchema#string";
+ URI uri = new URI("http://www.w3.org/2001/XMLSchema#string");
+ assertEquals(uri.toString(),u);
+ }
+
+ public void CtestSAMLXACML() throws Exception
+ {
//Read the saml request from the file
ClassLoader tcl = Thread.currentThread().getContextClassLoader();
InputStream is = tcl.getResourceAsStream("xacml/requests/samlxacml.xml");
@@ -105,8 +127,7 @@
AssertionType at = (AssertionType) responseType.getAssertionOrEncryptedAssertion().get(0);
XACMLAuthzDecisionStatementType xst = (XACMLAuthzDecisionStatementType) at.getStatementOrAuthnStatementOrAuthzDecisionStatement().get(0);
ResultType rt = xst.getResponse().getResult().get(0);
- DecisionType dt = rt.getDecision();
- assertEquals(DecisionType.PERMIT, dt);
+ DecisionType dt = rt.getDecision();
if(permit)
assertEquals(DecisionType.PERMIT, dt);
Modified: identity-federation/trunk/identity-bindings/src/test/resources/xacml/requests/soap-request.xml
===================================================================
--- identity-federation/trunk/identity-bindings/src/test/resources/xacml/requests/soap-request.xml 2009-03-22 02:54:29 UTC (rev 394)
+++ identity-federation/trunk/identity-bindings/src/test/resources/xacml/requests/soap-request.xml 2009-03-22 03:31:26 UTC (rev 395)
@@ -1,8 +1,17 @@
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"><soap-env:Body>
-<samlp:RequestAbstract xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xsi:type="xacml-samlp:XACMLAuthzDecisionQuery" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xacml-samlp="urn:oasis:xacml:2.0:saml:protocol:schema:os" xacml-samlp:InputContextOnly="true" xacml-samlp:ReturnContext="true" ID="s292657a1c39f12d36dd1f1ba2cf834bb2ebad825c" Version="2.0" IssueInstant="2009-03-16T19:01:52Z" Destination="destination-uri" Consent="consent-uri">
+<samlp:RequestAbstract xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
+xsi:type="xacml-samlp:XACMLAuthzDecisionQueryType"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xmlns:xacml-samlp="urn:oasis:xacml:2.0:saml:protocol:schema:os"
+xacml-samlp:InputContextOnly="true" xacml-samlp:ReturnContext="true"
+ID="s292657a1c39f12d36dd1f1ba2cf834bb2ebad825c" Version="2.0"
+IssueInstant="2009-03-16T19:01:52Z" Destination="destination-uri" Consent="consent-uri">
<saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">vaPepEntity</saml:Issuer>
<xacml-context:Request
- xmlns="urn:oasis:names:tc:xacml:2.0:context:schema:os" xmlns:xacml-context="urn:oasis:names:tc:xacml:2.0:context:schema:os" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance/" xsi:schemaLocation="urn:oasis:names:tc:xacml:2.0:context:schema:os http://docs.oasis-open.org/xacml/access_control-xacml-2.0-context-schema-...">
+ xmlns="urn:oasis:names:tc:xacml:2.0:context:schema:os"
+ xmlns:xacml-context="urn:oasis:names:tc:xacml:2.0:context:schema:os"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance/"
+ xsi:schemaLocation="urn:oasis:names:tc:xacml:2.0:context:schema:os http://docs.oasis-open.org/xacml/access_control-xacml-2.0-context-schema-...">
<Subject SubjectCategory="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject">
<Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id" DataType="http://www.w3.org/2001/XMLSchema#string" >
<AttributeValue>Doctor,Bob</AttributeValue>
15 years, 1 month
JBoss Identity SVN: r394 - identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/servlets.
by jboss-identity-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2009-03-21 22:54:29 -0400 (Sat, 21 Mar 2009)
New Revision: 394
Modified:
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/servlets/SOAPSAMLXACMLServlet.java
Log:
JBID-65: id, version and issueInstant on assertion
Modified: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/servlets/SOAPSAMLXACMLServlet.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/servlets/SOAPSAMLXACMLServlet.java 2009-03-22 02:51:39 UTC (rev 393)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/servlets/SOAPSAMLXACMLServlet.java 2009-03-22 02:54:29 UTC (rev 394)
@@ -43,6 +43,7 @@
import org.apache.log4j.Logger;
import org.jboss.identity.federation.api.saml.v2.common.IDGenerator;
import org.jboss.identity.federation.api.saml.v2.response.SAML2Response;
+import org.jboss.identity.federation.core.saml.v2.constants.JBossSAMLConstants;
import org.jboss.identity.federation.core.saml.v2.factories.SAMLAssertionFactory;
import org.jboss.identity.federation.core.saml.v2.factories.SOAPFactory;
import org.jboss.identity.federation.core.saml.v2.holders.IssuerInfoHolder;
@@ -159,10 +160,9 @@
}
else
if(samlRequest instanceof Element)
- {
- log.trace("Problem in the input file: Working on the element.");
+ {
Element elem = (Element) samlRequest;
- xacmlRequest = SOAPSAMLXACMLUtil.getWorkaround(elem);
+ xacmlRequest = SOAPSAMLXACMLUtil.getXACMLQueryType(elem);
}
}
else if(element instanceof XACMLAuthzDecisionQueryType)
@@ -191,13 +191,17 @@
//Place the xacml statement in an assertion
//Then the assertion goes inside a SAML Response
+ String ID = IDGenerator.create("ID_");
SAML2Response saml2Response = new SAML2Response();
IssuerInfoHolder issuerInfo = new IssuerInfoHolder(this.issuer);
AssertionType assertion = SAMLAssertionFactory.getObjectFactory().createAssertionType();
assertion.getStatementOrAuthnStatementOrAuthzDecisionStatement().add(xacmlStatement);
+ assertion.setID(ID);
+ assertion.setVersion(JBossSAMLConstants.VERSION_2_0.get());
+ assertion.setIssuer(issuerInfo.getIssuer());
- JAXBElement<?> jaxbResponse = JAXBElementMappingUtil.get(saml2Response.createResponseType(IDGenerator.create("ID_"), issuerInfo, assertion));
+ JAXBElement<?> jaxbResponse = JAXBElementMappingUtil.get(saml2Response.createResponseType(ID, issuerInfo, assertion));
//Create a SOAP Envelope to hold the SAML response
envelope = this.createEnvelope(jaxbResponse);
15 years, 1 month
JBoss Identity SVN: r393 - identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/util.
by jboss-identity-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2009-03-21 22:51:39 -0400 (Sat, 21 Mar 2009)
New Revision: 393
Modified:
identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/util/SOAPSAMLXACMLUtil.java
Log:
parse the xacml query
Modified: identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/util/SOAPSAMLXACMLUtil.java
===================================================================
--- identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/util/SOAPSAMLXACMLUtil.java 2009-03-20 13:57:54 UTC (rev 392)
+++ identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/util/SOAPSAMLXACMLUtil.java 2009-03-22 02:51:39 UTC (rev 393)
@@ -68,20 +68,23 @@
}
/**
- * When the input xacml request has issues, try to work around
- * @param element
+ * Parse the XACML Authorization Decision Query from the Dom Element
+ * @param samlRequest
* @return
* @throws Exception
*/
- public static XACMLAuthzDecisionQueryType getWorkaround(Element element) throws Exception
+ public static XACMLAuthzDecisionQueryType getXACMLQueryType(Element samlRequest) throws Exception
{
- String str = DocumentUtil.getDOMElementAsString(element);
- str = str.replaceFirst(":XACMLAuthzDecisionQuery", ":XACMLAuthzDecisionQueryType");
- str = str.replaceFirst("xacml-context:Request", "xacml-context:Request xmlns=\"urn:oasis:names:tc:xacml:2.0:context:schema:os\"" );
- log.trace("Updated Element="+str);
- //Reparse
- JAXBElement<?> jx = (JAXBElement<?>) getUnmarshaller().unmarshal(new StringReader(str));
- return (XACMLAuthzDecisionQueryType) jx.getValue();
+ //We reparse it because the document may have issues with namespaces
+ String elementString = DocumentUtil.getDOMElementAsString(samlRequest);
+ Unmarshaller um = SOAPSAMLXACMLUtil.getUnmarshaller();
+ um.setEventHandler(new javax.xml.bind.helpers.DefaultValidationEventHandler());
+
+ JAXBElement<?> obj = (JAXBElement<?>) um.unmarshal(new StringReader(elementString));
+ Object xacmlObject = obj.getValue();
+ if(xacmlObject instanceof XACMLAuthzDecisionQueryType == false)
+ throw new RuntimeException("Unsupported type:" + xacmlObject);
+ return (XACMLAuthzDecisionQueryType)xacmlObject;
}
public static XACMLAuthzDecisionStatementType createXACMLAuthzDecisionStatementType()
15 years, 1 month
JBoss Identity SVN: r392 - in idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api: query and 1 other directory.
by jboss-identity-commits@lists.jboss.org
Author: bdaw
Date: 2009-03-20 09:57:54 -0400 (Fri, 20 Mar 2009)
New Revision: 392
Added:
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/GroupQuery.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/Query.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/QueryException.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/QuerySortOrder.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/RoleQuery.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/UnsupportedQueryConstraint.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/UserQuery.java
Log:
Query API proposition
Added: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/GroupQuery.java
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/GroupQuery.java (rev 0)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/GroupQuery.java 2009-03-20 13:57:54 UTC (rev 392)
@@ -0,0 +1,77 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.api.query;
+
+import org.jboss.identity.idm.api.Group;
+import org.jboss.identity.idm.api.User;
+
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface GroupQuery extends Query
+{
+
+ GroupQuery setId(String id);
+
+ GroupQuery setNameAndType(String name, String type);
+
+ GroupQuery setName(String name);
+
+ GroupQuery setType(String type);
+
+ GroupQuery addAssociatedGroup(Group group, boolean parent);
+
+ GroupQuery addAssociatedGroup(String id, boolean parent);
+
+ GroupQuery addAssociatedGroups(Collection<Group> groups, boolean parent);
+
+ GroupQuery addAssociatedGroupsIds(Collection<String> ids, boolean parent);
+
+ GroupQuery addAssociatedUser(User user);
+
+ GroupQuery addAssociatedUser(String id);
+
+ GroupQuery addAssociatedUsers(Collection<User> users);
+
+ GroupQuery addAssociatedUsersIds(Collection<String> ids);
+
+ GroupQuery addUserConnectedByRole(User user);
+
+ GroupQuery addUserConnectedByRole(String id);
+
+ GroupQuery addUsersConnectedByRole(Collection<User> users);
+
+ GroupQuery addUsersIdsConnectedByRole(Collection<String> ids);
+
+ GroupQuery addRelatedUser(User user);
+
+ GroupQuery addRelatedUser(String id);
+
+ GroupQuery sort(QuerySortOrder order) throws UnsupportedQueryConstraint;
+
+ GroupQuery page(int firstResult, int maxResults) throws UnsupportedQueryConstraint;
+
+}
Added: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/Query.java
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/Query.java (rev 0)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/Query.java 2009-03-20 13:57:54 UTC (rev 392)
@@ -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.idm.api.query;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface Query
+{
+
+ Collection execute() throws QueryException;
+
+ Object singleResult() throws QueryException;
+
+ List list() throws QueryException;
+
+}
Added: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/QueryException.java
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/QueryException.java (rev 0)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/QueryException.java 2009-03-20 13:57:54 UTC (rev 392)
@@ -0,0 +1,50 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.api.query;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class QueryException extends Exception
+{
+ public QueryException()
+ {
+ super();
+ }
+
+ public QueryException(String message)
+ {
+ super(message);
+ }
+
+ public QueryException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public QueryException(Throwable cause)
+ {
+ super(cause);
+ }
+}
Added: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/QuerySortOrder.java
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/QuerySortOrder.java (rev 0)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/QuerySortOrder.java 2009-03-20 13:57:54 UTC (rev 392)
@@ -0,0 +1,37 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+
+package org.jboss.identity.idm.api.query;/**
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public enum QuerySortOrder
+{
+
+ ASCENDING,
+
+ DESCENDING;
+
+}
Added: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/RoleQuery.java
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/RoleQuery.java (rev 0)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/RoleQuery.java 2009-03-20 13:57:54 UTC (rev 392)
@@ -0,0 +1,53 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.api.query;
+
+import org.jboss.identity.idm.api.User;
+import org.jboss.identity.idm.api.Group;
+import org.jboss.identity.idm.api.RoleType;
+import org.jboss.identity.idm.api.IdentityType;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface RoleQuery extends Query
+{
+
+ RoleQuery setUser(User user);
+
+ RoleQuery setUser(String id);
+
+ RoleQuery setGroup(Group group);
+
+ RoleQuery setGroup(String id);
+
+ RoleQuery setRoleType(RoleType roleType);
+
+ RoleQuery setRoleType(String string);
+
+ RoleQuery setIdentityType(IdentityType identityType);
+
+ RoleQuery setIdentityTypeId(String id);
+
+}
Added: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/UnsupportedQueryConstraint.java
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/UnsupportedQueryConstraint.java (rev 0)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/UnsupportedQueryConstraint.java 2009-03-20 13:57:54 UTC (rev 392)
@@ -0,0 +1,51 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.api.query;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class UnsupportedQueryConstraint extends QueryException
+{
+
+ public UnsupportedQueryConstraint()
+ {
+ super();
+ }
+
+ public UnsupportedQueryConstraint(String message)
+ {
+ super(message);
+ }
+
+ public UnsupportedQueryConstraint(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public UnsupportedQueryConstraint(Throwable cause)
+ {
+ super(cause);
+ }
+}
Added: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/UserQuery.java
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/UserQuery.java (rev 0)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/UserQuery.java 2009-03-20 13:57:54 UTC (rev 392)
@@ -0,0 +1,66 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.api.query;
+
+import org.jboss.identity.idm.api.Group;
+
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface UserQuery extends Query
+{
+
+ UserQuery withUserId(String id);
+
+ UserQuery addAssociatedGroup(Group group);
+
+ UserQuery addAssociatedGroup(String id);
+
+ UserQuery addAssociatedGroups(Collection<Group> groups);
+
+ UserQuery addAssociatedGroupsIds(Collection<String> groups);
+
+ UserQuery addGroupConnectedWithRole(Group group);
+
+ UserQuery addGroupConnectedWithRole(String id);
+
+ UserQuery addGroupsConnectedWithRole(Collection<Group> groups);
+
+ UserQuery addGroupsIdsConnectedWithRole(Collection<String> groups);
+
+ UserQuery addRelatedGroup(Group group);
+
+ UserQuery addRelatedGroup(String id);
+
+ UserQuery addRelatedGroups(Collection<Group> group);
+
+ UserQuery addRelatedGroupsIds(Collection<String> ids);
+
+ UserQuery sort(QuerySortOrder order) throws UnsupportedQueryConstraint;
+
+ UserQuery page(int firstResult, int maxResults) throws UnsupportedQueryConstraint;
+
+}
15 years, 1 month
JBoss Identity SVN: r391 - in idm/trunk: assembly and 6 other directories.
by jboss-identity-commits@lists.jboss.org
Author: bdaw
Date: 2009-03-19 19:12:38 -0400 (Thu, 19 Mar 2009)
New Revision: 391
Modified:
idm/trunk/assembly/pom.xml
idm/trunk/example/maven2/pom.xml
idm/trunk/idm-api/pom.xml
idm/trunk/idm-common/pom.xml
idm/trunk/idm-spi/pom.xml
idm/trunk/idm/pom.xml
idm/trunk/parent/pom.xml
idm/trunk/pom.xml
Log:
back to snapshot
Modified: idm/trunk/assembly/pom.xml
===================================================================
--- idm/trunk/assembly/pom.xml 2009-03-19 22:02:17 UTC (rev 390)
+++ idm/trunk/assembly/pom.xml 2009-03-19 23:12:38 UTC (rev 391)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.identity</groupId>
<artifactId>idm-parent</artifactId>
- <version>1.0.0.Alpha3</version>
+ <version>1.0.0-SNAPSHOT</version>
<relativePath>../parent</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: idm/trunk/example/maven2/pom.xml
===================================================================
--- idm/trunk/example/maven2/pom.xml 2009-03-19 22:02:17 UTC (rev 390)
+++ idm/trunk/example/maven2/pom.xml 2009-03-19 23:12:38 UTC (rev 391)
@@ -1,7 +1,7 @@
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.identity</groupId>
- <version>1.0.0.Alpha3</version>
+ <version>1.0.0-SNAPSHOT</version>
<artifactId>idm-maven2-example</artifactId>
<packaging>jar</packaging>
<name>JBoss Identity IDM Maven2 example project</name>
Modified: idm/trunk/idm/pom.xml
===================================================================
--- idm/trunk/idm/pom.xml 2009-03-19 22:02:17 UTC (rev 390)
+++ idm/trunk/idm/pom.xml 2009-03-19 23:12:38 UTC (rev 391)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.identity</groupId>
<artifactId>idm-parent</artifactId>
- <version>1.0.0.Alpha3</version>
+ <version>1.0.0-SNAPSHOT</version>
<relativePath>../parent</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: idm/trunk/idm-api/pom.xml
===================================================================
--- idm/trunk/idm-api/pom.xml 2009-03-19 22:02:17 UTC (rev 390)
+++ idm/trunk/idm-api/pom.xml 2009-03-19 23:12:38 UTC (rev 391)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.identity</groupId>
<artifactId>idm-parent</artifactId>
- <version>1.0.0.Alpha3</version>
+ <version>1.0.0-SNAPSHOT</version>
<relativePath>../parent</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: idm/trunk/idm-common/pom.xml
===================================================================
--- idm/trunk/idm-common/pom.xml 2009-03-19 22:02:17 UTC (rev 390)
+++ idm/trunk/idm-common/pom.xml 2009-03-19 23:12:38 UTC (rev 391)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.identity</groupId>
<artifactId>idm-parent</artifactId>
- <version>1.0.0.Alpha3</version>
+ <version>1.0.0-SNAPSHOT</version>
<relativePath>../parent</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: idm/trunk/idm-spi/pom.xml
===================================================================
--- idm/trunk/idm-spi/pom.xml 2009-03-19 22:02:17 UTC (rev 390)
+++ idm/trunk/idm-spi/pom.xml 2009-03-19 23:12:38 UTC (rev 391)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.identity</groupId>
<artifactId>idm-parent</artifactId>
- <version>1.0.0.Alpha3</version>
+ <version>1.0.0-SNAPSHOT</version>
<relativePath>../parent</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: idm/trunk/parent/pom.xml
===================================================================
--- idm/trunk/parent/pom.xml 2009-03-19 22:02:17 UTC (rev 390)
+++ idm/trunk/parent/pom.xml 2009-03-19 23:12:38 UTC (rev 391)
@@ -8,7 +8,7 @@
<groupId>org.jboss.identity</groupId>
<artifactId>idm-parent</artifactId>
<packaging>pom</packaging>
- <version>1.0.0.Alpha3</version>
+ <version>1.0.0-SNAPSHOT</version>
<name>JBoss Identity IDM- Parent</name>
<url>http://labs.jboss.org/portal/jbosssecurity/</url>
<description>JBoss Identity is a cross-cutting project that handles identity needs for the JEMS projects</description>
Modified: idm/trunk/pom.xml
===================================================================
--- idm/trunk/pom.xml 2009-03-19 22:02:17 UTC (rev 390)
+++ idm/trunk/pom.xml 2009-03-19 23:12:38 UTC (rev 391)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.identity</groupId>
<artifactId>idm-parent</artifactId>
- <version>1.0.0.Alpha3</version>
+ <version>1.0.0-SNAPSHOT</version>
<relativePath>parent</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
15 years, 1 month