diff options
author | Abhishek Koneru <akoneru@redhat.com> | 2014-08-05 14:18:38 -0400 |
---|---|---|
committer | Abhishek Koneru <akoneru@redhat.com> | 2014-08-14 12:33:33 -0400 |
commit | e42c1bd644cbc55de69c3447fa6613f01dd8fcab (patch) | |
tree | 35e48304ec0463487e0e10596f1f6ae97d3cfbca /base/common/src/com/netscape/certsrv/system | |
parent | 3fad0dadc3033289d49b227887098d8cc368f8ec (diff) | |
download | pki-e42c1bd644cbc55de69c3447fa6613f01dd8fcab.tar.gz pki-e42c1bd644cbc55de69c3447fa6613f01dd8fcab.tar.xz pki-e42c1bd644cbc55de69c3447fa6613f01dd8fcab.zip |
Adds a new CLI command pki ca-kraconnector-show.
The new command allows users to view the information about
kra connectors registered with the CA.
Ticket #479
Diffstat (limited to 'base/common/src/com/netscape/certsrv/system')
3 files changed, 45 insertions, 0 deletions
diff --git a/base/common/src/com/netscape/certsrv/system/ConnectorNotFoundException.java b/base/common/src/com/netscape/certsrv/system/ConnectorNotFoundException.java new file mode 100644 index 000000000..5a060372f --- /dev/null +++ b/base/common/src/com/netscape/certsrv/system/ConnectorNotFoundException.java @@ -0,0 +1,29 @@ +package com.netscape.certsrv.system; + +import com.netscape.certsrv.base.ResourceNotFoundException; + +public class ConnectorNotFoundException extends ResourceNotFoundException { + + private static final long serialVersionUID = 7542636895132507890L; + + public ConnectorNotFoundException(){ + super("Connector not found."); + } + + public ConnectorNotFoundException(String message) { + super(message); + } + + public ConnectorNotFoundException(String message, Throwable reason){ + super(message, reason); + } + + public ConnectorNotFoundException(Data data) { + super(data); + } + + public Data getData() { + return super.getData(); + } + +} diff --git a/base/common/src/com/netscape/certsrv/system/KRAConnectorClient.java b/base/common/src/com/netscape/certsrv/system/KRAConnectorClient.java index 4a29ca154..a90d370c7 100644 --- a/base/common/src/com/netscape/certsrv/system/KRAConnectorClient.java +++ b/base/common/src/com/netscape/certsrv/system/KRAConnectorClient.java @@ -17,8 +17,11 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.system; + import java.net.URISyntaxException; +import javax.ws.rs.core.Response; + import com.netscape.certsrv.client.Client; import com.netscape.certsrv.client.PKIClient; @@ -46,4 +49,9 @@ public class KRAConnectorClient extends Client { kraConnectorClient.removeConnector(host, port); } + public KRAConnectorInfo getConnectorInfo() { + Response response = kraConnectorClient.getConnectorInfo(); + return client.getEntity(response, KRAConnectorInfo.class); + } + } diff --git a/base/common/src/com/netscape/certsrv/system/KRAConnectorResource.java b/base/common/src/com/netscape/certsrv/system/KRAConnectorResource.java index 970224b9a..7e624134d 100644 --- a/base/common/src/com/netscape/certsrv/system/KRAConnectorResource.java +++ b/base/common/src/com/netscape/certsrv/system/KRAConnectorResource.java @@ -19,10 +19,14 @@ package com.netscape.certsrv.system; import javax.ws.rs.Consumes; import javax.ws.rs.FormParam; +import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.Response; + +import org.jboss.resteasy.annotations.ClientResponseType; import com.netscape.certsrv.acls.ACLMapping; import com.netscape.certsrv.authentication.AuthMethodMapping; @@ -49,4 +53,8 @@ public interface KRAConnectorResource { @Consumes({ MediaType.APPLICATION_FORM_URLENCODED }) public void removeConnector(@FormParam("host") String host, @FormParam("port") String port); + @GET + @ClientResponseType(entityType = KRAConnectorInfo.class) + public Response getConnectorInfo(); + } |