Author: bdaw
Date: 2008-06-18 09:21:20 -0400 (Wed, 18 Jun 2008)
New Revision: 11078
Added:
modules/identity/trunk/idm/src/main/java/org/jboss/idm/FeaturesDescription.java
modules/identity/trunk/idm/src/main/java/org/jboss/idm/IdentityRepository.java
modules/identity/trunk/idm/src/main/java/org/jboss/idm/Session.java
modules/identity/trunk/idm/src/main/java/org/jboss/idm/generic/model/
modules/identity/trunk/idm/src/main/java/org/jboss/idm/generic/model/GroupEntity.java
modules/identity/trunk/idm/src/main/java/org/jboss/idm/generic/model/GroupIdentityStore.java
modules/identity/trunk/idm/src/main/java/org/jboss/idm/generic/model/Relationship.java
modules/identity/trunk/idm/src/main/java/org/jboss/idm/generic/model/UserEntity.java
modules/identity/trunk/idm/src/main/java/org/jboss/portal/identity/api/Capabilities.java
modules/identity/trunk/idm/src/main/java/org/jboss/portal/identity/api/Session.java
Removed:
modules/identity/trunk/idm/src/main/java/org/jboss/idm/generic/model/GroupEntity.java
modules/identity/trunk/idm/src/main/java/org/jboss/idm/generic/model/GroupIdentityStore.java
modules/identity/trunk/idm/src/main/java/org/jboss/idm/generic/model/Relationship.java
modules/identity/trunk/idm/src/main/java/org/jboss/idm/generic/model/UserEntity.java
modules/identity/trunk/idm/src/main/java/org/jboss/idm/model/
Modified:
modules/identity/trunk/idm/src/main/java/org/jboss/idm/IdentityStore.java
modules/identity/trunk/idm/src/main/java/org/jboss/portal/identity/api/IdentityModule.java
Log:
small refactoring
Added: modules/identity/trunk/idm/src/main/java/org/jboss/idm/FeaturesDescription.java
===================================================================
--- modules/identity/trunk/idm/src/main/java/org/jboss/idm/FeaturesDescription.java
(rev 0)
+++
modules/identity/trunk/idm/src/main/java/org/jboss/idm/FeaturesDescription.java 2008-06-18
13:21:20 UTC (rev 11078)
@@ -0,0 +1,114 @@
+/*
+* 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.idm;
+
+import org.jboss.idm.exceptions.IdentityTypeNotSupportedException;
+import org.jboss.idm.exceptions.IdmException;
+
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface FeaturesDescription
+{
+ /**
+ * Operations related to the base set of methods in IdentityStore interface
+ */
+ public enum OperationType implements IdentityOperationType
+ {
+
+ // createIdentity
+ create,
+
+ // removeIdentity
+ remove,
+
+ // updateAttribute, updateAttributes, addAttributes
+ updateAttributes,
+
+ // resolveRelationships
+ resolveRelationships,
+
+ // createRelationship
+ modifyRelationships,
+
+ // pagination in findIdentities
+ paginatedSearch,
+
+ // ordering in findIdentities
+ orderedSearch;
+
+
+ public String getName()
+ {
+ return this.name();
+ }
+ }
+
+ /**
+ * @param identityType
+ * @return supported operations for given identity type
+ * @throws org.jboss.idm.exceptions.IdentityTypeNotSupportedException
+ */
+ public Set<IdentityOperationType> getSupportedOperations(IdentityType
identityType) throws IdentityTypeNotSupportedException;
+
+ /**
+ * @param operationType
+ * @param identityType
+ * @return if given operation on given identity type is supported
+ * @throws IdentityTypeNotSupportedException
+ */
+ boolean isOperationSupported(IdentityOperationType operationType, IdentityType
identityType) throws IdentityTypeNotSupportedException;
+
+ /**
+ * @param operationType
+ * @return set of identity types that can be processed with a given operation
+ * @throws org.jboss.idm.exceptions.IdmException
+ */
+ public Set<IdentityType> getSupportedIdentities(IdentityOperationType
operationType);
+
+ /**
+ * @return set of identity types that can be persisted
+ */
+ Set<IdentityType> getSupportedIdentities();
+
+ /**
+ * @param identityType
+ * @return boolean describing if given identity type can be persisted or retrieved
using this identity store
+ */
+ boolean isIdentitySupported(IdentityType identityType);
+
+ /**
+ * @param fromType
+ * @param toType
+ * @param relationshipType
+ * @return true is given relationship can be persisted or retrieved
+ * @throws org.jboss.idm.exceptions.IdmException
+ */
+ boolean isRelationshipSupported(IdentityType fromType, IdentityType toType,
RelationshipType relationshipType) throws IdmException;
+
+
+
+}
Added: modules/identity/trunk/idm/src/main/java/org/jboss/idm/IdentityRepository.java
===================================================================
--- modules/identity/trunk/idm/src/main/java/org/jboss/idm/IdentityRepository.java
(rev 0)
+++
modules/identity/trunk/idm/src/main/java/org/jboss/idm/IdentityRepository.java 2008-06-18
13:21:20 UTC (rev 11078)
@@ -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.idm;
+
+/**
+ *
+ *
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface IdentityRepository
+{
+
+ Session createSession();
+
+ FeaturesDescription getSupportedFeatures();
+
+}
Modified: modules/identity/trunk/idm/src/main/java/org/jboss/idm/IdentityStore.java
===================================================================
--- modules/identity/trunk/idm/src/main/java/org/jboss/idm/IdentityStore.java 2008-06-18
09:26:13 UTC (rev 11077)
+++ modules/identity/trunk/idm/src/main/java/org/jboss/idm/IdentityStore.java 2008-06-18
13:21:20 UTC (rev 11078)
@@ -37,40 +37,8 @@
*/
public interface IdentityStore
{
- /**
- * Operations related to the base set of methods in IdentityStore interface
- */
- public enum OperationType implements IdentityOperationType
- {
- // createIdentity
- create,
- // removeIdentity
- remove,
-
- // updateAttribute, updateAttributes, addAttributes
- updateAttributes,
-
- // resolveRelationships
- resolveRelationships,
-
- // createRelationship
- modifyRelationships,
-
- // pagination in findIdentities
- paginatedSearch,
-
- // ordering in findIdentities
- orderedSearch;
-
-
- public String getName()
- {
- return this.name();
- }
- }
-
// Informations about identity store and its capabilities
/**
@@ -78,50 +46,13 @@
*/
String getId();
- /**
- * @param identityType
- * @return supported operations for given identity type
- * @throws IdentityTypeNotSupportedException
- */
- public Set<IdentityOperationType> getSupportedOperations(IdentityType
identityType) throws IdentityTypeNotSupportedException;
/**
- * @param operationType
- * @param identityType
- * @return if given operation on given identity type is supported
- * @throws IdentityTypeNotSupportedException
+ * @return FeaturesDescription object describing what operation are supported by this
store
*/
- boolean isOperationSupported(IdentityOperationType operationType, IdentityType
identityType) throws IdentityTypeNotSupportedException;
+ FeaturesDescription getSupportedFeatures();
- /**
- * @param operationType
- * @return set of identity types that can be processed by this identity store with a
given operation
- * @throws IdmException
- */
- public Set<IdentityType> getSupportedIdentities(IdentityOperationType
operationType);
- /**
- * @return set of identity types that can be persisted in this store
- */
- Set<IdentityType> getSupportedIdentities();
-
- /**
- * @param identityType
- * @return boolean describing if given identity type can be persisted or retrieved
using this identity store
- */
- boolean isIdentitySupported(IdentityType identityType);
-
- /**
- * @param fromType
- * @param toType
- * @param relationshipType
- * @return true is given relationship can be persisted or retrieved using this
identity store
- * @throws IdmException
- */
- boolean isRelationshipSupported(IdentityType fromType, IdentityType toType,
RelationshipType relationshipType) throws IdmException;
-
-
-
// Operations
/**
Added: modules/identity/trunk/idm/src/main/java/org/jboss/idm/Session.java
===================================================================
--- modules/identity/trunk/idm/src/main/java/org/jboss/idm/Session.java
(rev 0)
+++ modules/identity/trunk/idm/src/main/java/org/jboss/idm/Session.java 2008-06-18
13:21:20 UTC (rev 11078)
@@ -0,0 +1,241 @@
+/*
+* 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.idm;
+
+import org.jboss.idm.exceptions.IdmException;
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface Session
+{
+
+ /**
+ * Close this session
+ */
+ void close() throws IdmException;
+
+ /**
+ * Save all pending changes
+ */
+ void save() throws IdmException;
+
+ /**
+ * Clear this session
+ */
+ void clear() throws IdmException;
+
+ /**
+ * Check if this session is open
+ * @return
+ */
+ boolean isOpen();
+
+ /**
+ * @return IdentityRepository this session was created for
+ */
+ IdentityRepository getRepository();
+
+
+ // Operations
+
+ /**
+ * Create new identity with a given name
+ *
+ * @param name
+ * @return
+ * @throws org.jboss.idm.exceptions.IdmException
+ */
+ Identity createIdentity(String name) throws IdmException;
+
+ /**
+ * Remove given identity
+ *
+ * @param identity
+ * @throws IdmException
+ */
+ void removeIdentity(Identity identity) throws IdmException;
+
+ /**
+ * @param identityType
+ * @return a number of stored identities with a given type
+ * @throws IdmException
+ */
+ int getIdentitiesCount(IdentityType identityType) throws IdmException;
+
+ /**
+ * Find identity with a given name
+ *
+ * @param name
+ * @return
+ * @throws IdmException
+ */
+ Identity findIdentity(String name) throws IdmException;
+
+ /**
+ * Find identity with a given id
+ *
+ * @param id
+ * @return
+ * @throws IdmException
+ */
+ Identity findIdentity(Object id) throws IdmException;
+
+ /**
+ * Find identities with a given type paginated and ordered. If the paginatedSearch or
orderedSearch operations
+ * are not supported in this store implementation, dedicated parameters will take no
effect
+ *
+ * @param identityType
+ * @param offset
+ * @param limit 0 means unlimited page size
+ * @param orderedByAttributeName can be null
+ * @param ascending default true
+ * @return
+ * @throws IdmException
+ */
+ Collection<Identity> findIdentities(IdentityType identityType,
+ int offset, int limit,
+ String orderedByAttributeName, boolean ascending)
throws IdmException;
+
+ /**
+ * Find identities with a given attributes values. If the paginatedSearch or
orderedSearch operations
+ * are not supported in this store implementation, dedicated parameters will take no
effect
+ *
+ * @param identityType
+ * @param attributes
+ * @param offset
+ * @param limit 0 means unlimited page size
+ * @param orderedByAttributeName can be null
+ * @param ascending default true
+ * @return
+ * @throws IdmException
+ */
+ Collection<Identity> findIdentities(IdentityType identityType, Map<String,
String[]> attributes,
+ int offset, int limit,
+ String orderedByAttributeName, boolean ascending)
throws IdmException;
+
+ /**
+ * Find identites that have relationship with given identity. Relationships are
directional (from parent to child).
+ * If the paginatedSearch or orderedSearch operations
+ * are not supported in this store implementation, dedicated parameters will take no
effect
+ *
+ * @param identity
+ * @param relationshipType
+ * @param parent defines if given identity is parent or child side in the relationship
- default is true (parent)
+ * @param offset
+ * @param limit 0 means unlimited page size
+ * @param orderedByAttributeName can be null
+ * @param ascending default true
+ * @return
+ * @throws IdmException
+ */
+ Collection<Identity> findIdentities(Identity identity, RelationshipType
relationshipType, boolean parent,
+ int offset, int limit,
+ String orderedByAttributeName, boolean ascending)
throws IdmException;
+
+ /**
+ * @param identityType
+ * @return names of supported attributes
+ * @throws IdmException
+ */
+ Set<String> getSupportedAttributeNames(IdentityType identityType) throws
IdmException;
+
+ /**
+ * Get attributes for the given identity
+ *
+ * @param identity
+ * @return
+ * @throws IdmException
+ */
+ Map<String, String[]> getAttributes(Identity identity) throws IdmException;
+
+ /**
+ * Update attributes with new values - previous values will be overwritten
+ * @param identity
+ * @param attributes
+ * @throws IdmException
+ */
+ void updateAttributes(Identity identity, Map<String, String[]> attributes)
throws IdmException;
+
+ /**
+ * Add new attributes - if attribute with given name already exists the values will be
appended
+ *
+ * @param identity
+ * @param attributes
+ * @throws org.jboss.idm.exceptions.IdmException
+ */
+ void addAttributes(Identity identity, Map<String, String[]> attributes) throws
IdmException;
+
+ /**
+ * Remove attributes
+ *
+ * @param identity
+ * @param attributes
+ */
+ void removeAttributes(Identity identity, Set<String> attributes) throws
IdmException;
+
+ /**
+ * Create directional relationship of a given type between identities
+ *
+ * @param fromIdentity
+ * @param toIdentity
+ * @param relationshipType
+ * @throws IdmException
+ */
+ void createRelationship(Identity fromIdentity, Identity toIdentity, RelationshipType
relationshipType) throws IdmException;
+
+ /**
+ * Remove relationship between identities. Relationships can be directional so order
of parameters matters
+ *
+ * @param fromIdentity
+ * @param toIdentity
+ * @param relationshipType
+ * @throws IdmException
+ */
+ void removeRelationship(Identity fromIdentity, Identity toIdentity, RelationshipType
relationshipType) throws IdmException;
+
+ /**
+ * Remove all relationships between identities. Direction of relationships doesn't
matter - all active relationships
+ * will be removed
+ *
+ * @param identity1
+ * @param identity2
+ * @throws IdmException
+ */
+ void removeRelationships(Identity identity1, Identity identity2) throws IdmException;
+
+ /**
+ * Resolve relationship types between two identities. Relationships can be directional
so order of parameters matters
+ *
+ * @param fromIdentity
+ * @param toIdentity
+ * @return
+ * @throws IdmException
+ */
+ Set<RelationshipType> resolveRelationships(Identity fromIdentity, Identity
toIdentity) throws IdmException;
+}
Copied: modules/identity/trunk/idm/src/main/java/org/jboss/idm/generic/model (from rev
11052, modules/identity/trunk/idm/src/main/java/org/jboss/idm/model)
Deleted:
modules/identity/trunk/idm/src/main/java/org/jboss/idm/generic/model/GroupEntity.java
===================================================================
---
modules/identity/trunk/idm/src/main/java/org/jboss/idm/model/GroupEntity.java 2008-06-13
23:50:28 UTC (rev 11052)
+++
modules/identity/trunk/idm/src/main/java/org/jboss/idm/generic/model/GroupEntity.java 2008-06-18
13:21:20 UTC (rev 11078)
@@ -1,52 +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.idm.model;
-
-import org.jboss.idm.IdentityType;
-
-import java.util.Map;
-import java.util.Collection;
-
-/**
- * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
- * @version : 0.1 $
- */
-public interface GroupEntity
-{
- Object getId();
-
- String getName();
-
- IdentityType getType();
-
- Map<String, String[]> getAttributes();
-
- Object getParentId();
-
- Collection<Relationship> getFromRelations();
-
- Collection<Relationship> getToRelations();
-
- Collection<UserEntity> getUserEntities();
-
-}
Copied:
modules/identity/trunk/idm/src/main/java/org/jboss/idm/generic/model/GroupEntity.java
(from rev 11077,
modules/identity/trunk/idm/src/main/java/org/jboss/idm/model/GroupEntity.java)
===================================================================
--- modules/identity/trunk/idm/src/main/java/org/jboss/idm/generic/model/GroupEntity.java
(rev 0)
+++
modules/identity/trunk/idm/src/main/java/org/jboss/idm/generic/model/GroupEntity.java 2008-06-18
13:21:20 UTC (rev 11078)
@@ -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.idm.generic.model;
+
+import org.jboss.idm.IdentityType;
+import org.jboss.idm.Identity;
+
+import java.util.Map;
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface GroupEntity extends Identity
+{
+ Object getId();
+
+ String getName();
+
+ IdentityType getType();
+
+ Map<String, String[]> getAttributes();
+
+ Object getParentId();
+
+ Collection<Relationship> getFromRelations();
+
+ Collection<Relationship> getToRelations();
+
+ Collection<UserEntity> getUserEntities();
+
+}
Deleted:
modules/identity/trunk/idm/src/main/java/org/jboss/idm/generic/model/GroupIdentityStore.java
===================================================================
---
modules/identity/trunk/idm/src/main/java/org/jboss/idm/model/GroupIdentityStore.java 2008-06-13
23:50:28 UTC (rev 11052)
+++
modules/identity/trunk/idm/src/main/java/org/jboss/idm/generic/model/GroupIdentityStore.java 2008-06-18
13:21:20 UTC (rev 11078)
@@ -1,46 +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.idm.model;
-
-import org.jboss.idm.IdentityStore;
-import org.jboss.idm.IdentityType;
-
-import java.util.Set;
-
-/**
- * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
- * @version : 0.1 $
- */
-public interface GroupIdentityStore extends IdentityStore
-{
-
- boolean isUserStore();
-
- boolean supportExternalGroupRelationships();
-
-
- // TODO: Set of needed methods
-
- // TODO: Mechanism for extensions and dynamic discovery of supported extended
operations
-
-}
Copied:
modules/identity/trunk/idm/src/main/java/org/jboss/idm/generic/model/GroupIdentityStore.java
(from rev 11077,
modules/identity/trunk/idm/src/main/java/org/jboss/idm/model/GroupIdentityStore.java)
===================================================================
---
modules/identity/trunk/idm/src/main/java/org/jboss/idm/generic/model/GroupIdentityStore.java
(rev 0)
+++
modules/identity/trunk/idm/src/main/java/org/jboss/idm/generic/model/GroupIdentityStore.java 2008-06-18
13:21:20 UTC (rev 11078)
@@ -0,0 +1,42 @@
+/*
+* 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.idm.generic.model;
+
+import org.jboss.idm.IdentityStore;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface GroupIdentityStore extends IdentityStore
+{
+
+ boolean isUserStore();
+
+ boolean supportExternalGroupRelationships();
+
+
+ // TODO: Set of needed methods
+
+
+}
Deleted:
modules/identity/trunk/idm/src/main/java/org/jboss/idm/generic/model/Relationship.java
===================================================================
---
modules/identity/trunk/idm/src/main/java/org/jboss/idm/model/Relationship.java 2008-06-13
23:50:28 UTC (rev 11052)
+++
modules/identity/trunk/idm/src/main/java/org/jboss/idm/generic/model/Relationship.java 2008-06-18
13:21:20 UTC (rev 11078)
@@ -1,39 +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.idm.model;
-
-import org.jboss.idm.RelationshipType;
-
-/**
- * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
- * @version : 0.1 $
- */
-public interface Relationship
-{
- GroupEntity getFrom();
-
- GroupEntity getTo();
-
- RelationshipType getType();
-
-}
Copied:
modules/identity/trunk/idm/src/main/java/org/jboss/idm/generic/model/Relationship.java
(from rev 11077,
modules/identity/trunk/idm/src/main/java/org/jboss/idm/model/Relationship.java)
===================================================================
---
modules/identity/trunk/idm/src/main/java/org/jboss/idm/generic/model/Relationship.java
(rev 0)
+++
modules/identity/trunk/idm/src/main/java/org/jboss/idm/generic/model/Relationship.java 2008-06-18
13:21:20 UTC (rev 11078)
@@ -0,0 +1,40 @@
+/*
+* 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.idm.generic.model;
+
+import org.jboss.idm.RelationshipType;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface Relationship
+{
+
+ GroupEntity getFrom();
+
+ GroupEntity getTo();
+
+ RelationshipType getType();
+
+}
Deleted:
modules/identity/trunk/idm/src/main/java/org/jboss/idm/generic/model/UserEntity.java
===================================================================
---
modules/identity/trunk/idm/src/main/java/org/jboss/idm/model/UserEntity.java 2008-06-13
23:50:28 UTC (rev 11052)
+++
modules/identity/trunk/idm/src/main/java/org/jboss/idm/generic/model/UserEntity.java 2008-06-18
13:21:20 UTC (rev 11078)
@@ -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.idm.model;
-
-import java.util.Map;
-import java.util.Collection;
-
-/**
- * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
- * @version : 0.1 $
- */
-public interface UserEntity
-{
-
- Object getId();
-
- String getUserName();
-
- Map<String, String[]> getAttributes();
-
- Collection<GroupEntity> getGroupEntities();
-
-}
\ No newline at end of file
Copied:
modules/identity/trunk/idm/src/main/java/org/jboss/idm/generic/model/UserEntity.java (from
rev 11077, modules/identity/trunk/idm/src/main/java/org/jboss/idm/model/UserEntity.java)
===================================================================
--- modules/identity/trunk/idm/src/main/java/org/jboss/idm/generic/model/UserEntity.java
(rev 0)
+++
modules/identity/trunk/idm/src/main/java/org/jboss/idm/generic/model/UserEntity.java 2008-06-18
13:21:20 UTC (rev 11078)
@@ -0,0 +1,45 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.idm.generic.model;
+
+import org.jboss.idm.Identity;
+
+import java.util.Map;
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface UserEntity extends Identity
+{
+
+ Object getId();
+
+ String getUserName();
+
+ Map<String, String[]> getAttributes();
+
+ Collection<GroupEntity> getGroupEntities();
+
+}
\ No newline at end of file
Added:
modules/identity/trunk/idm/src/main/java/org/jboss/portal/identity/api/Capabilities.java
===================================================================
---
modules/identity/trunk/idm/src/main/java/org/jboss/portal/identity/api/Capabilities.java
(rev 0)
+++
modules/identity/trunk/idm/src/main/java/org/jboss/portal/identity/api/Capabilities.java 2008-06-18
13:21:20 UTC (rev 11078)
@@ -0,0 +1,78 @@
+/*
+* 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.portal.identity.api;
+
+import org.jboss.idm.exceptions.IdentityTypeNotSupportedException;
+
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface Capabilities
+{
+
+ /**
+ * Operations related to the base set of methods in IdentityStore interface
+ */
+ public enum OperationType
+ {
+
+ create,
+
+ remove,
+
+ updateAttributes,
+
+ modifyRelationships,
+
+ paginatedSearch,
+
+ orderedSearch;
+
+ }
+
+ /**
+ * @param entityType
+ * @return supported operations for given identity type
+ * @throws org.jboss.idm.exceptions.IdentityTypeNotSupportedException
+ */
+ public Set<OperationType> getSupportedOperations(EntityType entityType) throws
IdentityTypeNotSupportedException;
+
+ /**
+ * @param operationType
+ * @param entityType
+ * @return if given operation on given identity type is supported
+ * @throws IdentityTypeNotSupportedException
+ */
+ boolean isOperationSupported(OperationType operationType, EntityType entityType)
throws IdentityTypeNotSupportedException;
+
+ /**
+ * @param operationType
+ * @return set of identity types that can be processed with a given operation
+ * @throws org.jboss.idm.exceptions.IdmException
+ */
+ public Set<EntityType> getSupportedEntities(OperationType operationType);
+
+}
Modified:
modules/identity/trunk/idm/src/main/java/org/jboss/portal/identity/api/IdentityModule.java
===================================================================
---
modules/identity/trunk/idm/src/main/java/org/jboss/portal/identity/api/IdentityModule.java 2008-06-18
09:26:13 UTC (rev 11077)
+++
modules/identity/trunk/idm/src/main/java/org/jboss/portal/identity/api/IdentityModule.java 2008-06-18
13:21:20 UTC (rev 11078)
@@ -41,271 +41,15 @@
{
/**
- * Operations related to the base set of methods in IdentityStore interface
+ * @return Capabilities object describing operations supported by identity module with
current configuration
*/
- public enum OperationType
- {
+ Capabilities getCapabilities();
- create,
-
- remove,
-
- updateAttributes,
-
- modifyRelationships,
-
- paginatedSearch,
-
- orderedSearch;
-
- }
-
/**
- * @param entityType
- * @return supported operations for given identity type
- * @throws IdentityTypeNotSupportedException
+ * @return new session
*/
- public Set<OperationType> getSupportedOperations(EntityType entityType) throws
IdentityTypeNotSupportedException;
+ Session createSession();
- /**
- * @param operationType
- * @param entityType
- * @return if given operation on given identity type is supported
- * @throws IdentityTypeNotSupportedException
- */
- boolean isOperationSupported(OperationType operationType, EntityType entityType)
throws IdentityTypeNotSupportedException;
- /**
- * @param operationType
- * @return set of identity types that can be processed by this identity store with a
given operation
- * @throws IdmException
- */
- public Set<EntityType> getSupportedEntities(OperationType operationType);
-
-
- // Users
- /**
- * Create new user in the data store
- *
- * @param userName
- * @return
- */
- User createUser(String userName);
-
- /**
- * Remove user from the the data store
- *
- * @param user
- * @return
- */
- boolean removeUser(User user);
-
- /**
- * Find user with a given user name
- *
- *
- * @param userName
- * @return
- */
- User findUser(String userName);
-
- /**
- * Find user with a given id
- * @param id
- * @return
- */
- User findUser(Object id);
-
- /**
- * Find users with a given properties values
- * If the paginatedSearch or orderedSearch operations are not supported, dedicated
parameters will take no effect
- *
- * @param properties
- * @param offset
- * @param limit 0 means unlimited page size
- * @param orderedByAttributeName can be null
- * @param ascending default true
- * @return
- */
- Collection<Group> findUsers(Map<String, String[]> properties,
- int offset, int limit, String orderedByAttributeName,
boolean ascending);
-
-
- /**
- * Update user attribute values
- *
- * @param user
- * @param attrName
- * @param values
- * @return
- */
- boolean updateAttribute(User user, String attrName, String[] values);
-
- /**
- * If the paginatedSearch or orderedSearch operations are not supported, dedicated
parameters will take no effect
- *
- * @param user
- * @param offset
- * @param limit 0 means unlimited page size
- * @param orderedByAttributeName can be null
- * @param ascending default true
- * @return a set of groups that this user belongs to
- */
- Collection<Group> getGroups(User user, int offset, int limit, String
orderedByAttributeName, boolean ascending);
-
- /**
- * If the paginatedSearch or orderedSearch operations are not supported, dedicated
parameters will take no effect
- *
- * @param user
- * @param entityType
- * @param offset
- * @param limit 0 means unlimited page size
- * @param orderedByAttributeName can be null
- * @param ascending default true
- * @return a set of groups with a given groupType that this user belongs to
- */
- Collection<Group> getGroups(User user, EntityType entityType,
- int offset, int limit, String orderedByAttributeName,
boolean ascending);
-
- /**
- * Assign a set of groups to this user. All other group associations will be
overwritten
- *
- * @param user
- * @param groups
- * @return
- */
- boolean assignGroups(User user, Set<Group> groups);
-
-
- // Groups
-
- /**
- * Create new group in the data store
- *
- * @param groupName
- * @return
- */
- Group createGroup(String groupName, EntityType type);
-
- /**
- * Remove group from the data store
- *
- * @param group
- * @return
- */
- boolean removeGroup(Group group);
-
- /**
- * Find group with a given name
- *
- * @param name
- * @return
- */
- Group findGroup(String name);
-
- /**
- * Find Group with a given object id
- *
- * @param id
- * @return
- */
- Group findGroup(Object id);
-
- /**
- * Find Group with a given group type
- *
- * @param entityType
- * @return
- */
- Group findGroup(EntityType entityType);
-
- /**
- * Find groups with a given attributes values
- * If the paginatedSearch or orderedSearch operations are not supported, dedicated
parameters will take no effect
- *
- * @param properties
- * @param offset
- * @param limit 0 means unlimited page size
- * @param orderedByAttributeName can be null
- * @param ascending default true
- * @return
- */
- Collection<Group> findGroups(Map<String, String[]> properties,
- int offset, int limit, String orderedByAttributeName,
boolean ascending);
-
- /**
- * Update user attribute values
- *
- * @param attrName
- * @param values
- * @return
- */
- boolean updateAttribute(Group group, String attrName, String[] values);
-
- /**
- * If the paginatedSearch or orderedSearch operations are not supported, dedicated
parameters will take no effect
- *
- * @param group
- * @param offset
- * @param limit 0 means unlimited page size
- * @param orderedByAttributeName can be null
- * @param ascending default true
- * @return set of users assigned to this group. Depending on the underlaying
implementation and datastore it may
- * affect performance
- */
- Collection<User> getUsers(Group group, int offset, int limit, String
orderedByAttributeName, boolean ascending);
-
- /**
- * If the paginatedSearch or orderedSearch operations are not supported, dedicated
parameters will take no effect
- *
- * @param group
- * @param offset
- * @param limit 0 means unlimited page size
- * @param orderedByAttributeName can be null
- * @param ascending default true
- * @return set of groups that are either children of this group or implied for this
group
- */
- Collection<Group> getGroups(Group group, int offset, int limit, String
orderedByAttributeName, boolean ascending);
-
- /**
- * If the paginatedSearch or orderedSearch operations are not supported, dedicated
parameters will take no effect
- *
- * @param group
- * @param type of the relation
- * @param offset
- * @param limit 0 means unlimited page size
- * @param orderedByAttributeName can be null
- * @param ascending default true
- * @return set of groups that have given relation type with this group and the
direction of the relation is towords
- * this group
- */
- Collection<Group> getGroups(Group group, GroupRelationshipType type,
- int offset, int limit, String orderedByAttributeName,
boolean ascending);
-
- /**
- * @param fromGroup
- * @param toGroup
- * @return returns a relationship type between this and given group.
- */
- GroupRelationshipType getRelationship(Group fromGroup, Group toGroup);
-
- /**
- * Assign a set of groups to this group. All other group associations (with this
relation type) for this group
- * will be overrwitten
- *
- * @param fromGroup
- * @param toGroups
- * @param type
- * @return
- */
- boolean assignGroups(Group fromGroup, Set<Group> toGroups, GroupRelationshipType
type);
-
- /**
- * Assign a set of users to this group. All other user associations will be
overwritten for this group
- *
- * @param group
- * @param users
- * @return
- */
- boolean assignUsers(Group group, Set<User> users);
+
}
Added:
modules/identity/trunk/idm/src/main/java/org/jboss/portal/identity/api/Session.java
===================================================================
--- modules/identity/trunk/idm/src/main/java/org/jboss/portal/identity/api/Session.java
(rev 0)
+++
modules/identity/trunk/idm/src/main/java/org/jboss/portal/identity/api/Session.java 2008-06-18
13:21:20 UTC (rev 11078)
@@ -0,0 +1,284 @@
+/*
+* 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.portal.identity.api;
+
+import org.jboss.idm.exceptions.IdmException;
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface Session
+{
+ /**
+ * Close this session
+ */
+ void close() throws IdmException;
+
+ /**
+ * Save all pending changes
+ */
+ void save() throws IdmException;
+
+ /**
+ * Clear this session
+ */
+ void clear() throws IdmException;
+
+ /**
+ * Check if this session is open
+ * @return
+ */
+ boolean isOpen();
+
+
+ // Users
+ /**
+ * Create new user in the data store
+ *
+ * @param userName
+ * @return
+ */
+ User createUser(String userName);
+
+ /**
+ * Remove user from the the data store
+ *
+ * @param user
+ * @return
+ */
+ boolean removeUser(User user);
+
+ /**
+ * Find user with a given user name
+ *
+ *
+ * @param userName
+ * @return
+ */
+ User findUser(String userName);
+
+ /**
+ * Find user with a given id
+ * @param id
+ * @return
+ */
+ User findUser(Object id);
+
+ /**
+ * Find users with a given properties values
+ * If the paginatedSearch or orderedSearch operations are not supported, dedicated
parameters will take no effect
+ *
+ * @param properties
+ * @param offset
+ * @param limit 0 means unlimited page size
+ * @param orderedByAttributeName can be null
+ * @param ascending default true
+ * @return
+ */
+ Collection<Group> findUsers(Map<String, String[]> properties,
+ int offset, int limit, String orderedByAttributeName,
boolean ascending);
+
+
+ /**
+ * Update user attribute values
+ *
+ * @param user
+ * @param attrName
+ * @param values
+ * @return
+ */
+ boolean updateAttribute(User user, String attrName, String[] values);
+
+ /**
+ * If the paginatedSearch or orderedSearch operations are not supported, dedicated
parameters will take no effect
+ *
+ * @param user
+ * @param offset
+ * @param limit 0 means unlimited page size
+ * @param orderedByAttributeName can be null
+ * @param ascending default true
+ * @return a set of groups that this user belongs to
+ */
+ Collection<Group> getGroups(User user, int offset, int limit, String
orderedByAttributeName, boolean ascending);
+
+ /**
+ * If the paginatedSearch or orderedSearch operations are not supported, dedicated
parameters will take no effect
+ *
+ * @param user
+ * @param entityType
+ * @param offset
+ * @param limit 0 means unlimited page size
+ * @param orderedByAttributeName can be null
+ * @param ascending default true
+ * @return a set of groups with a given groupType that this user belongs to
+ */
+ Collection<Group> getGroups(User user, EntityType entityType,
+ int offset, int limit, String orderedByAttributeName,
boolean ascending);
+
+ /**
+ * Assign a set of groups to this user. All other group associations will be
overwritten
+ *
+ * @param user
+ * @param groups
+ * @return
+ */
+ boolean assignGroups(User user, Set<Group> groups);
+
+
+ // Groups
+
+ /**
+ * Create new group in the data store
+ *
+ * @param groupName
+ * @return
+ */
+ Group createGroup(String groupName, EntityType type);
+
+ /**
+ * Remove group from the data store
+ *
+ * @param group
+ * @return
+ */
+ boolean removeGroup(Group group);
+
+ /**
+ * Find group with a given name
+ *
+ * @param name
+ * @return
+ */
+ Group findGroup(String name);
+
+ /**
+ * Find Group with a given object id
+ *
+ * @param id
+ * @return
+ */
+ Group findGroup(Object id);
+
+ /**
+ * Find Group with a given group type
+ *
+ * @param entityType
+ * @return
+ */
+ Group findGroup(EntityType entityType);
+
+ /**
+ * Find groups with a given attributes values
+ * If the paginatedSearch or orderedSearch operations are not supported, dedicated
parameters will take no effect
+ *
+ * @param properties
+ * @param offset
+ * @param limit 0 means unlimited page size
+ * @param orderedByAttributeName can be null
+ * @param ascending default true
+ * @return
+ */
+ Collection<Group> findGroups(Map<String, String[]> properties,
+ int offset, int limit, String orderedByAttributeName,
boolean ascending);
+
+ /**
+ * Update user attribute values
+ *
+ * @param attrName
+ * @param values
+ * @return
+ */
+ boolean updateAttribute(Group group, String attrName, String[] values);
+
+ /**
+ * If the paginatedSearch or orderedSearch operations are not supported, dedicated
parameters will take no effect
+ *
+ * @param group
+ * @param offset
+ * @param limit 0 means unlimited page size
+ * @param orderedByAttributeName can be null
+ * @param ascending default true
+ * @return set of users assigned to this group. Depending on the underlaying
implementation and datastore it may
+ * affect performance
+ */
+ Collection<User> getUsers(Group group, int offset, int limit, String
orderedByAttributeName, boolean ascending);
+
+ /**
+ * If the paginatedSearch or orderedSearch operations are not supported, dedicated
parameters will take no effect
+ *
+ * @param group
+ * @param offset
+ * @param limit 0 means unlimited page size
+ * @param orderedByAttributeName can be null
+ * @param ascending default true
+ * @return set of groups that are either children of this group or implied for this
group
+ */
+ Collection<Group> getGroups(Group group, int offset, int limit, String
orderedByAttributeName, boolean ascending);
+
+ /**
+ * If the paginatedSearch or orderedSearch operations are not supported, dedicated
parameters will take no effect
+ *
+ * @param group
+ * @param type of the relation
+ * @param offset
+ * @param limit 0 means unlimited page size
+ * @param orderedByAttributeName can be null
+ * @param ascending default true
+ * @return set of groups that have given relation type with this group and the
direction of the relation is towords
+ * this group
+ */
+ Collection<Group> getGroups(Group group, GroupRelationshipType type,
+ int offset, int limit, String orderedByAttributeName,
boolean ascending);
+
+ /**
+ * @param fromGroup
+ * @param toGroup
+ * @return returns a relationship type between this and given group.
+ */
+ GroupRelationshipType getRelationship(Group fromGroup, Group toGroup);
+
+ /**
+ * Assign a set of groups to this group. All other group associations (with this
relation type) for this group
+ * will be overrwitten
+ *
+ * @param fromGroup
+ * @param toGroups
+ * @param type
+ * @return
+ */
+ boolean assignGroups(Group fromGroup, Set<Group> toGroups, GroupRelationshipType
type);
+
+ /**
+ * Assign a set of users to this group. All other user associations will be
overwritten for this group
+ *
+ * @param group
+ * @param users
+ * @return
+ */
+ boolean assignUsers(Group group, Set<User> users);
+}