diff options
author | Ade Lee <alee@redhat.com> | 2013-07-29 12:23:03 -0400 |
---|---|---|
committer | Ade Lee <alee@redhat.com> | 2013-07-31 16:57:35 -0400 |
commit | ea1d7a70d9fad28a1729d1de4968edafdaeb0889 (patch) | |
tree | fc7a0fcaae390c9d3963c08386af50234be65ffa /base/common/src/com/netscape/certsrv/profile | |
parent | a5326958593a84236879c1bf9cc8b54e86ce089f (diff) | |
download | pki-ea1d7a70d9fad28a1729d1de4968edafdaeb0889.tar.gz pki-ea1d7a70d9fad28a1729d1de4968edafdaeb0889.tar.xz pki-ea1d7a70d9fad28a1729d1de4968edafdaeb0889.zip |
Fix various issues with Profile Interface
1. Fixed REST API as per review.
2. Add output for profile-show and profile-find
Diffstat (limited to 'base/common/src/com/netscape/certsrv/profile')
-rw-r--r-- | base/common/src/com/netscape/certsrv/profile/ProfileDataInfo.java | 21 | ||||
-rw-r--r-- | base/common/src/com/netscape/certsrv/profile/ProfileResource.java | 12 |
2 files changed, 26 insertions, 7 deletions
diff --git a/base/common/src/com/netscape/certsrv/profile/ProfileDataInfo.java b/base/common/src/com/netscape/certsrv/profile/ProfileDataInfo.java index 22062309d..c01d55d16 100644 --- a/base/common/src/com/netscape/certsrv/profile/ProfileDataInfo.java +++ b/base/common/src/com/netscape/certsrv/profile/ProfileDataInfo.java @@ -36,6 +36,12 @@ public class ProfileDataInfo { @XmlElement protected String profileId; + @XmlElement + protected String profileName; + + @XmlElement + protected String profileDescription; + public ProfileDataInfo() { // required for JAXB (defaults) } @@ -65,4 +71,19 @@ public class ProfileDataInfo { return profileId; } + public String getProfileName() { + return profileName; + } + + public void setProfileName(String profileName) { + this.profileName = profileName; + } + + public String getProfileDescription() { + return profileDescription; + } + + public void setProfileDescription(String profileDescription) { + this.profileDescription = profileDescription; + } } diff --git a/base/common/src/com/netscape/certsrv/profile/ProfileResource.java b/base/common/src/com/netscape/certsrv/profile/ProfileResource.java index 317215afb..5c733aa59 100644 --- a/base/common/src/com/netscape/certsrv/profile/ProfileResource.java +++ b/base/common/src/com/netscape/certsrv/profile/ProfileResource.java @@ -13,41 +13,39 @@ import javax.ws.rs.core.MediaType; import com.netscape.certsrv.authentication.AuthMethodMapping; -@Path("") +@Path("profiles") public interface ProfileResource { @GET - @Path("profiles") @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) public ProfileDataInfos listProfiles(); @GET - @Path("profiles/{id}") + @Path("{id}") @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) public ProfileData retrieveProfile(@PathParam("id") String id); @POST - @Path("admin/profiles") @AuthMethodMapping("admin") @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) public void createProfile(ProfileData data); @POST - @Path("agent/profiles/{id}") + @Path("{id}") @AuthMethodMapping("agent") @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) public void modifyProfileState(@PathParam("id") String id, @QueryParam("action") String action); @PUT - @Path("admin/profiles/{id}") + @Path("{id}") @AuthMethodMapping("admin") @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) public void modifyProfile(@PathParam("id") String id, ProfileData data); @DELETE - @Path("admin/profiles/{id}") + @Path("{id}") @AuthMethodMapping("admin") @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) public void deleteProfile(@PathParam("id") String id); |