* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.neutron.northbound.api;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Response;
/**
- * Status Code 400 (Bad Request)
+ * Status Code 400 = Bad Request.
*
* <p>
* The request could not be understood by the server due to malformed syntax.
+++ /dev/null
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.neutron.northbound.api;
-
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-/**
- * Status Code 500 (Internal Server Error)
- *
- * <p>
- * The server encountered an unexpected condition which prevented
- * it from fulfilling the request.
- *
- *
- *
- */
-public class InternalServerErrorException extends WebApplicationException {
- private static final long serialVersionUID = 1L;
-
- /**
- * Constructor for the INTERNAL_SERVER_ERROR custom handler.
- *
- * @param string Error message to specify further the
- * INTERNAL_SERVER_ERROR response
- *
- */
- public InternalServerErrorException(String string) {
- super(Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(string).type(MediaType.TEXT_PLAIN).build());
- }
-}
// sorting not supported
) {
INeutronRouterCRUD routerInterface = getNeutronCRUD();
- if (routerInterface == null) {
- throw new ServiceUnavailableException(serviceUnavailable());
- }
List<NeutronRouter> allRouters = routerInterface.getAll();
List<NeutronRouter> ans = new ArrayList<>();
for (NeutronRouter router : allRouters) {
+++ /dev/null
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.neutron.northbound.api;
-
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-/**
- * Status Code 409 (Conflict)
- *
- * <p>
- * The request could not be completed due to a conflict with the
- * current state of the resource. This code is only allowed in
- * situations where it is expected that the user might be able to
- * resolve the conflict and resubmit the request. The response body
- * SHOULD include enough information for the user to recognize the
- * source of the conflict. Ideally, the response entity would include
- * enough information for the user or user agent to fix the problem;
- * however, that might not be possible and is not required.
- *
- *
- *
- */
-public class ResourceConflictException extends WebApplicationException {
- private static final long serialVersionUID = 1L;
-
- public ResourceConflictException(String string) {
- super(Response.status(Response.Status.CONFLICT).entity(string).type(MediaType.TEXT_PLAIN).build());
- }
-}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.neutron.northbound.api;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Response;
/**
- * Status Code 404 (Not Found)
+ * Status Code 404 = Not Found.
*
* <p>
* The server has not found anything matching the Request-URI.
* This status code is commonly used when the server does not wish to
* reveal exactly why the request has been refused, or when no other
* response is applicable.
- *
- *
- *
*/
public class ResourceNotFoundException extends WebApplicationException {
private static final long serialVersionUID = 1L;
+++ /dev/null
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.neutron.northbound.api;
-
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-/**
- * Status Code 503 (Service Unavailable Error)
- *
- * <p>
- * The server is currently unable to handle the request due to a temporary
- * overloading or maintenance of the server.
- * The implication is that this is a temporary condition which will be alleviated
- * after some delay.
- *
- *
- */
-public class ServiceUnavailableException extends WebApplicationException {
- private static final long serialVersionUID = 1L;
-
- /**
- * Constructor for the SERVICE_UNAVAILABLE custom handler.
- *
- * @param string Error message to specify further the
- * SERVICE_UNAVAILABLE response
- *
- */
- public ServiceUnavailableException(String string) {
- super(Response.status(Response.Status.SERVICE_UNAVAILABLE).entity(string).type(MediaType.TEXT_PLAIN).build());
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.neutron.northbound.api;
-
-import java.net.HttpURLConnection;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-/**
- * Status Code 501 (Not Implemented Error)
- *
- * <p>
- * The function is not implemented.
- *
- */
-public class UnimplementedException extends WebApplicationException {
- private static final long serialVersionUID = 1L;
-
- /**
- * Constructor for the NOT_IMPLEMENTED custom handler.
- *
- * @param string Error message to specify further the
- * SERVICE_UNAVAILABLE response
- *
- */
- public UnimplementedException(String string) {
- super(Response.status(HttpURLConnection.HTTP_NOT_IMPLEMENTED).entity(string).type(MediaType.TEXT_PLAIN)
- .build());
- }
-}