@Override public TaskResourceV2 createFcNetwork( final RestParams params, final FcNetwork fcNetworkDto, final boolean aSync, final boolean useJsonRequest) { logger.info("FcNetworkClientImpl : createFcNetwork : Start"); String returnObj = null; // validate params if (fcNetworkDto == null) { throw new SDKInvalidArgumentException( SDKErrorEnum.invalidArgument, null, null, null, SdkConstants.FC_NETWORKS, null); } // set the additional params params.setType(HttpMethodType.POST); params.setUrl(urlUtils.createRestUrl(params.getHostname(), ResourceUris.FC_NETWORK_URI)); // check for json request in the input dto. if it is present, // then // convert that into jsonObject and pass it rest client // idea is : user can create json string and call the sdk api. // user can save time in creating network dto. if (useJsonRequest == true) { final FcNetwork dto = adaptor.buildDto(fcNetworkDto.getJsonRequest().getBody()); // create JSON request from dto jsonObject = adaptor.buildJsonObjectFromDto(dto); } else { // create JSON request from dto jsonObject = adaptor.buildJsonObjectFromDto(fcNetworkDto); } returnObj = restClient.sendRequestToHPOV(params, jsonObject); // convert returnObj to taskResource TaskResourceV2 taskResourceV2 = taskAdaptor.buildDto(returnObj); logger.debug("FcNetworkClientImpl : createFcNetwork : returnObj =" + returnObj); logger.debug("FcNetworkClientImpl : createFcNetwork : taskResource =" + taskResourceV2); // check for aSync flag. if user is asking async mode, return directly // the TaskResourceV2 // if user is asking for sync mode, call task monitor polling method and // send the update // once task is complete or exceeds the timeout. if (taskResourceV2 != null && aSync == false) { taskResourceV2 = taskMonitor.checkStatus(params, taskResourceV2.getUri(), TIMEOUT); } logger.info("FcNetworkClientImpl : createFcNetwork : End"); return taskResourceV2; }