- @ResponseCode(code = 201, condition = "Flow Config processed successfully"),
- @ResponseCode(code = 400, condition = "Failed to create Static Flow entry due to invalid flow configuration"),
- @ResponseCode(code = 401, condition = "User not authorized to perform this operation"),
- @ResponseCode(code = 404, condition = "The Container Name or nodeId is not found"),
- @ResponseCode(code = 406, condition = "Cannot operate on Default Container when other Containers are active"),
- @ResponseCode(code = 409, condition = "Failed to create Static Flow entry due to Conflicting Name or configuration"),
- @ResponseCode(code = 500, condition = "Failed to create Static Flow entry. Failure Reason included in HTTP Error response"),
- @ResponseCode(code = 503, condition = "One or more of Controller services are unavailable") })
- public Response addFlow(
- @PathParam(value = "containerName") String containerName,
- @PathParam(value = "name") String name,
- @PathParam("nodeType") String nodeType,
- @PathParam(value = "nodeId") String nodeId,
- @TypeHint(FlowConfig.class) JAXBElement<FlowConfig> flowConfig) {
-
- if (!NorthboundUtils.isAuthorized(
- getUserName(), containerName, Privilege.WRITE, this)) {
- throw new UnauthorizedException(
- "User is not authorized to perform this operation on container "
- + containerName);
- }
- if (flowConfig.getValue().getNode() == null) {
+ @ResponseCode(code = 201, condition = "Flow Config processed successfully"),
+ @ResponseCode(code = 400, condition = "Failed to create Static Flow entry due to invalid flow configuration"),
+ @ResponseCode(code = 401, condition = "User not authorized to perform this operation"),
+ @ResponseCode(code = 404, condition = "The Container Name or nodeId is not found"),
+ @ResponseCode(code = 406, condition = "Cannot operate on Default Container when other Containers are active"),
+ @ResponseCode(code = 409, condition = "Failed to create Static Flow entry due to Conflicting Name or configuration"),
+ @ResponseCode(code = 500, condition = "Failed to create Static Flow entry. Failure Reason included in HTTP Error response"),
+ @ResponseCode(code = 503, condition = "One or more of Controller services are unavailable") })
+ public Response addFlow(@PathParam(value = "containerName") String containerName,
+ @PathParam(value = "name") String name, @PathParam("nodeType") String nodeType,
+ @PathParam(value = "nodeId") String nodeId, @TypeHint(FlowConfig.class) FlowConfig flowConfig) {
+
+ if (!NorthboundUtils.isAuthorized(getUserName(), containerName, Privilege.WRITE, this)) {
+ throw new UnauthorizedException("User is not authorized to perform this operation on container "
+ + containerName);
+ }
+
+ if (flowConfig.getNode() == null) {