summaryrefslogtreecommitdiffstats
path: root/base/common/src/com/netscape/certsrv/user/UserMembershipData.java
diff options
context:
space:
mode:
authorEndi Sukma Dewata <edewata@redhat.com>2013-02-11 13:16:44 -0500
committerEndi Sukma Dewata <edewata@redhat.com>2013-02-18 10:57:53 -0500
commitdd01437171044ecb4cdc63998250a4d9f3277119 (patch)
treee0b8bdd9b59f00292adc8587a65935cb7eabd755 /base/common/src/com/netscape/certsrv/user/UserMembershipData.java
parent12bd85dc50052107e5dccff56f4110b133aafdc1 (diff)
downloadpki-dd01437171044ecb4cdc63998250a4d9f3277119.tar.gz
pki-dd01437171044ecb4cdc63998250a4d9f3277119.tar.xz
pki-dd01437171044ecb4cdc63998250a4d9f3277119.zip
Added CLI to manage user membership.
New CLI's have been added to search, add, and remove user membership. The group member management code has been refactored into a processor to allow reuse. Ticket #190
Diffstat (limited to 'base/common/src/com/netscape/certsrv/user/UserMembershipData.java')
-rw-r--r--base/common/src/com/netscape/certsrv/user/UserMembershipData.java99
1 files changed, 99 insertions, 0 deletions
diff --git a/base/common/src/com/netscape/certsrv/user/UserMembershipData.java b/base/common/src/com/netscape/certsrv/user/UserMembershipData.java
new file mode 100644
index 000000000..8db70e21e
--- /dev/null
+++ b/base/common/src/com/netscape/certsrv/user/UserMembershipData.java
@@ -0,0 +1,99 @@
+// --- BEGIN COPYRIGHT BLOCK ---
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; version 2 of the License.
+//
+// This program 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 General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+//
+// (C) 2013 Red Hat, Inc.
+// All rights reserved.
+// --- END COPYRIGHT BLOCK ---
+
+package com.netscape.certsrv.user;
+
+import javax.ws.rs.FormParam;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.jboss.resteasy.plugins.providers.atom.Link;
+
+import com.netscape.certsrv.common.Constants;
+
+/**
+ * @author Endi S. Dewata
+ */
+@XmlRootElement(name="UserMembership")
+public class UserMembershipData {
+
+ String id;
+ String userID;
+
+ Link link;
+
+ @FormParam(Constants.PR_GROUP_GROUP)
+ @XmlAttribute(name="id")
+ public String getID() {
+ return id;
+ }
+
+ public void setID(String id) {
+ this.id = id;
+ }
+
+ @XmlElement(name="UserID")
+ public String getUserID() {
+ return userID;
+ }
+
+ public void setUserID(String userID) {
+ this.userID = userID;
+ }
+
+ @XmlElement(name="Link")
+ public Link getLink() {
+ return link;
+ }
+
+ public void setLink(Link link) {
+ this.link = link;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((id == null) ? 0 : id.hashCode());
+ result = prime * result + ((userID == null) ? 0 : userID.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ UserMembershipData other = (UserMembershipData) obj;
+ if (id == null) {
+ if (other.id != null)
+ return false;
+ } else if (!id.equals(other.id))
+ return false;
+ if (userID == null) {
+ if (other.userID != null)
+ return false;
+ } else if (!userID.equals(other.userID))
+ return false;
+ return true;
+ }
+}