From 8f5a54eb637a6afb8c6886554811f07879a5163f Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Mon, 5 May 2014 21:05:09 -0400 Subject: Renamed TPS connection to TPS connector (part 4). The TPS connection REST service has been renamed to TPS connector. Ticket #977 --- .../certsrv/tps/connector/ConnectionResource.java | 81 ---------------------- .../certsrv/tps/connector/ConnectorClient.java | 16 ++--- .../certsrv/tps/connector/ConnectorResource.java | 81 ++++++++++++++++++++++ 3 files changed, 89 insertions(+), 89 deletions(-) delete mode 100644 base/common/src/com/netscape/certsrv/tps/connector/ConnectionResource.java create mode 100644 base/common/src/com/netscape/certsrv/tps/connector/ConnectorResource.java (limited to 'base/common') diff --git a/base/common/src/com/netscape/certsrv/tps/connector/ConnectionResource.java b/base/common/src/com/netscape/certsrv/tps/connector/ConnectionResource.java deleted file mode 100644 index 1fb9fa33c..000000000 --- a/base/common/src/com/netscape/certsrv/tps/connector/ConnectionResource.java +++ /dev/null @@ -1,81 +0,0 @@ -// --- 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) 2013 Red Hat, Inc. -// All rights reserved. -// --- END COPYRIGHT BLOCK --- -package com.netscape.certsrv.tps.connector; - -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.Response; - -import org.jboss.resteasy.annotations.ClientResponseType; - -import com.netscape.certsrv.acls.ACLMapping; -import com.netscape.certsrv.authentication.AuthMethodMapping; -import com.netscape.certsrv.base.PATCH; - - -/** - * @author Endi S. Dewata - */ -@Path("connections") -@AuthMethodMapping("connections") -@ACLMapping("connections.read") -public interface ConnectionResource { - - @GET - @ClientResponseType(entityType=ConnectorCollection.class) - public Response findConnections( - @QueryParam("filter") String filter, - @QueryParam("start") Integer start, - @QueryParam("size") Integer size); - - @GET - @Path("{connectionID}") - @ClientResponseType(entityType=ConnectorData.class) - public Response getConnection(@PathParam("connectionID") String connectionID); - - @POST - @ACLMapping("connections.add") - @ClientResponseType(entityType=ConnectorData.class) - public Response addConnection(ConnectorData connectorData); - - @PATCH - @Path("{connectionID}") - @ACLMapping("connections.modify") - @ClientResponseType(entityType=ConnectorData.class) - public Response updateConnection( - @PathParam("connectionID") String connectionID, - ConnectorData connectorData); - - @POST - @Path("{connectionID}") - @ACLMapping("connections.approve") - @ClientResponseType(entityType=ConnectorData.class) - public Response changeConnectionStatus( - @PathParam("connectionID") String connectionID, - @QueryParam("action") String action); - - @DELETE - @Path("{connectionID}") - @ClientResponseType(entityType=Void.class) - @ACLMapping("connections.remove") - public Response removeConnection(@PathParam("connectionID") String connectionID); -} diff --git a/base/common/src/com/netscape/certsrv/tps/connector/ConnectorClient.java b/base/common/src/com/netscape/certsrv/tps/connector/ConnectorClient.java index 4a86f1eae..7870a7d4d 100644 --- a/base/common/src/com/netscape/certsrv/tps/connector/ConnectorClient.java +++ b/base/common/src/com/netscape/certsrv/tps/connector/ConnectorClient.java @@ -29,7 +29,7 @@ import com.netscape.certsrv.client.PKIClient; */ public class ConnectorClient extends Client { - public ConnectionResource resource; + public ConnectorResource resource; public ConnectorClient(PKIClient client, String subsystem) throws URISyntaxException { super(client, subsystem, "connector"); @@ -37,36 +37,36 @@ public class ConnectorClient extends Client { } public void init() throws URISyntaxException { - resource = createProxy(ConnectionResource.class); + resource = createProxy(ConnectorResource.class); } public ConnectorCollection findConnectors(String filter, Integer start, Integer size) { - Response response = resource.findConnections(filter, start, size); + Response response = resource.findConnectors(filter, start, size); return client.getEntity(response, ConnectorCollection.class); } public ConnectorData getConnector(String connectorID) { - Response response = resource.getConnection(connectorID); + Response response = resource.getConnector(connectorID); return client.getEntity(response, ConnectorData.class); } public ConnectorData addConnector(ConnectorData connectorData) { - Response response = resource.addConnection(connectorData); + Response response = resource.addConnector(connectorData); return client.getEntity(response, ConnectorData.class); } public ConnectorData updateConnector(String connectorID, ConnectorData connectorData) { - Response response = resource.updateConnection(connectorID, connectorData); + Response response = resource.updateConnector(connectorID, connectorData); return client.getEntity(response, ConnectorData.class); } public ConnectorData changeConnectorStatus(String connectorID, String action) { - Response response = resource.changeConnectionStatus(connectorID, action); + Response response = resource.changeConnectorStatus(connectorID, action); return client.getEntity(response, ConnectorData.class); } public void removeConnector(String connectorID) { - Response response = resource.removeConnection(connectorID); + Response response = resource.removeConnector(connectorID); client.getEntity(response, Void.class); } } diff --git a/base/common/src/com/netscape/certsrv/tps/connector/ConnectorResource.java b/base/common/src/com/netscape/certsrv/tps/connector/ConnectorResource.java new file mode 100644 index 000000000..9df4bffca --- /dev/null +++ b/base/common/src/com/netscape/certsrv/tps/connector/ConnectorResource.java @@ -0,0 +1,81 @@ +// --- 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) 2013 Red Hat, Inc. +// All rights reserved. +// --- END COPYRIGHT BLOCK --- +package com.netscape.certsrv.tps.connector; + +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.Response; + +import org.jboss.resteasy.annotations.ClientResponseType; + +import com.netscape.certsrv.acls.ACLMapping; +import com.netscape.certsrv.authentication.AuthMethodMapping; +import com.netscape.certsrv.base.PATCH; + + +/** + * @author Endi S. Dewata + */ +@Path("connectors") +@AuthMethodMapping("connectors") +@ACLMapping("connectors.read") +public interface ConnectorResource { + + @GET + @ClientResponseType(entityType=ConnectorCollection.class) + public Response findConnectors( + @QueryParam("filter") String filter, + @QueryParam("start") Integer start, + @QueryParam("size") Integer size); + + @GET + @Path("{connectorID}") + @ClientResponseType(entityType=ConnectorData.class) + public Response getConnector(@PathParam("connectorID") String connectorID); + + @POST + @ACLMapping("connectors.add") + @ClientResponseType(entityType=ConnectorData.class) + public Response addConnector(ConnectorData connectorData); + + @PATCH + @Path("{connectorID}") + @ACLMapping("connectors.modify") + @ClientResponseType(entityType=ConnectorData.class) + public Response updateConnector( + @PathParam("connectorID") String connectorID, + ConnectorData connectorData); + + @POST + @Path("{connectorID}") + @ACLMapping("connectors.approve") + @ClientResponseType(entityType=ConnectorData.class) + public Response changeConnectorStatus( + @PathParam("connectorID") String connectorID, + @QueryParam("action") String action); + + @DELETE + @Path("{connectorID}") + @ClientResponseType(entityType=Void.class) + @ACLMapping("connectors.remove") + public Response removeConnector(@PathParam("connectorID") String connectorID); +} -- cgit