Jian Li

Explicitly return NO CONTENT type response for http DELETE request

Change-Id: I920084b92197bb1687e7d978ad350b2e1290ecbc
Showing 38 changed files with 262 additions and 271 deletions
......@@ -113,25 +113,25 @@ public class AclWebResource extends AbstractWebResource {
* Remove ACL rule.
*
* @param id ACL rule id (in hex string format)
* @return 200 OK
* @return 204 NO CONTENT
*/
@DELETE
@Path("{id}")
public Response removeAclRule(@PathParam("id") String id) {
RuleId ruleId = new RuleId(Long.parseLong(id.substring(2), 16));
get(AclService.class).removeAclRule(ruleId);
return Response.ok().build();
return Response.noContent().build();
}
/**
* Remove all ACL rules.
*
* @return 200 OK
* @return 204 NO CONTENT
*/
@DELETE
public Response clearAcl() {
get(AclService.class).clearAcl();
return Response.ok().build();
return Response.noContent().build();
}
/**
......
......@@ -58,10 +58,8 @@ public class NeutronMl2NetworksWebResource extends AbstractWebResource {
@DELETE
@Path("{id}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response deleteNetwork(@PathParam("id") String id) {
log.trace(String.format(NETWORKS_MESSAGE, "delete"));
return Response.status(Response.Status.OK).build();
return Response.noContent().build();
}
}
......
......@@ -108,10 +108,8 @@ public class NeutronMl2PortsWebResource extends AbstractWebResource {
@Path("{id}")
@DELETE
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response deletePorts(@PathParam("id") String id) {
log.trace(String.format(PORTS_MESSAGE, "delete"));
return Response.status(Response.Status.OK).build();
return Response.noContent().build();
}
}
......
......@@ -60,10 +60,8 @@ public class NeutronMl2SubnetsWebResource extends AbstractWebResource {
@DELETE
@Path("{id}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response deleteSubnet(@PathParam("id") String id) {
log.trace(String.format(SUBNETS_MESSAGE, "delete"));
return Response.status(Response.Status.OK).build();
return Response.noContent().build();
}
}
......
......@@ -79,14 +79,13 @@ public class ServiceDependencyWebResource extends AbstractWebResource {
*
* @param tServiceId tenant service id
* @param pServiceId provider service id
* @return 200 OK, or 400 Bad Request
* @return 204 NO CONTENT
*/
@DELETE
@Path("{tenantServiceId}/{providerServiceId}")
@Produces(MediaType.APPLICATION_JSON)
public Response removeServiceDependency(@PathParam("tenantServiceId") String tServiceId,
@PathParam("providerServiceId") String pServiceId) {
service.removeServiceDependency(CordServiceId.of(tServiceId), CordServiceId.of(pServiceId));
return Response.status(Response.Status.OK).build();
return Response.noContent().build();
}
}
......
......@@ -14,11 +14,15 @@
*/
package org.onosproject.kafkaintegration.rest;
import static com.google.common.base.Preconditions.checkNotNull;
import static javax.ws.rs.core.Response.Status.BAD_REQUEST;
import java.io.IOException;
import java.io.InputStream;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.onosproject.codec.JsonCodec;
import org.onosproject.kafkaintegration.api.EventExporterService;
import org.onosproject.kafkaintegration.api.dto.EventSubscriber;
import org.onosproject.kafkaintegration.api.dto.EventSubscriberGroupId;
import org.onosproject.rest.AbstractWebResource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
......@@ -27,17 +31,11 @@ import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.io.IOException;
import java.io.InputStream;
import org.onosproject.codec.JsonCodec;
import org.onosproject.kafkaintegration.api.EventExporterService;
import org.onosproject.kafkaintegration.api.dto.EventSubscriber;
import org.onosproject.kafkaintegration.api.dto.EventSubscriberGroupId;
import org.onosproject.rest.AbstractWebResource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import static com.google.common.base.Preconditions.checkNotNull;
import static javax.ws.rs.core.Response.Status.BAD_REQUEST;
/**
* Rest Interfaces for subscribing/unsubscribing to event notifications.
......@@ -85,8 +83,6 @@ public class EventExporterWebResource extends AbstractWebResource {
* @onos.rsModel KafkaRegistration
*/
@DELETE
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Path("unregister")
public Response removeKafkaListener(String appName) {
EventExporterService service = get(EventExporterService.class);
......@@ -148,7 +144,7 @@ public class EventExporterWebResource extends AbstractWebResource {
* @onos.rsModel KafkaSubscription
*/
@DELETE
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Path("unsubscribe")
public Response unsubscribe(InputStream input) {
......
......@@ -66,10 +66,9 @@ public class OltWebResource extends AbstractWebResource {
*
* @param device device id
* @param port port number
* @return 200 OK
* @return 204 NO CONTENT
*/
@DELETE
@Produces(MediaType.APPLICATION_JSON)
@Path("{device}/{port}")
public Response removeSubscriber(
@PathParam("device")String device,
......@@ -79,6 +78,6 @@ public class OltWebResource extends AbstractWebResource {
PortNumber portNumber = PortNumber.portNumber(port);
ConnectPoint connectPoint = new ConnectPoint(deviceId, portNumber);
service.removeSubscriber(connectPoint);
return ok("").build();
return Response.noContent().build();
}
}
......
......@@ -143,7 +143,6 @@ public class OpensatckRouterWebResource extends AbstractWebResource {
@DELETE
@Path("{id}")
@Produces(MediaType.APPLICATION_JSON)
public Response deleteRouter(@PathParam("id") String id) {
checkNotNull(id);
OpenstackRoutingService routingService
......@@ -151,7 +150,7 @@ public class OpensatckRouterWebResource extends AbstractWebResource {
routingService.deleteRouter(id);
log.debug("REST API DELETE routers is called {}", id);
return Response.status(Response.Status.OK).build();
return Response.noContent().build();
}
@PUT
......
......@@ -125,7 +125,7 @@ public class OpenstackFloatingIpWebResource extends AbstractWebResource {
* Delete FloatingIP.
*
* @param id FloatingIP identifier
* @return 200 OK
* @return 204 OK
*/
@DELETE
@Path("{id}")
......@@ -139,7 +139,7 @@ public class OpenstackFloatingIpWebResource extends AbstractWebResource {
log.debug("REST API DELETE floatingip is called {}", id);
return Response.status(Response.Status.OK).build();
return Response.noContent().build();
}
}
......
......@@ -57,9 +57,8 @@ public class OpenstackNetworkWebResource extends AbstractWebResource {
@DELETE
@Path("{id}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response deleteNetwork(InputStream input) {
log.debug("REST API networks is called {}", input.toString());
return Response.status(Response.Status.OK).build();
return Response.noContent().build();
}
}
......
......@@ -72,7 +72,6 @@ public class OpenstackPortWebResource extends AbstractWebResource {
}
@Path("{portUUID}")
@Produces(MediaType.APPLICATION_JSON)
@DELETE
public Response deletePorts(@PathParam("portUUID") String id) {
OpenstackSwitchingService switchingService =
......@@ -85,7 +84,7 @@ public class OpenstackPortWebResource extends AbstractWebResource {
switchingService.removePort(id);
return Response.status(Response.Status.OK).build();
return Response.noContent().build();
}
@PUT
......
......@@ -57,10 +57,7 @@ public class OpenstackSubnetWebResource extends AbstractWebResource {
@DELETE
@Path("{subnetId}")
@Produces(MediaType.APPLICATION_JSON)
public Response deleteSubnet(@PathParam("subnetId") String id) {
return Response.status(Response.Status.OK).build();
return Response.noContent().build();
}
}
......
......@@ -64,7 +64,6 @@ public class PolicyWebResource extends AbstractWebResource {
*
* @param input JSON stream for policy to create
* @return status of the request - OK if the policy is created,
* INTERNAL_SERVER_ERROR if the JSON is invalid or the policy cannot be created
* @throws IOException if JSON processing fails
*/
@POST
......@@ -87,8 +86,7 @@ public class PolicyWebResource extends AbstractWebResource {
* Delete a segment routing policy.
*
* @param input JSON stream for policy to delete
* @return status of the request - OK if the policy is removed,
* INTERNAL_SERVER_ERROR otherwise
* @return 204 NO CONTENT if the policy is removed
* @throws IOException if JSON is invalid
*/
@DELETE
......@@ -101,8 +99,7 @@ public class PolicyWebResource extends AbstractWebResource {
// TODO: Check the result
srService.removePolicy(policyInfo);
return Response.ok().build();
return Response.noContent().build();
}
}
......
......@@ -64,7 +64,6 @@ public class TunnelWebResource extends AbstractWebResource {
*
* @param input JSON stream for tunnel to create
* @return status of the request - OK if the tunnel is created,
* INTERNAL_SERVER_ERROR if the JSON is invalid or the tunnel cannot be created
* @throws IOException if the JSON is invalid
*/
@POST
......@@ -83,8 +82,7 @@ public class TunnelWebResource extends AbstractWebResource {
* Delete a segment routing tunnel.
*
* @param input JSON stream for tunnel to delete
* @return status of the request - OK if the tunnel is removed,
* INTERNAL_SERVER_ERROR otherwise
* @return 204 NO CONTENT, if the tunnel is removed
* @throws IOException if JSON is invalid
*/
@DELETE
......@@ -96,7 +94,7 @@ public class TunnelWebResource extends AbstractWebResource {
Tunnel tunnelInfo = TUNNEL_CODEC.decode(tunnelJson, this);
srService.removeTunnel(tunnelInfo);
return Response.ok().build();
return Response.noContent().build();
}
}
......
......@@ -89,15 +89,16 @@ public class VbngResource extends AbstractWebResource {
* Delete a virtual BNG connection.
*
* @param privateIp IP Address for the BNG private network
* @return public IP address for the new connection
* @return 200 OK
*/
@DELETE
@Path("{privateip}")
public String privateIpDeleteNotification(@PathParam("privateip")
public Response privateIpDeleteNotification(@PathParam("privateip")
String privateIp) {
String result;
if (privateIp == null) {
log.info("Private IP address to delete is null");
return "0";
result = "0";
}
log.info("Received a private IP address : {} to delete", privateIp);
IpAddress privateIpAddress = IpAddress.valueOf(privateIp);
......@@ -109,10 +110,11 @@ public class VbngResource extends AbstractWebResource {
assignedPublicIpAddress = vbngService.deleteVbng(privateIpAddress);
if (assignedPublicIpAddress != null) {
return assignedPublicIpAddress.toString();
result = assignedPublicIpAddress.toString();
} else {
return "0";
result = "0";
}
return Response.ok().entity(result).build();
}
/**
......
......@@ -15,54 +15,51 @@
*/
package org.onosproject.vtnweb.resources;
import static com.google.common.base.Preconditions.checkNotNull;
import static javax.ws.rs.core.Response.Status.BAD_REQUEST;
import static javax.ws.rs.core.Response.Status.NOT_FOUND;
import static javax.ws.rs.core.Response.Status.CREATED;
import static javax.ws.rs.core.Response.Status.CONFLICT;
import static javax.ws.rs.core.Response.Status.NO_CONTENT;
import java.io.IOException;
import java.io.InputStream;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.google.common.collect.Sets;
import org.onlab.packet.IpAddress;
import org.onlab.util.ItemNotFoundException;
import org.onosproject.rest.AbstractWebResource;
import org.onosproject.vtnrsc.DefaultFloatingIp;
import org.onosproject.vtnrsc.FloatingIp;
import org.onosproject.vtnrsc.FloatingIp.Status;
import org.onosproject.vtnrsc.FloatingIpId;
import org.onosproject.vtnrsc.RouterId;
import org.onosproject.vtnrsc.TenantId;
import org.onosproject.vtnrsc.TenantNetworkId;
import org.onosproject.vtnrsc.VirtualPortId;
import org.onosproject.vtnrsc.RouterId;
import org.onosproject.vtnrsc.FloatingIp.Status;
import org.onosproject.vtnrsc.floatingip.FloatingIpService;
import org.onosproject.vtnweb.web.FloatingIpCodec;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.google.common.collect.Sets;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.io.IOException;
import java.io.InputStream;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import static com.google.common.base.Preconditions.checkNotNull;
import static javax.ws.rs.core.Response.Status.BAD_REQUEST;
import static javax.ws.rs.core.Response.Status.CONFLICT;
import static javax.ws.rs.core.Response.Status.CREATED;
import static javax.ws.rs.core.Response.Status.NOT_FOUND;
@Path("floatingips")
public class FloatingIpWebResource extends AbstractWebResource {
......@@ -165,7 +162,7 @@ public class FloatingIpWebResource extends AbstractWebResource {
if (!result) {
return Response.status(CONFLICT).entity(DELETE_FAIL).build();
}
return Response.status(NO_CONTENT).entity(DELETE_SUCCESS).build();
return Response.noContent().entity(DELETE_SUCCESS).build();
} catch (Exception e) {
return Response.status(NOT_FOUND).entity(e.getMessage()).build();
}
......
......@@ -149,16 +149,16 @@ public class FlowClassifierWebResource extends AbstractWebResource {
/**
* Delete details of a flow classifier.
*
* @param id
* flow classifier id
* @param id flow classifier id
* @return 204 NO CONTENT
*/
@Path("{flow_id}")
@DELETE
public void deleteFlowClassifier(@PathParam("flow_id") String id) {
public Response deleteFlowClassifier(@PathParam("flow_id") String id) {
log.debug("Deletes flow classifier by identifier {}.", id);
FlowClassifierId flowClassifierId = FlowClassifierId.of(id);
Boolean issuccess = nullIsNotFound(get(FlowClassifierService.class).removeFlowClassifier(flowClassifierId),
FLOW_CLASSIFIER_NOT_FOUND);
return Response.noContent().build();
}
}
......
......@@ -146,10 +146,11 @@ public class PortChainWebResource extends AbstractWebResource {
* Delete details of a specified port chain id.
*
* @param id port chain id
* @return 204 NO CONTENT
*/
@Path("{chain_id}")
@DELETE
public void deletePortPain(@PathParam("chain_id") String id) {
public Response deletePortPain(@PathParam("chain_id") String id) {
log.debug("Deletes port chain by identifier {}.", id);
PortChainId portChainId = PortChainId.of(id);
......@@ -158,5 +159,6 @@ public class PortChainWebResource extends AbstractWebResource {
if (!issuccess) {
log.debug("Port Chain identifier {} does not exist", id);
}
return Response.noContent().build();
}
}
......
......@@ -153,10 +153,11 @@ public class PortPairGroupWebResource extends AbstractWebResource {
* Delete details of a specified port pair group id.
*
* @param id port pair group id
* @return 204 NO CONTENT
*/
@Path("{group_id}")
@DELETE
public void deletePortPairGroup(@PathParam("group_id") String id) {
public Response deletePortPairGroup(@PathParam("group_id") String id) {
log.debug("Deletes port pair group by identifier {}.", id);
PortPairGroupId portPairGroupId = PortPairGroupId.of(id);
Boolean issuccess = nullIsNotFound(get(PortPairGroupService.class).removePortPairGroup(portPairGroupId),
......@@ -164,5 +165,7 @@ public class PortPairGroupWebResource extends AbstractWebResource {
if (!issuccess) {
log.debug("Port pair group identifier {} does not exist", id);
}
return Response.noContent().build();
}
}
......
......@@ -145,15 +145,17 @@ public class PortPairWebResource extends AbstractWebResource {
* Delete details of a specified port pair id.
*
* @param id port pair id
* @return 204 NO CONTENT
*/
@Path("{pair_id}")
@DELETE
public void deletePortPair(@PathParam("pair_id") String id) {
public Response deletePortPair(@PathParam("pair_id") String id) {
PortPairId portPairId = PortPairId.of(id);
Boolean isSuccess = nullIsNotFound(get(PortPairService.class).removePortPair(portPairId), PORT_PAIR_NOT_FOUND);
if (!isSuccess) {
log.debug("Port pair identifier {} does not exist", id);
}
return Response.noContent().build();
}
}
......
......@@ -15,37 +15,11 @@
*/
package org.onosproject.vtnweb.resources;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static javax.ws.rs.core.Response.Status.BAD_REQUEST;
import static javax.ws.rs.core.Response.Status.CONFLICT;
import static javax.ws.rs.core.Response.Status.CREATED;
import static javax.ws.rs.core.Response.Status.NOT_FOUND;
import static javax.ws.rs.core.Response.Status.NO_CONTENT;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentMap;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import org.onlab.packet.IpAddress;
import org.onlab.util.ItemNotFoundException;
import org.onosproject.rest.AbstractWebResource;
......@@ -66,11 +40,34 @@ import org.onosproject.vtnweb.web.RouterCodec;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentMap;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static javax.ws.rs.core.Response.Status.BAD_REQUEST;
import static javax.ws.rs.core.Response.Status.CONFLICT;
import static javax.ws.rs.core.Response.Status.CREATED;
import static javax.ws.rs.core.Response.Status.NOT_FOUND;
@Path("routers")
public class RouterWebResource extends AbstractWebResource {
......@@ -168,7 +165,7 @@ public class RouterWebResource extends AbstractWebResource {
RouterId routerId = RouterId.valueOf(id);
Set<RouterId> routerIds = Sets.newHashSet(routerId);
get(RouterService.class).removeRouters(routerIds);
return Response.status(NO_CONTENT).entity(DELETE_SUCCESS).build();
return Response.noContent().entity(DELETE_SUCCESS).build();
} catch (Exception e) {
return Response.status(BAD_REQUEST).entity(e.getMessage()).build();
}
......
......@@ -158,7 +158,7 @@ public class SubnetWebResource extends AbstractWebResource {
Set<SubnetId> subIds = new HashSet<>();
subIds.add(subId);
get(SubnetService.class).removeSubnets(subIds);
return Response.status(201).entity("SUCCESS").build();
return Response.noContent().entity("SUCCESS").build();
} catch (Exception e) {
return Response.status(INTERNAL_SERVER_ERROR).entity(e.toString())
.build();
......
......@@ -15,31 +15,10 @@
*/
package org.onosproject.vtnweb.resources;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkArgument;
import static javax.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR;
import static javax.ws.rs.core.Response.Status.OK;
import static javax.ws.rs.core.Response.Status.NOT_FOUND;
import java.io.InputStream;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import java.util.concurrent.ConcurrentMap;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.google.common.collect.Maps;
import org.onlab.util.ItemNotFoundException;
import org.onosproject.rest.AbstractWebResource;
import org.onosproject.vtnrsc.DefaultTenantNetwork;
......@@ -47,18 +26,37 @@ import org.onosproject.vtnrsc.PhysicalNetwork;
import org.onosproject.vtnrsc.SegmentationId;
import org.onosproject.vtnrsc.TenantId;
import org.onosproject.vtnrsc.TenantNetwork;
import org.onosproject.vtnrsc.TenantNetworkId;
import org.onosproject.vtnrsc.TenantNetwork.State;
import org.onosproject.vtnrsc.TenantNetwork.Type;
import org.onosproject.vtnrsc.TenantNetworkId;
import org.onosproject.vtnrsc.tenantnetwork.TenantNetworkService;
import org.onosproject.vtnweb.web.TenantNetworkCodec;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.google.common.collect.Maps;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.io.InputStream;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import java.util.concurrent.ConcurrentMap;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static javax.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR;
import static javax.ws.rs.core.Response.Status.NOT_FOUND;
import static javax.ws.rs.core.Response.Status.OK;
/**
* REST resource for interacting with the inventory of networks.
......@@ -253,7 +251,7 @@ public class TenantNetworkWebResource extends AbstractWebResource {
return Response.status(INTERNAL_SERVER_ERROR)
.entity(NETWORK_ID_NOT_EXIST).build();
}
return Response.status(OK).entity(issuccess.toString()).build();
return ok(issuccess.toString()).build();
}
/**
......
......@@ -15,32 +15,11 @@
*/
package org.onosproject.vtnweb.resources;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static javax.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR;
import static javax.ws.rs.core.Response.Status.OK;
import static javax.ws.rs.core.Response.Status.NOT_FOUND;
import java.io.InputStream;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentMap;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import org.onlab.packet.IpAddress;
import org.onlab.packet.MacAddress;
import org.onlab.util.ItemNotFoundException;
......@@ -62,11 +41,30 @@ import org.onosproject.vtnweb.web.VirtualPortCodec;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.io.InputStream;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentMap;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static javax.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR;
import static javax.ws.rs.core.Response.Status.NOT_FOUND;
import static javax.ws.rs.core.Response.Status.OK;
/**
* REST resource for interacting with the inventory of infrastructure
......@@ -146,7 +144,7 @@ public class VirtualPortWebResource extends AbstractWebResource {
return Response.status(INTERNAL_SERVER_ERROR)
.entity(VPORT_ID_NOT_EXIST).build();
}
return Response.status(OK).entity(issuccess.toString()).build();
return ok(issuccess.toString()).build();
} catch (Exception e) {
log.error("Deletes VirtualPort failed because of exception {}",
e.toString());
......
......@@ -104,16 +104,15 @@ public class ApplicationsWebResource extends AbstractWebResource {
* Uninstalls the specified application deactivating it first if necessary.
*
* @param name application name
* @return 200 OK; 404; 401
* @return 204 NO CONTENT
*/
@DELETE
@Produces(MediaType.APPLICATION_JSON)
@Path("{name}")
public Response uninstallApp(@PathParam("name") String name) {
ApplicationAdminService service = get(ApplicationAdminService.class);
ApplicationId appId = service.getId(name);
service.uninstall(appId);
return Response.ok().build();
return Response.noContent().build();
}
/**
......
......@@ -20,11 +20,13 @@ import org.onosproject.cfg.ComponentConfigService;
import org.onosproject.cfg.ConfigProperty;
import org.onosproject.rest.AbstractWebResource;
import javax.ws.rs.Consumes;
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.core.MediaType;
import javax.ws.rs.core.Response;
import java.io.IOException;
import java.io.InputStream;
......@@ -87,6 +89,7 @@ public class ComponentConfigWebResource extends AbstractWebResource {
* @throws IOException to signify bad request
*/
@POST
@Consumes(MediaType.APPLICATION_JSON)
@Path("{component}")
public Response setConfigs(@PathParam("component") String component,
InputStream request) throws IOException {
......@@ -103,10 +106,11 @@ public class ComponentConfigWebResource extends AbstractWebResource {
*
* @param component component name
* @param request JSON configuration
* @return 200 OK
* @return 204 NO CONTENT
* @throws IOException to signify bad request
*/
@DELETE
@Consumes(MediaType.APPLICATION_JSON)
@Path("{component}")
public Response unsetConfigs(@PathParam("component") String component,
InputStream request) throws IOException {
......
......@@ -224,11 +224,12 @@ public class FlowsWebResource extends AbstractWebResource {
*
* @param deviceId device identifier
* @param flowId flow rule identifier
* @return 204 NO CONTENT
*/
@DELETE
@Produces(MediaType.APPLICATION_JSON)
@Path("{deviceId}/{flowId}")
public void deleteFlowByDeviceIdAndFlowId(@PathParam("deviceId") String deviceId,
public Response deleteFlowByDeviceIdAndFlowId(@PathParam("deviceId") String deviceId,
@PathParam("flowId") long flowId) {
final Iterable<FlowEntry> flowEntries =
service.getFlowEntries(DeviceId.deviceId(deviceId));
......@@ -240,16 +241,18 @@ public class FlowsWebResource extends AbstractWebResource {
StreamSupport.stream(flowEntries.spliterator(), false)
.filter(entry -> entry.id().value() == flowId)
.forEach(service::removeFlowRules);
return Response.noContent().build();
}
/**
* Removes a batch of flow rules.
*
* @param stream stream for posted JSON
* @return NO CONTENT
*/
@DELETE
@Produces(MediaType.APPLICATION_JSON)
public void deleteFlows(InputStream stream) {
public Response deleteFlows(InputStream stream) {
ListMultimap<DeviceId, Long> deviceMap = ArrayListMultimap.create();
List<FlowEntry> rulesToRemove = new ArrayList<>();
......@@ -283,6 +286,7 @@ public class FlowsWebResource extends AbstractWebResource {
});
service.removeFlowRules(rulesToRemove.toArray(new FlowEntry[0]));
return Response.noContent().build();
}
}
......
......@@ -172,15 +172,17 @@ public class GroupsWebResource extends AbstractWebResource {
*
* @param deviceId device identifier
* @param appCookie application cookie to be used for lookup
* @return 204 NO CONTENT
*/
@DELETE
@Produces(MediaType.APPLICATION_JSON)
@Path("{deviceId}/{appCookie}")
public void deleteGroupByDeviceIdAndAppCookie(@PathParam("deviceId") String deviceId,
public Response deleteGroupByDeviceIdAndAppCookie(@PathParam("deviceId") String deviceId,
@PathParam("appCookie") String appCookie) {
DeviceId deviceIdInstance = DeviceId.deviceId(deviceId);
GroupKey appCookieInstance = new DefaultGroupKey(appCookie.getBytes());
groupService.removeGroup(deviceIdInstance, appCookieInstance, null);
return Response.noContent().build();
}
}
......
......@@ -15,25 +15,7 @@
*/
package org.onosproject.rest.resources;
import java.io.IOException;
import java.io.InputStream;
import java.util.Objects;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import javax.ws.rs.Consumes;
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.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriBuilder;
import javax.ws.rs.core.UriInfo;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.onosproject.core.ApplicationId;
import org.onosproject.core.CoreService;
import org.onosproject.net.intent.HostToHostIntent;
......@@ -47,7 +29,23 @@ import org.onosproject.net.intent.PointToPointIntent;
import org.onosproject.rest.AbstractWebResource;
import org.slf4j.Logger;
import com.fasterxml.jackson.databind.node.ObjectNode;
import javax.ws.rs.Consumes;
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.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriBuilder;
import javax.ws.rs.core.UriInfo;
import java.io.IOException;
import java.io.InputStream;
import java.util.Objects;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import static org.onlab.util.Tools.nullIsNotFound;
import static org.onosproject.net.intent.IntentState.FAILED;
......@@ -168,10 +166,11 @@ public class IntentsWebResource extends AbstractWebResource {
*
* @param appId application identifier
* @param key intent key
* @return 204 NO CONTENT
*/
@DELETE
@Path("{appId}/{key}")
public void deleteIntentById(@PathParam("appId") String appId,
public Response deleteIntentById(@PathParam("appId") String appId,
@PathParam("key") String key) {
final ApplicationId app = get(CoreService.class).getAppId(appId);
......@@ -185,10 +184,9 @@ public class IntentsWebResource extends AbstractWebResource {
if (intent == null) {
// No such intent. REST standards recommend a positive status code
// in this case.
return;
return Response.noContent().build();
}
Key k = intent.key();
// set up latch and listener to track uninstall progress
......@@ -216,6 +214,7 @@ public class IntentsWebResource extends AbstractWebResource {
// clean up the listener
service.removeListener(listener);
}
return Response.noContent().build();
}
}
......
......@@ -165,11 +165,11 @@ public class MetersWebResource extends AbstractWebResource {
*
* @param deviceId device identifier
* @param meterId meter identifier
* @return 204 NO CONTENT
*/
@DELETE
@Produces(MediaType.APPLICATION_JSON)
@Path("{deviceId}/{meterId}")
public void deleteMeterByDeviceIdAndMeterId(@PathParam("deviceId") String deviceId,
public Response deleteMeterByDeviceIdAndMeterId(@PathParam("deviceId") String deviceId,
@PathParam("meterId") String meterId) {
DeviceId did = DeviceId.deviceId(deviceId);
MeterId mid = MeterId.meterId(Long.valueOf(meterId));
......@@ -178,6 +178,7 @@ public class MetersWebResource extends AbstractWebResource {
final MeterRequest meterRequest = meterToMeterRequest(tmpMeter, "REMOVE");
meterService.withdraw(meterRequest, tmpMeter.id());
}
return Response.noContent().build();
}
/**
......
......@@ -87,12 +87,12 @@ public class MulticastRouteWebResource extends AbstractWebResource {
* Removes a route from the multicast RIB.
*
* @param stream multicast route JSON
* @return 204 NO CONTENT
* @onos.rsModel McastRoutePost
*/
@DELETE
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public void deleteRoute(InputStream stream) {
public Response deleteRoute(InputStream stream) {
MulticastRouteService service = get(MulticastRouteService.class);
try {
ObjectNode jsonTree = (ObjectNode) mapper().readTree(stream);
......@@ -101,5 +101,6 @@ public class MulticastRouteWebResource extends AbstractWebResource {
} catch (IOException ex) {
throw new IllegalArgumentException(ex);
}
return Response.noContent().build();
}
}
......
......@@ -289,7 +289,7 @@ public class NetworkConfigWebResource extends AbstractWebResource {
/**
* Clear entire network configuration base.
*
* @return empty response
* @return 204 NO CONTENT
*/
@DELETE
@SuppressWarnings("unchecked")
......@@ -299,22 +299,24 @@ public class NetworkConfigWebResource extends AbstractWebResource {
.forEach(subjectClass -> service.getSubjects(subjectClass)
.forEach(subject -> service.getConfigs(subject)
.forEach(config -> service.removeConfig(subject, config.getClass()))));
return Response.ok().build();
return Response.noContent().build();
}
/**
* Clear all network configurations for a subject class.
*
* @param subjectClassKey subject class key
* @return 204 NO CONTENT
*/
@DELETE
@Path("{subjectClassKey}")
@SuppressWarnings("unchecked")
public void delete(@PathParam("subjectClassKey") String subjectClassKey) {
public Response delete(@PathParam("subjectClassKey") String subjectClassKey) {
NetworkConfigService service = get(NetworkConfigService.class);
service.getSubjects(service.getSubjectFactory(subjectClassKey).subjectClass())
.forEach(subject -> service.getConfigs(subject)
.forEach(config -> service.removeConfig(subject, config.getClass())));
return Response.noContent().build();
}
/**
......@@ -322,15 +324,17 @@ public class NetworkConfigWebResource extends AbstractWebResource {
*
* @param subjectClassKey subjectKey class key
* @param subjectKey subjectKey key
* @return 204 NO CONTENT
*/
@DELETE
@Path("{subjectClassKey}/{subjectKey}")
@SuppressWarnings("unchecked")
public void delete(@PathParam("subjectClassKey") String subjectClassKey,
public Response delete(@PathParam("subjectClassKey") String subjectClassKey,
@PathParam("subjectKey") String subjectKey) {
NetworkConfigService service = get(NetworkConfigService.class);
Object s = service.getSubjectFactory(subjectClassKey).createSubject(subjectKey);
service.getConfigs(s).forEach(c -> service.removeConfig(s, c.getClass()));
return Response.noContent().build();
}
/**
......@@ -339,16 +343,18 @@ public class NetworkConfigWebResource extends AbstractWebResource {
* @param subjectClassKey subjectKey class key
* @param subjectKey subjectKey key
* @param configKey configuration class key
* @return 204 NO CONTENT
*/
@DELETE
@Path("{subjectClassKey}/{subjectKey}/{configKey}")
@SuppressWarnings("unchecked")
public void delete(@PathParam("subjectClassKey") String subjectClassKey,
public Response delete(@PathParam("subjectClassKey") String subjectClassKey,
@PathParam("subjectKey") String subjectKey,
@PathParam("configKey") String configKey) {
NetworkConfigService service = get(NetworkConfigService.class);
service.removeConfig(service.getSubjectFactory(subjectClassKey).createSubject(subjectKey),
service.getConfigClass(subjectClassKey, configKey));
return Response.noContent().build();
}
}
......
......@@ -173,11 +173,10 @@ public class RegionsWebResource extends AbstractWebResource {
*/
@DELETE
@Path("{regionId}")
@Produces(MediaType.APPLICATION_JSON)
public Response removeRegion(@PathParam("regionId") String regionId) {
final RegionId rid = RegionId.regionId(regionId);
regionAdminService.removeRegion(rid);
return Response.ok().build();
return Response.noContent().build();
}
/**
......@@ -213,13 +212,12 @@ public class RegionsWebResource extends AbstractWebResource {
*
* @param regionId region identifier
* @param stream deviceIds JSON stream
* @return 200 OK, 404 not found
* @return 204 NO CONTENT
* @onos.rsModel RegionDeviceIds
*/
@DELETE
@Path("{regionId}/devices")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response removeDevices(@PathParam("regionId") String regionId,
InputStream stream) {
final RegionId rid = RegionId.regionId(regionId);
......@@ -230,7 +228,7 @@ public class RegionsWebResource extends AbstractWebResource {
throw new IllegalArgumentException(e);
}
return Response.ok().build();
return Response.noContent().build();
}
/**
......
......@@ -97,7 +97,7 @@ public class TenantWebResource extends AbstractWebResource {
* Removes the specified tenant with the specified tenant identifier.
*
* @param tenantId tenant identifier
* @return 200 OK, 404 not found
* @return 204 NO CONTENT
*/
@DELETE
@Path("{tenantId}")
......@@ -105,7 +105,7 @@ public class TenantWebResource extends AbstractWebResource {
final TenantId tid = TenantId.tenantId(tenantId);
final TenantId existingTid = getExistingTenantId(vnetAdminService, tid);
vnetAdminService.unregisterTenantId(existingTid);
return Response.ok().build();
return Response.noContent().build();
}
/**
......
......@@ -135,14 +135,14 @@ public class VirtualNetworkWebResource extends AbstractWebResource {
* Removes the virtual network with the specified network identifier.
*
* @param networkId network identifier
* @return 200 OK, 404 not found
* @return 204 NO CONTENT
*/
@DELETE
@Path("{networkId}")
public Response removeVirtualNetwork(@PathParam("networkId") long networkId) {
NetworkId nid = NetworkId.networkId(networkId);
vnetAdminService.removeVirtualNetwork(nid);
return Response.ok().build();
return Response.noContent().build();
}
// VirtualDevice
......@@ -203,7 +203,7 @@ public class VirtualNetworkWebResource extends AbstractWebResource {
*
* @param networkId network identifier
* @param deviceId device identifier
* @return 200 OK, 404 not found
* @return 204 NO CONTENT
*/
@DELETE
@Path("{networkId}/devices/{deviceId}")
......@@ -212,7 +212,7 @@ public class VirtualNetworkWebResource extends AbstractWebResource {
NetworkId nid = NetworkId.networkId(networkId);
DeviceId did = DeviceId.deviceId(deviceId);
vnetAdminService.removeVirtualDevice(nid, did);
return Response.ok().build();
return Response.noContent().build();
}
// VirtualPort
......@@ -293,7 +293,7 @@ public class VirtualNetworkWebResource extends AbstractWebResource {
* @param networkId network identifier
* @param deviceId virtual device identifier
* @param portNum virtual port number
* @return 200 OK, 404 not found
* @return 204 NO CONTENT
*/
@DELETE
@Path("{networkId}/devices/{deviceId}/ports/{portNum}")
......@@ -303,7 +303,7 @@ public class VirtualNetworkWebResource extends AbstractWebResource {
NetworkId nid = NetworkId.networkId(networkId);
vnetAdminService.removeVirtualPort(nid, DeviceId.deviceId(deviceId),
PortNumber.portNumber(portNum));
return Response.ok().build();
return Response.noContent().build();
}
// VirtualLink
......@@ -364,7 +364,7 @@ public class VirtualNetworkWebResource extends AbstractWebResource {
*
* @param networkId network identifier
* @param stream virtual link JSON stream
* @return 200 OK, 404 not found
* @return 204 NO CONTENT
* @onos.rsModel VirtualLink
*/
@DELETE
......@@ -386,7 +386,7 @@ public class VirtualNetworkWebResource extends AbstractWebResource {
throw new IllegalArgumentException(e);
}
return Response.ok().build();
return Response.noContent().build();
}
/**
......
......@@ -21,6 +21,7 @@ import com.eclipsesource.json.JsonObject;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
import org.glassfish.jersey.client.ClientProperties;
import org.hamcrest.Description;
import org.hamcrest.TypeSafeMatcher;
import org.junit.Before;
......@@ -383,7 +384,7 @@ public class RegionsResourceTest extends ResourceTest {
WebTarget wt = target();
Response response = wt.path("regions/" + region1.id().toString())
.request().delete();
assertThat(response.getStatus(), is(HttpURLConnection.HTTP_OK));
assertThat(response.getStatus(), is(HttpURLConnection.HTTP_NO_CONTENT));
verify(mockRegionAdminService);
}
......@@ -452,16 +453,16 @@ public class RegionsResourceTest extends ResourceTest {
replay(mockRegionAdminService);
WebTarget wt = target();
WebTarget wt = target()
.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
InputStream jsonStream = RegionsResourceTest.class
.getResourceAsStream("region-deviceIds.json");
// FIXME: need to consider whether to use jsonStream for entry deletion
Response response = wt.path("regions/" +
region1.id().toString() + "/devices")
.request(MediaType.APPLICATION_JSON_TYPE)
.delete();
// assertThat(response.getStatus(), is(HttpURLConnection.HTTP_OK));
// verify(mockRegionAdminService);
.request().method("DELETE", Entity.json(jsonStream));
assertThat(response.getStatus(), is(HttpURLConnection.HTTP_NO_CONTENT));
verify(mockRegionAdminService);
}
}
......
......@@ -289,7 +289,7 @@ public class TenantWebResourceTest extends ResourceTest {
.request(MediaType.APPLICATION_JSON_TYPE)
.delete();
assertThat(response.getStatus(), is(HttpURLConnection.HTTP_OK));
assertThat(response.getStatus(), is(HttpURLConnection.HTTP_NO_CONTENT));
verify(mockVnetAdminService);
}
......
......@@ -486,7 +486,7 @@ public class VirtualNetworkWebResourceTest extends ResourceTest {
.request(MediaType.APPLICATION_JSON_TYPE)
.delete();
assertThat(response.getStatus(), is(HttpURLConnection.HTTP_OK));
assertThat(response.getStatus(), is(HttpURLConnection.HTTP_NO_CONTENT));
verify(mockVnetAdminService);
}
......@@ -662,7 +662,7 @@ public class VirtualNetworkWebResourceTest extends ResourceTest {
.request(MediaType.APPLICATION_JSON_TYPE)
.delete();
assertThat(response.getStatus(), is(HttpURLConnection.HTTP_OK));
assertThat(response.getStatus(), is(HttpURLConnection.HTTP_NO_CONTENT));
verify(mockVnetAdminService);
}
......@@ -828,7 +828,7 @@ public class VirtualNetworkWebResourceTest extends ResourceTest {
.request(MediaType.APPLICATION_JSON_TYPE)
.delete();
assertThat(response.getStatus(), is(HttpURLConnection.HTTP_OK));
assertThat(response.getStatus(), is(HttpURLConnection.HTTP_NO_CONTENT));
verify(mockVnetAdminService);
}
......@@ -1034,7 +1034,7 @@ public class VirtualNetworkWebResourceTest extends ResourceTest {
String reqLocation = "vnets/" + networkId.toString() + "/links";
Response response = wt.path(reqLocation).request().method("DELETE", Entity.json(jsonStream));
assertThat(response.getStatus(), is(HttpURLConnection.HTTP_OK));
assertThat(response.getStatus(), is(HttpURLConnection.HTTP_NO_CONTENT));
verify(mockVnetAdminService);
}
}
......