/*
- * Copyright (c) 2015 Intel Corporation and others. All rights reserved.
+ * Copyright (c) 2018 Intel Corporation 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 static org.opendaylight.neutron.spi.INeutronCRUD.Result.DependencyMissing;
+import static org.opendaylight.neutron.spi.INeutronCRUD.Result.DoesNotExist;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.Objects;
import javax.ws.rs.core.Response;
import org.opendaylight.neutron.spi.INeutronCRUD;
+import org.opendaylight.neutron.spi.INeutronCRUD.Result;
import org.opendaylight.neutron.spi.INeutronObject;
public abstract class AbstractNeutronNorthbound<T extends INeutronObject<T>, R extends INeutronRequest<T>,
/*
* update the object and return it
*/
- if (!neutronCRUD.update(uuid, delta)) {
+ Result updateResult = neutronCRUD.update(uuid, delta);
+ if (updateResult.equals(DoesNotExist)) {
throw new ResourceNotFoundException(uuidNoExist());
}
T updated = neutronCRUD.get(uuid);