Author: bdaw
Date: 2006-12-17 09:17:34 -0500 (Sun, 17 Dec 2006)
New Revision: 5882
Added:
trunk/identity/src/main/org/jboss/portal/legacy_identity/
trunk/identity/src/main/org/jboss/portal/legacy_identity/IdentityException.java
trunk/identity/src/main/org/jboss/portal/legacy_identity/NoSuchUserException.java
trunk/identity/src/main/org/jboss/portal/legacy_identity/ProfileMap.java
trunk/identity/src/main/org/jboss/portal/legacy_identity/Role.java
trunk/identity/src/main/org/jboss/portal/legacy_identity/RoleModule.java
trunk/identity/src/main/org/jboss/portal/legacy_identity/User.java
trunk/identity/src/main/org/jboss/portal/legacy_identity/UserModule.java
Modified:
trunk/identity/src/main/org/jboss/portal/identity/auth/IdentityLoginModule.java
trunk/identity/src/main/org/jboss/portal/identity/auth/UserPrincipal.java
trunk/identity/src/main/org/jboss/portal/identity/db/DBRoleModuleImpl.java
trunk/identity/src/main/org/jboss/portal/identity/db/DBUserModuleImpl.java
trunk/identity/src/main/org/jboss/portal/identity/db/ProfileMapImpl.java
trunk/identity/src/main/org/jboss/portal/identity/db/RoleImpl.java
trunk/identity/src/main/org/jboss/portal/identity/db/UserImpl.java
trunk/identity/src/main/org/jboss/portal/identity/management/Identity.java
trunk/identity/src/main/org/jboss/portal/identity/management/IdentityMBean.java
Log:
- legacy identity code (backup temporarily)
Modified: trunk/identity/src/main/org/jboss/portal/identity/auth/IdentityLoginModule.java
===================================================================
---
trunk/identity/src/main/org/jboss/portal/identity/auth/IdentityLoginModule.java 2006-12-16
12:28:47 UTC (rev 5881)
+++
trunk/identity/src/main/org/jboss/portal/identity/auth/IdentityLoginModule.java 2006-12-17
14:17:34 UTC (rev 5882)
@@ -20,14 +20,14 @@
* 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.auth;
+package org.jboss.portal.legacy_identity.auth;
import org.jboss.portal.common.transaction.Transactions;
-import org.jboss.portal.identity.NoSuchUserException;
-import org.jboss.portal.identity.Role;
-import org.jboss.portal.identity.RoleModule;
-import org.jboss.portal.identity.User;
-import org.jboss.portal.identity.UserModule;
+import org.jboss.portal.legacy_identity.NoSuchUserException;
+import org.jboss.portal.legacy_identity.Role;
+import org.jboss.portal.legacy_identity.RoleModule;
+import org.jboss.portal.legacy_identity.User;
+import org.jboss.portal.legacy_identity.UserModule;
import org.jboss.security.SimpleGroup;
import org.jboss.security.auth.spi.UsernamePasswordLoginModule;
Modified: trunk/identity/src/main/org/jboss/portal/identity/auth/UserPrincipal.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/auth/UserPrincipal.java 2006-12-16
12:28:47 UTC (rev 5881)
+++ trunk/identity/src/main/org/jboss/portal/identity/auth/UserPrincipal.java 2006-12-17
14:17:34 UTC (rev 5882)
@@ -20,7 +20,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
******************************************************************************/
-package org.jboss.portal.identity.auth;
+package org.jboss.portal.legacy_identity.auth;
import java.security.Principal;
Modified: trunk/identity/src/main/org/jboss/portal/identity/db/DBRoleModuleImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/db/DBRoleModuleImpl.java 2006-12-16
12:28:47 UTC (rev 5881)
+++ trunk/identity/src/main/org/jboss/portal/identity/db/DBRoleModuleImpl.java 2006-12-17
14:17:34 UTC (rev 5882)
@@ -20,7 +20,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
******************************************************************************/
-package org.jboss.portal.identity.db;
+package org.jboss.portal.legacy_identity.db;
import org.apache.log4j.Logger;
import org.hibernate.Criteria;
@@ -31,10 +31,10 @@
import org.hibernate.criterion.Restrictions;
import org.jboss.portal.common.util.JNDI;
import org.jboss.portal.common.util.Tools;
-import org.jboss.portal.identity.IdentityException;
-import org.jboss.portal.identity.Role;
-import org.jboss.portal.identity.RoleModule;
-import org.jboss.portal.identity.User;
+import org.jboss.portal.legacy_identity.IdentityException;
+import org.jboss.portal.legacy_identity.Role;
+import org.jboss.portal.legacy_identity.RoleModule;
+import org.jboss.portal.legacy_identity.User;
import org.jboss.portal.jems.as.system.AbstractJBossService;
import javax.naming.InitialContext;
Modified: trunk/identity/src/main/org/jboss/portal/identity/db/DBUserModuleImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/db/DBUserModuleImpl.java 2006-12-16
12:28:47 UTC (rev 5881)
+++ trunk/identity/src/main/org/jboss/portal/identity/db/DBUserModuleImpl.java 2006-12-17
14:17:34 UTC (rev 5882)
@@ -20,7 +20,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
******************************************************************************/
-package org.jboss.portal.identity.db;
+package org.jboss.portal.legacy_identity.db;
import org.apache.log4j.Logger;
import org.hibernate.HibernateException;
@@ -29,10 +29,10 @@
import org.hibernate.SessionFactory;
import org.jboss.portal.common.util.JNDI;
import org.jboss.portal.common.util.Tools;
-import org.jboss.portal.identity.IdentityException;
-import org.jboss.portal.identity.NoSuchUserException;
-import org.jboss.portal.identity.User;
-import org.jboss.portal.identity.UserModule;
+import org.jboss.portal.legacy_identity.IdentityException;
+import org.jboss.portal.legacy_identity.NoSuchUserException;
+import org.jboss.portal.legacy_identity.User;
+import org.jboss.portal.legacy_identity.UserModule;
import org.jboss.portal.jems.as.system.AbstractJBossService;
import javax.naming.InitialContext;
Modified: trunk/identity/src/main/org/jboss/portal/identity/db/ProfileMapImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/db/ProfileMapImpl.java 2006-12-16
12:28:47 UTC (rev 5881)
+++ trunk/identity/src/main/org/jboss/portal/identity/db/ProfileMapImpl.java 2006-12-17
14:17:34 UTC (rev 5882)
@@ -20,9 +20,9 @@
* 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.db;
+package org.jboss.portal.legacy_identity.db;
-import org.jboss.portal.identity.ProfileMap;
+import org.jboss.portal.legacy_identity.ProfileMap;
import java.util.ArrayList;
import java.util.Collection;
Modified: trunk/identity/src/main/org/jboss/portal/identity/db/RoleImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/db/RoleImpl.java 2006-12-16 12:28:47
UTC (rev 5881)
+++ trunk/identity/src/main/org/jboss/portal/identity/db/RoleImpl.java 2006-12-17 14:17:34
UTC (rev 5882)
@@ -20,9 +20,9 @@
* 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.db;
+package org.jboss.portal.legacy_identity.db;
-import org.jboss.portal.identity.Role;
+import org.jboss.portal.legacy_identity.Role;
import java.util.HashSet;
import java.util.Set;
Modified: trunk/identity/src/main/org/jboss/portal/identity/db/UserImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/db/UserImpl.java 2006-12-16 12:28:47
UTC (rev 5881)
+++ trunk/identity/src/main/org/jboss/portal/identity/db/UserImpl.java 2006-12-17 14:17:34
UTC (rev 5882)
@@ -20,15 +20,15 @@
* 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.db;
+package org.jboss.portal.legacy_identity.db;
import org.apache.log4j.Logger;
import org.jboss.portal.common.p3p.P3PConstants;
import org.jboss.portal.common.util.LocaleInfo;
import org.jboss.portal.common.util.Tools;
-import org.jboss.portal.identity.ProfileMap;
-import org.jboss.portal.identity.Role;
-import org.jboss.portal.identity.User;
+import org.jboss.portal.legacy_identity.ProfileMap;
+import org.jboss.portal.legacy_identity.Role;
+import org.jboss.portal.legacy_identity.User;
import java.lang.reflect.Field;
import java.text.DateFormat;
Modified: trunk/identity/src/main/org/jboss/portal/identity/management/Identity.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/management/Identity.java 2006-12-16
12:28:47 UTC (rev 5881)
+++ trunk/identity/src/main/org/jboss/portal/identity/management/Identity.java 2006-12-17
14:17:34 UTC (rev 5882)
@@ -20,13 +20,13 @@
* 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.management;
+package org.jboss.portal.legacy_identity.management;
import javax.naming.InitialContext;
import javax.transaction.UserTransaction;
-import org.jboss.portal.identity.RoleModule;
-import org.jboss.portal.identity.UserModule;
+import org.jboss.portal.legacy_identity.RoleModule;
+import org.jboss.portal.legacy_identity.UserModule;
/**
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
Modified: trunk/identity/src/main/org/jboss/portal/identity/management/IdentityMBean.java
===================================================================
---
trunk/identity/src/main/org/jboss/portal/identity/management/IdentityMBean.java 2006-12-16
12:28:47 UTC (rev 5881)
+++
trunk/identity/src/main/org/jboss/portal/identity/management/IdentityMBean.java 2006-12-17
14:17:34 UTC (rev 5882)
@@ -20,10 +20,10 @@
* 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.management;
+package org.jboss.portal.legacy_identity.management;
-import org.jboss.portal.identity.RoleModule;
-import org.jboss.portal.identity.UserModule;
+import org.jboss.portal.legacy_identity.RoleModule;
+import org.jboss.portal.legacy_identity.UserModule;
/**
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
Added: trunk/identity/src/main/org/jboss/portal/legacy_identity/IdentityException.java
===================================================================
---
trunk/identity/src/main/org/jboss/portal/legacy_identity/IdentityException.java 2006-12-16
12:28:47 UTC (rev 5881)
+++
trunk/identity/src/main/org/jboss/portal/legacy_identity/IdentityException.java 2006-12-17
14:17:34 UTC (rev 5882)
@@ -0,0 +1,52 @@
+/******************************************************************************
+ * 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.legacy_identity;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class IdentityException extends Exception
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -2976579334381568521L;
+
+ public IdentityException()
+ {
+ }
+
+ public IdentityException(String message)
+ {
+ super(message);
+ }
+
+ public IdentityException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public IdentityException(Throwable cause)
+ {
+ super(cause);
+ }
+}
Property changes on:
trunk/identity/src/main/org/jboss/portal/legacy_identity/IdentityException.java
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/identity/src/main/org/jboss/portal/legacy_identity/NoSuchUserException.java
===================================================================
---
trunk/identity/src/main/org/jboss/portal/legacy_identity/NoSuchUserException.java 2006-12-16
12:28:47 UTC (rev 5881)
+++
trunk/identity/src/main/org/jboss/portal/legacy_identity/NoSuchUserException.java 2006-12-17
14:17:34 UTC (rev 5882)
@@ -0,0 +1,46 @@
+/******************************************************************************
+ * 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.legacy_identity;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class NoSuchUserException extends IdentityException
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 7328419579811469592L;
+ private String userName;
+
+ public NoSuchUserException(String userName)
+ {
+ super("No such user " + userName);
+ this.userName = userName;
+ }
+
+ public String getUserName()
+ {
+ return userName;
+ }
+}
Property changes on:
trunk/identity/src/main/org/jboss/portal/legacy_identity/NoSuchUserException.java
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/identity/src/main/org/jboss/portal/legacy_identity/ProfileMap.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/legacy_identity/ProfileMap.java 2006-12-16
12:28:47 UTC (rev 5881)
+++ trunk/identity/src/main/org/jboss/portal/legacy_identity/ProfileMap.java 2006-12-17
14:17:34 UTC (rev 5882)
@@ -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.portal.legacy_identity;
+
+import java.util.Map;
+
+/**
+ * Extends <code>java.util.Map</code> to provide meta information about user
profile.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public interface ProfileMap extends Map
+{
+ /**
+ * Return true if the profile value is read only.
+ *
+ * @param key
+ * @return true if the profile value is read only
+ * @throws ClassCastException if the key is not an instance of string
+ */
+ boolean isReadOnly(Object key);
+}
Property changes on:
trunk/identity/src/main/org/jboss/portal/legacy_identity/ProfileMap.java
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/identity/src/main/org/jboss/portal/legacy_identity/Role.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/legacy_identity/Role.java 2006-12-16 12:28:47
UTC (rev 5881)
+++ trunk/identity/src/main/org/jboss/portal/legacy_identity/Role.java 2006-12-17 14:17:34
UTC (rev 5882)
@@ -0,0 +1,52 @@
+/******************************************************************************
+ * 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.legacy_identity;
+
+import java.util.Set;
+
+/**
+ * A role of users.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision: 5448 $
+ */
+public interface Role
+{
+ /** The role identifier. */
+ Object getId();
+
+ /** The role name used in security rules. This name can not be modified */
+ String getName();
+
+ /** The role display name used on screens. This name can be modified */
+ String getDisplayName();
+
+ /**
+ *
+ */
+ void setDisplayName(String name);
+
+ /** The users. */
+ Set getUsers();
+}
Property changes on: trunk/identity/src/main/org/jboss/portal/legacy_identity/Role.java
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/identity/src/main/org/jboss/portal/legacy_identity/RoleModule.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/legacy_identity/RoleModule.java 2006-12-16
12:28:47 UTC (rev 5881)
+++ trunk/identity/src/main/org/jboss/portal/legacy_identity/RoleModule.java 2006-12-17
14:17:34 UTC (rev 5882)
@@ -0,0 +1,122 @@
+/******************************************************************************
+ * 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.legacy_identity;
+
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet </a>
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute </a>
+ * @author Roy Russo : roy at jboss dot org
+ * @version $Revision: 5448 $
+ */
+public interface RoleModule
+{
+ /**
+ * Retrieves a role by its name
+ *
+ * @param name the role name
+ * @return the role
+ */
+ Role findRoleByName(String name) throws IdentityException, IllegalArgumentException;
+
+ /**
+ * Retrieve a collection of role from the role names.
+ *
+ * @param names the role names
+ * @return a collection of roles
+ * @throws IllegalArgumentException
+ */
+ Set findRolesByNames(String[] names) throws IdentityException,
IllegalArgumentException;
+
+ /**
+ * Retrieves a role by its id.
+ *
+ * @param id the role id
+ * @return the role
+ */
+ Role findRoleById(Object id) throws IdentityException, IllegalArgumentException;
+
+ /**
+ * Retrieves a role by its id.
+ *
+ * @param id the role id
+ * @return the role
+ */
+ Role findRoleById(String id) throws IdentityException, IllegalArgumentException;
+
+ /**
+ * Create a new role with the specified name.
+ *
+ * @param name the role name
+ * @param displayName the role display name
+ * @return the role
+ */
+ Role createRole(String name, String displayName) throws IdentityException,
IllegalArgumentException;
+
+ /**
+ * Remove a role.
+ *
+ * @param id the role id
+ */
+ void removeRole(Object id) throws IdentityException, IllegalArgumentException;
+
+ /**
+ * Returns the number of roles.
+ *
+ * @return the number of roles
+ */
+ int getRolesCount() throws IdentityException;
+
+ /**
+ * Get all the roles
+ *
+ * @return the roles
+ */
+ Set findRoles() throws IdentityException;
+
+ /**
+ * Returns role members based on rolename
+ *
+ * @param roleName
+ * @param offset
+ * @param limit
+ */
+ Set findRoleMembers(String roleName, int offset, int limit, String userNameFilter)
throws IdentityException;
+
+ /**
+ * Assign a set of role objects to a given user.
+ *
+ * @param user the user
+ * @param roles the user roles
+ */
+ void setRoles(User user, Set roles) throws IdentityException;
+
+ /**
+ * Return the set of role objects that a given user has.
+ *
+ * @param user the user
+ * @return the set of roles of the specified user
+ */
+ Set getRoles(User user) throws IdentityException;
+}
Property changes on:
trunk/identity/src/main/org/jboss/portal/legacy_identity/RoleModule.java
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/identity/src/main/org/jboss/portal/legacy_identity/User.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/legacy_identity/User.java 2006-12-16 12:28:47
UTC (rev 5881)
+++ trunk/identity/src/main/org/jboss/portal/legacy_identity/User.java 2006-12-17 14:17:34
UTC (rev 5882)
@@ -0,0 +1,161 @@
+/******************************************************************************
+ * 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.legacy_identity;
+
+import java.util.Date;
+import java.util.Locale;
+
+/**
+ * A user.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @author <a href="mailto:mageshbk@jboss.com">Magesh Kumar Bojan
</a>
+ * @version $Revision: 5623 $
+ */
+public interface User
+{
+
+ String INFO_USER_REGISTRATION_DATE = "portal.user.registration-date";
+ String INFO_USER_HOMEPAGE = "portal.user.homepage";
+ String INFO_USER_TIME_ZONE_OFFSET = "portal.user.time-zone-offset";
+ String INFO_USER_THEME = "portal.user.theme";
+ String INFO_USER_LOCATION = "portal.user.location";
+ String INFO_USER_OCCUPATION = "portal.user.occupation";
+ String INFO_USER_EXTRA = "portal.user.extra";
+ String INFO_USER_SIGNATURE = "portal.user.signature";
+ String INFO_USER_INTERESTS = "portal.user.interests";
+ String INFO_USER_LOCALE = "portal.user.locale";
+ String INFO_USER_IM_ICQ = "portal.user.im.icq";
+ String INFO_USER_IM_AIM = "portal.user.im.aim";
+ String INFO_USER_IM_MSNM = "portal.user.im.msnm";
+ String INFO_USER_IM_YIM = "portal.user.im.yim";
+ String INFO_USER_IM_SKYPE = "portal.user.im.skype";
+ String INFO_USER_SECURITY_QUESTION = "portal.user.security.question";
+ String INFO_USER_SECURITY_ANSWER = "portal.user.security.answer";
+ String INFO_USER_EMAIL_FAKE = "portal.user.email.fake";
+ String INFO_USER_VIEW_EMAIL_VIEW_REAL = "portal.user.email.view-real";
+ String INFO_USER_LAST_LOGIN_DATE = "portal.user.last-login-date";
+
+ /** The user identifier. To safetly cast to String use .toString() method */
+ Object getId();
+
+ // User management
**************************************************************************************************
+
+ /** Disable the user. */
+ boolean getEnabled();
+
+ /** Enable the user. */
+ void setEnabled(boolean enable);
+
+ /** Set the password. */
+ void updatePassword(String password);
+
+ /** Return true if the password is valid. */
+ boolean validatePassword(String password);
+
+ // Detyped access to properties
*************************************************************************************
+
+ /** Returns the user properties. */
+ ProfileMap getProfile();
+
+ // Properties declared in this interface for convenient access
******************************************************
+
+ /** The user name. */
+ String getUserName();
+
+ /** The given name (firstname). */
+ String getGivenName();
+
+ /**
+ *
+ */
+ void setGivenName(String givenName);
+
+ /** The family name. */
+ String getFamilyName();
+
+ /**
+ *
+ */
+ void setFamilyName(String familyName);
+
+ /**
+ *
+ */
+ String getRealEmail();
+
+ /**
+ *
+ */
+ void setRealEmail(String realEmail);
+
+ /**
+ *
+ */
+ String getFakeEmail();
+
+ /**
+ *
+ */
+ void setFakeEmail(String fakeEmail);
+
+ /**
+ *
+ */
+ Date getRegistrationDate();
+
+ /**
+ *
+ */
+ boolean getViewRealEmail();
+
+ /**
+ *
+ */
+ void setViewRealEmail(boolean viewRealEmail);
+
+ /** Return the user preferred locale. */
+ Locale getPreferredLocale();
+
+ /** Set the user preferred locale. */
+ void setPreferredLocale(Locale locale);
+
+ /** Returns the signature. */
+ String getSignature();
+
+ /** Set the signature. */
+ void setSignature(String signature);
+
+ /** Return the last time the user logged in or null if this date is not known. */
+ Date getLastVisitDate();
+
+ /** Set the last visit date on this user. */
+ void setLastVisitDate(Date date);
+
+ /** Return the theme set for this user as the app id of the Theme. */
+ String getTheme();
+
+ /** Set the theme for this user. */
+ void setTheme(String themeId);
+}
Property changes on: trunk/identity/src/main/org/jboss/portal/legacy_identity/User.java
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/identity/src/main/org/jboss/portal/legacy_identity/UserModule.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/legacy_identity/UserModule.java 2006-12-16
12:28:47 UTC (rev 5881)
+++ trunk/identity/src/main/org/jboss/portal/legacy_identity/UserModule.java 2006-12-17
14:17:34 UTC (rev 5882)
@@ -0,0 +1,99 @@
+/******************************************************************************
+ * 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.legacy_identity;
+
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet </a>
+ * @version $Revision: 5448 $
+ */
+public interface UserModule
+{
+ /**
+ * Retrieve a user by its name.
+ *
+ * @param userName the user name
+ * @return the user
+ */
+ User findUserByUserName(String userName) throws IdentityException,
IllegalArgumentException, NoSuchUserException;
+
+ /**
+ * Retrieve a user by its id.
+ *
+ * @param id the user id
+ * @return the user
+ * @throws IllegalArgumentException if the id is null
+ */
+ User findUserById(Object id) throws IdentityException, IllegalArgumentException,
NoSuchUserException;
+
+ /**
+ * Retrieve a user by its id.
+ *
+ * @param id the user id
+ * @return the user
+ * @throws IllegalArgumentException if the id is null or not in the good format
+ */
+ User findUserById(String id) throws IdentityException, IllegalArgumentException,
NoSuchUserException;
+
+ /**
+ * Creates a new user with the specified name.
+ *
+ * @param userName
+ * @return the user
+ */
+ User createUser(String userName, String password, String realEmail) throws
IdentityException, IllegalArgumentException;
+
+ /**
+ * Remove a user.
+ *
+ * @param id the user id
+ */
+ void removeUser(Object id) throws IdentityException, IllegalArgumentException;
+
+ /**
+ * Get a range of users.
+ *
+ * @param offset the offset of the first result to retrieve
+ * @param limit the maximum number of users to retrieve
+ * @return the user set
+ */
+ Set findUsers(int offset, int limit) throws IdentityException,
IllegalArgumentException;
+
+ /**
+ * Get a range of users.
+ *
+ * @param filter a string filter applied to the user name.
+ * @param offset the offset of the frist result to retrieve
+ * @param limit the maximum number of users to retrieve
+ * @return the user set
+ */
+ Set findUsersFilteredByUserName(String filter, int offset, int limit) throws
IdentityException, IllegalArgumentException;
+
+ /**
+ * Returns the number of users.
+ *
+ * @return the number of users
+ */
+ int getUserCount() throws IdentityException, IllegalArgumentException;
+}
Property changes on:
trunk/identity/src/main/org/jboss/portal/legacy_identity/UserModule.java
___________________________________________________________________
Name: svn:executable
+ *