diff options
author | Endi Sukma Dewata <edewata@redhat.com> | 2012-05-19 11:12:12 -0500 |
---|---|---|
committer | Endi Sukma Dewata <edewata@redhat.com> | 2012-05-31 12:01:49 -0500 |
commit | afa68fa3c69d1617a312f1f2f75f7e6c27bb06c7 (patch) | |
tree | 21d1c2774b0d6512f8c708d34a966c5d25077076 /base/common/src/com/netscape/certsrv/group/GroupData.java | |
parent | 770cc205a0108be22922c46a39d162dc31c55724 (diff) | |
download | pki-afa68fa3c69d1617a312f1f2f75f7e6c27bb06c7.tar.gz pki-afa68fa3c69d1617a312f1f2f75f7e6c27bb06c7.tar.xz pki-afa68fa3c69d1617a312f1f2f75f7e6c27bb06c7.zip |
Added group REST service.
The group REST service is based on UsrGrpAdminServlet. It provides an interface
to manage groups and group members.
Ticket #160
Diffstat (limited to 'base/common/src/com/netscape/certsrv/group/GroupData.java')
-rw-r--r-- | base/common/src/com/netscape/certsrv/group/GroupData.java | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/base/common/src/com/netscape/certsrv/group/GroupData.java b/base/common/src/com/netscape/certsrv/group/GroupData.java new file mode 100644 index 000000000..a21ad7f01 --- /dev/null +++ b/base/common/src/com/netscape/certsrv/group/GroupData.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) 2012 Red Hat, Inc. +// All rights reserved. +// --- END COPYRIGHT BLOCK --- + +package com.netscape.certsrv.group; + +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="Group") +public class GroupData { + + String id; + String description; + + Link link; + + @XmlAttribute(name="id") + public String getID() { + return id; + } + + public void setID(String id) { + this.id = id; + } + + @FormParam(Constants.PR_GROUP_DESC) + @XmlElement(name="Description") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + @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 + ((description == null) ? 0 : description.hashCode()); + result = prime * result + ((id == null) ? 0 : id.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; + GroupData other = (GroupData) obj; + if (description == null) { + if (other.description != null) + return false; + } else if (!description.equals(other.description)) + return false; + if (id == null) { + if (other.id != null) + return false; + } else if (!id.equals(other.id)) + return false; + return true; + } +} |