import org.codehaus.enunciate.jaxrs.TypeHint;
import org.opendaylight.controller.northbound.commons.RestMessages;
import org.opendaylight.controller.northbound.commons.exception.BadRequestException;
-import org.opendaylight.controller.northbound.commons.exception.ResourceConflictException;
import org.opendaylight.controller.northbound.commons.exception.ServiceUnavailableException;
import org.opendaylight.controller.northbound.commons.exception.UnauthorizedException;
import org.opendaylight.controller.northbound.commons.utils.NorthboundUtils;
return username;
}
- private void handleNameMismatch(String name, String nameinURL) {
- if (name == null || nameinURL == null) {
- throw new BadRequestException(RestMessages.INVALIDDATA.toString() + " : Name is null");
- }
-
- if (name.equalsIgnoreCase(nameinURL)) {
- return;
- }
- throw new ResourceConflictException(RestMessages.INVALIDDATA.toString()
- + " : Table Name in URL does not match the row name in request body");
- }
-
/**
* Create a Row for Open_vSwitch schema
*
OvsdbClient client = connectionService.getConnection(node).getClient();
String bckCompatibleTableName = this.getBackwardCompatibleTableName(client, OvsVswitchdSchemaConstants.DATABASE_NAME, tableName);
- Row row = null;
+ Row row;
try {
row = ovsdbTable.getRow(node, bckCompatibleTableName, rowUuid);
} catch (Exception e) {
Node node = connectionService.getNode(nodeId);
OvsdbClient client = connectionService.getConnection(node).getClient();
String bckCompatibleTableName = this.getBackwardCompatibleTableName(client, OvsVswitchdSchemaConstants.DATABASE_NAME, tableName);
- Map<String, Row> rows = null;
+ Map<String, Row> rows;
try {
rows = ovsdbTable.getRows(node, bckCompatibleTableName);
} catch (Exception e) {
return Response.status(Response.Status.BAD_REQUEST).build();
}
- Status status = ovsdbTable.updateRow(node, bckCompatibleTableName, localRow.getParentUuid(), rowUuid, localRow.getRow());
+ ovsdbTable.updateRow(node, bckCompatibleTableName, localRow.getParentUuid(), rowUuid, localRow.getRow());
return NorthboundUtils.getResponse(
new org.opendaylight.controller.sal.utils.Status(
org.opendaylight.controller.sal.utils.StatusCode.SUCCESS));