diff options
author | Endi S. Dewata <edewata@redhat.com> | 2013-12-16 04:13:11 -0500 |
---|---|---|
committer | Endi S. Dewata <edewata@redhat.com> | 2014-01-30 10:47:34 -0500 |
commit | cd7a937200592038c2eff3253497e1eea68a1224 (patch) | |
tree | d141c93d2a3d495a2616c03e989aecb56d355bf4 /base/common/src/com/netscape/certsrv/tps | |
parent | 0caa396d65f15c37e9565760a30e0acd9ea7c617 (diff) | |
download | pki-cd7a937200592038c2eff3253497e1eea68a1224.tar.gz pki-cd7a937200592038c2eff3253497e1eea68a1224.tar.xz pki-cd7a937200592038c2eff3253497e1eea68a1224.zip |
Fixed TPS resource statuses.
TPS resources that are stored in CS.cfg have been refactored to update
their statuses properly. These resources include profiles, profile
mappings, connections, and authenticators.
Ticket #654
Diffstat (limited to 'base/common/src/com/netscape/certsrv/tps')
7 files changed, 57 insertions, 10 deletions
diff --git a/base/common/src/com/netscape/certsrv/tps/authenticator/AuthenticatorClient.java b/base/common/src/com/netscape/certsrv/tps/authenticator/AuthenticatorClient.java index 893d98e7c..c4468e5cf 100644 --- a/base/common/src/com/netscape/certsrv/tps/authenticator/AuthenticatorClient.java +++ b/base/common/src/com/netscape/certsrv/tps/authenticator/AuthenticatorClient.java @@ -60,6 +60,12 @@ public class AuthenticatorClient extends Client { return client.getEntity(response); } + public AuthenticatorData changeAuthenticatorStatus(String authenticatorID, String action) { + @SuppressWarnings("unchecked") + ClientResponse<AuthenticatorData> response = (ClientResponse<AuthenticatorData>)resource.changeAuthenticatorStatus(authenticatorID, action); + return client.getEntity(response); + } + public void removeAuthenticator(String authenticatorID) { resource.removeAuthenticator(authenticatorID); } diff --git a/base/common/src/com/netscape/certsrv/tps/authenticator/AuthenticatorResource.java b/base/common/src/com/netscape/certsrv/tps/authenticator/AuthenticatorResource.java index 6a2ef0d9a..1f9253144 100644 --- a/base/common/src/com/netscape/certsrv/tps/authenticator/AuthenticatorResource.java +++ b/base/common/src/com/netscape/certsrv/tps/authenticator/AuthenticatorResource.java @@ -55,25 +55,35 @@ public interface AuthenticatorResource { public AuthenticatorData getAuthenticator(@PathParam("authenticatorID") String authenticatorID); @POST + @ACLMapping("authenticators.add") @ClientResponseType(entityType=AuthenticatorData.class) @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) - @ACLMapping("authenticators.add") public Response addAuthenticator(AuthenticatorData authenticatorData); @PUT @Path("{authenticatorID}") + @ACLMapping("authenticators.modify") @ClientResponseType(entityType=AuthenticatorData.class) @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) - @ACLMapping("authenticators.modify") public Response updateAuthenticator( @PathParam("authenticatorID") String authenticatorID, AuthenticatorData authenticatorData); - @DELETE + @POST @Path("{authenticatorID}") + @ACLMapping("authenticators.approve") + @ClientResponseType(entityType=AuthenticatorData.class) + @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + public Response changeAuthenticatorStatus( + @PathParam("authenticatorID") String authenticatorID, + @QueryParam("action") String action); + + @DELETE + @Path("{authenticatorID}") @ACLMapping("authenticators.remove") + @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) public void removeAuthenticator(@PathParam("authenticatorID") String authenticatorID); } diff --git a/base/common/src/com/netscape/certsrv/tps/connection/ConnectionClient.java b/base/common/src/com/netscape/certsrv/tps/connection/ConnectionClient.java index 6c67e6b2a..d7e1252d3 100644 --- a/base/common/src/com/netscape/certsrv/tps/connection/ConnectionClient.java +++ b/base/common/src/com/netscape/certsrv/tps/connection/ConnectionClient.java @@ -60,6 +60,12 @@ public class ConnectionClient extends Client { return client.getEntity(response); } + public ConnectionData changeConnectionStatus(String connectionID, String action) { + @SuppressWarnings("unchecked") + ClientResponse<ConnectionData> response = (ClientResponse<ConnectionData>)resource.changeConnectionStatus(connectionID, action); + return client.getEntity(response); + } + public void removeConnection(String connectionID) { resource.removeConnection(connectionID); } diff --git a/base/common/src/com/netscape/certsrv/tps/connection/ConnectionResource.java b/base/common/src/com/netscape/certsrv/tps/connection/ConnectionResource.java index e1be5c6b4..21f4c08e5 100644 --- a/base/common/src/com/netscape/certsrv/tps/connection/ConnectionResource.java +++ b/base/common/src/com/netscape/certsrv/tps/connection/ConnectionResource.java @@ -55,25 +55,35 @@ public interface ConnectionResource { public ConnectionData getConnection(@PathParam("connectionID") String connectionID); @POST + @ACLMapping("connections.add") @ClientResponseType(entityType=ConnectionData.class) @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) - @ACLMapping("connections.add") public Response addConnection(ConnectionData connectionData); @PUT @Path("{connectionID}") + @ACLMapping("connections.modify") @ClientResponseType(entityType=ConnectionData.class) @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) - @ACLMapping("connections.modify") public Response updateConnection( @PathParam("connectionID") String connectionID, ConnectionData connectionData); - @DELETE + @POST @Path("{connectionID}") + @ACLMapping("connections.approve") + @ClientResponseType(entityType=ConnectionData.class) + @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + public Response changeConnectionStatus( + @PathParam("connectionID") String connectionID, + @QueryParam("action") String action); + + @DELETE + @Path("{connectionID}") @ACLMapping("connections.remove") + @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) public void removeConnection(@PathParam("connectionID") String connectionID); } diff --git a/base/common/src/com/netscape/certsrv/tps/profile/ProfileMappingClient.java b/base/common/src/com/netscape/certsrv/tps/profile/ProfileMappingClient.java index 58f4e2673..cd1d82270 100644 --- a/base/common/src/com/netscape/certsrv/tps/profile/ProfileMappingClient.java +++ b/base/common/src/com/netscape/certsrv/tps/profile/ProfileMappingClient.java @@ -60,6 +60,12 @@ public class ProfileMappingClient extends Client { return client.getEntity(response); } + public ProfileMappingData changeProfileMappingStatus(String profileMappingID, String action) { + @SuppressWarnings("unchecked") + ClientResponse<ProfileMappingData> response = (ClientResponse<ProfileMappingData>)resource.changeProfileMappingStatus(profileMappingID, action); + return client.getEntity(response); + } + public void removeProfileMapping(String profileMappingID) { resource.removeProfileMapping(profileMappingID); } diff --git a/base/common/src/com/netscape/certsrv/tps/profile/ProfileMappingResource.java b/base/common/src/com/netscape/certsrv/tps/profile/ProfileMappingResource.java index 04e606b8a..698a1b13b 100644 --- a/base/common/src/com/netscape/certsrv/tps/profile/ProfileMappingResource.java +++ b/base/common/src/com/netscape/certsrv/tps/profile/ProfileMappingResource.java @@ -55,25 +55,35 @@ public interface ProfileMappingResource { public ProfileMappingData getProfileMapping(@PathParam("profileMappingID") String profileMappingID); @POST + @ACLMapping("profile-mappings.add") @ClientResponseType(entityType=ProfileMappingData.class) @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) - @ACLMapping("profile-mappings.add") public Response addProfileMapping(ProfileMappingData profileMappingData); @PUT @Path("{profileMappingID}") + @ACLMapping("profile-mappings.modify") @ClientResponseType(entityType=ProfileMappingData.class) @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) - @ACLMapping("profile-mappings.modify") public Response updateProfileMapping( @PathParam("profileMappingID") String profileMappingID, ProfileMappingData profileMappingData); - @DELETE + @POST @Path("{profileMappingID}") + @ACLMapping("profiles-mappings.approve") + @ClientResponseType(entityType=ProfileMappingData.class) + @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + public Response changeProfileMappingStatus( + @PathParam("profileMappingID") String profileMappingID, + @QueryParam("action") String action); + + @DELETE + @Path("{profileMappingID}") @ACLMapping("profile-mappings.remove") + @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) public void removeProfileMapping(@PathParam("profileMappingID") String profileMappingID); } diff --git a/base/common/src/com/netscape/certsrv/tps/profile/ProfileResource.java b/base/common/src/com/netscape/certsrv/tps/profile/ProfileResource.java index d86a4d809..e8a33c18b 100644 --- a/base/common/src/com/netscape/certsrv/tps/profile/ProfileResource.java +++ b/base/common/src/com/netscape/certsrv/tps/profile/ProfileResource.java @@ -81,7 +81,6 @@ public interface ProfileResource { @PathParam("profileID") String profileID, @QueryParam("action") String action); - @DELETE @Path("{profileID}") @ACLMapping("profiles.remove") |