diff options
| author | Endi S. Dewata <edewata@redhat.com> | 2014-02-14 13:22:03 -0500 |
|---|---|---|
| committer | Endi S. Dewata <edewata@redhat.com> | 2014-02-18 11:35:25 -0500 |
| commit | e4c002c7a47025ec99ee11f093749a2cc50f22d2 (patch) | |
| tree | bd62ee2f477e5d8bf41cd0600c52dfdea39e222e /base | |
| parent | 841672c941c1d1cb3ae7a4b2a678e7e5521bccf6 (diff) | |
| download | pki-e4c002c7a47025ec99ee11f093749a2cc50f22d2.tar.gz pki-e4c002c7a47025ec99ee11f093749a2cc50f22d2.tar.xz pki-e4c002c7a47025ec99ee11f093749a2cc50f22d2.zip | |
Updated REST interface for audit.
The REST interface for audit has been modified to return Response
objects to allow better handling of server responses.
Ticket #554
Diffstat (limited to 'base')
3 files changed, 7 insertions, 7 deletions
diff --git a/base/common/src/com/netscape/certsrv/logging/AuditClient.java b/base/common/src/com/netscape/certsrv/logging/AuditClient.java index 959304d92..95d2c7fb4 100644 --- a/base/common/src/com/netscape/certsrv/logging/AuditClient.java +++ b/base/common/src/com/netscape/certsrv/logging/AuditClient.java @@ -41,7 +41,8 @@ public class AuditClient extends Client { } public AuditConfig getAuditConfig() { - return resource.getAuditConfig(); + Response response = resource.getAuditConfig(); + return client.getEntity(response, AuditConfig.class); } public AuditConfig updateAuditConfig(AuditConfig auditConfig) { diff --git a/base/common/src/com/netscape/certsrv/logging/AuditResource.java b/base/common/src/com/netscape/certsrv/logging/AuditResource.java index 4b705a5f9..1220b89bc 100644 --- a/base/common/src/com/netscape/certsrv/logging/AuditResource.java +++ b/base/common/src/com/netscape/certsrv/logging/AuditResource.java @@ -35,8 +35,9 @@ import org.jboss.resteasy.annotations.ClientResponseType; public interface AuditResource { @GET + @ClientResponseType(entityType=AuditConfig.class) @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) - public AuditConfig getAuditConfig(); + public Response getAuditConfig(); @PUT @ClientResponseType(entityType=AuditConfig.class) diff --git a/base/server/cmscore/src/com/netscape/cmscore/logging/AuditService.java b/base/server/cmscore/src/com/netscape/cmscore/logging/AuditService.java index e34bbfc78..284d8a639 100644 --- a/base/server/cmscore/src/com/netscape/cmscore/logging/AuditService.java +++ b/base/server/cmscore/src/com/netscape/cmscore/logging/AuditService.java @@ -97,12 +97,12 @@ public class AuditService extends PKIService implements AuditResource { } @Override - public AuditConfig getAuditConfig() { + public Response getAuditConfig() { CMS.debug("AuditService.getAuditConfig()"); try { - return createAuditConfig(); + return createOKResponse(createAuditConfig()); } catch (PKIException e) { throw e; @@ -163,9 +163,7 @@ public class AuditService extends PKIService implements AuditResource { auditConfig = createAuditConfig(); - return Response - .ok(auditConfig) - .build(); + return createOKResponse(auditConfig); } catch (PKIException e) { throw e; |
