Author: bdaw
Date: 2009-02-05 07:41:35 -0500 (Thu, 05 Feb 2009)
New Revision: 12779
Added:
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity/event/MembershipChangedEvent.java
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity/event/RoleCreatedEvent.java
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity/event/RoleDestroyedEvent.java
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity/event/RoleUpdatedEvent.java
Log:
synchronizing sources from branch 1.0 to trunk
Added:
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity/event/MembershipChangedEvent.java
===================================================================
---
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity/event/MembershipChangedEvent.java
(rev 0)
+++
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity/event/MembershipChangedEvent.java 2009-02-05
12:41:35 UTC (rev 12779)
@@ -0,0 +1,92 @@
+/*
+* 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.event;
+
+import java.util.Set;
+import java.util.Iterator;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class MembershipChangedEvent extends IdentityEvent
+{
+ private final Set userIds;
+
+ private final Set roleIds;
+
+ private final String representation;
+
+ public MembershipChangedEvent(Set userIds, Set roleIds)
+ {
+ if (userIds == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ if (roleIds == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ if (roleIds.size() > 1 && userIds.size() > 1)
+ {
+ throw new IllegalStateException("Either roleIds or userIds must contain
only one element");
+ }
+
+ this.userIds = userIds;
+ this.roleIds = roleIds;
+
+ StringBuilder sb = new StringBuilder();
+
+ sb.append("MembershipChangedEvent[userIds=");
+ for (Iterator iterator = userIds.iterator(); iterator.hasNext();)
+ {
+ Object o = iterator.next();
+ if (iterator.hasNext())
+ {
+ sb.append(o.toString() + ", ");
+ }
+ else
+ {
+ sb.append(o.toString());
+ }
+ }
+ representation = sb.toString();
+ }
+
+ public Set getUserIds()
+ {
+ return userIds;
+ }
+
+ public Set getRoleIds()
+ {
+ return roleIds;
+ }
+
+ public String toString()
+ {
+ return representation;
+ }
+}
Added:
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity/event/RoleCreatedEvent.java
===================================================================
---
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity/event/RoleCreatedEvent.java
(rev 0)
+++
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity/event/RoleCreatedEvent.java 2009-02-05
12:41:35 UTC (rev 12779)
@@ -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.portal.identity.event;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class RoleCreatedEvent extends IdentityEvent
+{
+
+ /** . */
+ private final Object roleId;
+
+ /** . */
+ private final String roleName;
+
+ public RoleCreatedEvent(Object roleId, String roleName)
+ {
+ if (roleId == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (roleName == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.roleId = roleId;
+ this.roleName = roleName;
+ }
+
+ public Object getRoleId()
+ {
+ return roleId;
+ }
+
+ public String getRoleName()
+ {
+ return roleName;
+ }
+
+ public String toString()
+ {
+ return "RoleCreatedEvent[roleId=" + roleId + ",roleName=" +
roleName + "]";
+ }
+}
\ No newline at end of file
Added:
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity/event/RoleDestroyedEvent.java
===================================================================
---
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity/event/RoleDestroyedEvent.java
(rev 0)
+++
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity/event/RoleDestroyedEvent.java 2009-02-05
12:41:35 UTC (rev 12779)
@@ -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.portal.identity.event;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class RoleDestroyedEvent extends IdentityEvent
+{
+
+ /** . */
+ private final Object roleId;
+
+ /** . */
+ private final String roleName;
+
+ public RoleDestroyedEvent(Object roleId, String roleName)
+ {
+ if (roleId == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (roleName == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.roleId = roleId;
+ this.roleName = roleName;
+ }
+
+ public Object getRoleId()
+ {
+ return roleId;
+ }
+
+ public String getRoleName()
+ {
+ return roleName;
+ }
+
+ public String toString()
+ {
+ return "RoleDestroyedEvent[roleId=" + roleId + ",roleName=" +
roleName + "]";
+ }
+}
\ No newline at end of file
Added:
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity/event/RoleUpdatedEvent.java
===================================================================
---
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity/event/RoleUpdatedEvent.java
(rev 0)
+++
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity/event/RoleUpdatedEvent.java 2009-02-05
12:41:35 UTC (rev 12779)
@@ -0,0 +1,85 @@
+/*
+* 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.event;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class RoleUpdatedEvent extends IdentityEvent
+{
+ /** . */
+ private final Object roleId;
+
+ /** . */
+ private final String roleName;
+
+ /** . */
+ private String displayName;
+
+
+ public RoleUpdatedEvent(Object roleId, String roleName, String displayName)
+ {
+
+ this.displayName = displayName;
+ if (roleId == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (roleName == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (displayName == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+
+ this.roleId = roleId;
+ this.roleName = roleName;
+ this.displayName = displayName;
+
+ }
+
+ public Object getRoleId()
+ {
+ return roleId;
+ }
+
+ public String getRoleName()
+ {
+ return roleName;
+ }
+
+ public String getDisplayName()
+ {
+ return displayName;
+ }
+
+ public String toString()
+ {
+ return "RoleUpdatedEvent[roleId=" + roleId + ",roleName=" +
roleName + ",displayName" + displayName + "]";
+ }
+
+}