gt: 				status = UncResultCode.UNC_SERVER_ERROR.getValue();
context: /*
   * Copyright (c) 2015 NEC Corporation
   * 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.vtn.javaapi.resources.logical;
  
  import java.util.ArrayList;
  import java.util.List;
  
  import com.google.gson.JsonObject;
  import org.opendaylight.vtn.core.ipc.ClientSession;
  import org.opendaylight.vtn.core.util.Logger;
  import org.opendaylight.vtn.javaapi.annotation.UNCField;
  import org.opendaylight.vtn.javaapi.annotation.UNCVtnService;
  import org.opendaylight.vtn.javaapi.constants.VtnServiceConsts;
  import org.opendaylight.vtn.javaapi.constants.VtnServiceJsonConsts;
  import org.opendaylight.vtn.javaapi.exception.VtnServiceException;
  import org.opendaylight.vtn.javaapi.ipc.IpcRequestProcessor;
  import org.opendaylight.vtn.javaapi.ipc.conversion.IpcLogicalResponseFactory;
  import org.opendaylight.vtn.javaapi.ipc.enums.IpcRequestPacketEnum;
  import org.opendaylight.vtn.javaapi.ipc.enums.UncCommonEnum;
  import org.opendaylight.vtn.javaapi.ipc.enums.UncCommonEnum.UncResultCode;
  import org.opendaylight.vtn.javaapi.ipc.enums.UncJavaAPIErrorCode;
  import org.opendaylight.vtn.javaapi.ipc.enums.UncUPLLEnums;
  import org.opendaylight.vtn.javaapi.resources.AbstractResource;
  import org.opendaylight.vtn.javaapi.validation.logical.VTNUnifiedNetworkResourceValidator;
  
  /**
   * The Class VTNUnifiedNetworkResource.
   * 
   */
  /* This class handles delete, put and get methods */
  @UNCVtnService(path = "/vtns/{vtn_name}/unified_networks/{unified_network_name}")
  public class VTNUnifiedNetworkResource extends AbstractResource {
  	/** The VTN name. */
  	@UNCField("vtn_name")
  	private String vtnName;
  
  	/**
  	 * Gets the vtn name.
  	 * 
  	 * @return the vtn name
  	 */
  	public final String getVtnName() {
  		return vtnName;
  	}
  
  	/**
  	 * Gets the unified network name.
  	 * 
  	 * @return the unified network name
  	 */
  	public final String getUnifiedNetworkName() {
  		return unifiedNetworkName;
  	}
  
  	/** The unified network name. */
  	@UNCField("unified_network_name")
  	private String unifiedNetworkName;
  	private static final Logger LOG = Logger.getLogger(VTNUnifiedNetworkResource.class
  			.getName());
  
  	/**
  	 * Instantiates a new VTN Unified Network Resource.
  	 */
  	public VTNUnifiedNetworkResource() {
  		LOG.trace("Start VTNUnifiedNetworkResource#VTNUnifiedNetworkResource()");
  		setValidator(new VTNUnifiedNetworkResourceValidator(this));
  		LOG.trace("Completed VTNUnifiedNetworkResource#VTNUnifiedNetworkResource()");
  	}
  
  	/**
  	 * Implementation the Put method of VTN Unified Network Resource API
  	 * 
  	 * @param requestBody
  	 *            the request Json object
  	 * 
  	 * @return Error code
  	 * @throws VtnServiceException
  	 */
  	@Override
  	public final int put(final JsonObject requestBody)
  			throws VtnServiceException {
  		LOG.trace("Start VTNUnifiedNetworkResource#put()"); 
  		ClientSession session = null;
  		IpcRequestProcessor requestProcessor = null;
  		int status = ClientSession.RESP_FATAL;
  		try {
  			LOG.debug("Start Ipc framework call");
  			session = getConnPool().getSession(
  					UncUPLLEnums.UPLL_IPC_CHANNEL_NAME,
  					UncUPLLEnums.UPLL_IPC_SERVICE_NAME,
  					UncUPLLEnums.ServiceID.UPLL_EDIT_SVC_ID.ordinal(),
  					getExceptionHandler());
  			LOG.debug("Session created successfully");
  			requestProcessor = new IpcRequestProcessor(session, getSessionID(),
  					getConfigID(), getExceptionHandler());
  			requestProcessor.createIpcRequestPacket(
  					IpcRequestPacketEnum.KT_VTN_UNIFIED_UPDATE, requestBody,
  					getUriParameters());
  			LOG.debug("Request Packet created successfully");
  			status = requestProcessor.processIpcRequest();
  			LOG.debug("Request packet processed with status" + status);
  			LOG.debug("Complete Ipc framework call");
  		} catch (final VtnServiceException e) {
  			getExceptionHandler()
  					.raise(Thread.currentThread().getStackTrace()[1]
  							.getClassName()
  							+ VtnServiceConsts.HYPHEN
  							+ Thread.currentThread().getStackTrace()[1]
  									.getMethodName(),
  							UncJavaAPIErrorCode.IPC_SERVER_ERROR.getErrorCode(),
  							UncJavaAPIErrorCode.IPC_SERVER_ERROR
  									.getErrorMessage(), e);
  			throw e;
  		} finally {
  			if (status == ClientSession.RESP_FATAL) {
  				if (null != requestProcessor.getErrorJson()) {
  					setInfo(requestProcessor.getErrorJson());
  				} else {
  					createErrorInfo(UncCommonEnum.UncResultCode.UNC_SERVER_ERROR
  							.getValue());
  				}
  				status = UncResultCode.UNC_SERVER_ERROR.getValue();
  			}
  			getConnPool().destroySession(session);
  		}
  		LOG.trace("Complete VTNUnifiedNetworkResource#put");
  		return status;
  	}
  
  	/**
  	 * Implementation the Delete method of VTN Unified Network Resource API
  	 * 
  	 * @return Error code
  	 * @throws VtnServiceException
  	 */
  	@Override
  	public final int delete() throws VtnServiceException {
  		LOG.trace("Start VTNUnifiedNetworkResource#delete()");
  		ClientSession session = null;
  		IpcRequestProcessor requestProcessor = null;
  		int status = ClientSession.RESP_FATAL;
  		try {
  			LOG.debug("Start Ipc framework call");
  			session = getConnPool().getSession(
  					UncUPLLEnums.UPLL_IPC_CHANNEL_NAME,
  					UncUPLLEnums.UPLL_IPC_SERVICE_NAME,
  					UncUPLLEnums.ServiceID.UPLL_EDIT_SVC_ID.ordinal(),
  					getExceptionHandler());
  			LOG.debug("Session created successfully");
  			requestProcessor = new IpcRequestProcessor(session, getSessionID(),
  					getConfigID(), getExceptionHandler());
  			requestProcessor.createIpcRequestPacket(
  					IpcRequestPacketEnum.KT_VTN_UNIFIED_DELETE, getNullJsonObject(),
  					getUriParameters());
  			LOG.debug("Request packet created successfully");
  			status = requestProcessor.processIpcRequest();
  			LOG.debug("Request packet processed with status" + status);
  			LOG.debug("Complete Ipc framework call");
  		} catch (final VtnServiceException e) {
  			getExceptionHandler()
  					.raise(Thread.currentThread().getStackTrace()[1]
  							.getClassName()
  							+ VtnServiceConsts.HYPHEN
  							+ Thread.currentThread().getStackTrace()[1]
  									.getMethodName(),
  							UncJavaAPIErrorCode.IPC_SERVER_ERROR.getErrorCode(),
  							UncJavaAPIErrorCode.IPC_SERVER_ERROR
  									.getErrorMessage(), e);
  			throw e;
  		} finally {
  			if (status == ClientSession.RESP_FATAL) {
  				if (null != requestProcessor.getErrorJson()) {
  					setInfo(requestProcessor.getErrorJson());
  				} else {
  					createErrorInfo(UncCommonEnum.UncResultCode.UNC_SERVER_ERROR
  							.getValue());
  				}
  				status = UncResultCode.UNC_SERVER_ERROR.getValue();
  			}
  			getConnPool().destroySession(session);
  		}
  		LOG.trace("Completed VTNUnifiedNetworkResource#delete()");
  		return status;
  	}
  
  	/**
  	 * Implementation the get method of VTN Unified Network Resource API
  	 * 
  	 * @param requestBody
  	 *            the request Json object
  	 * 
  	 * @return Error code
  	 * @throws VtnServiceException
  	 */
  	@Override
  	public final int get(final JsonObject requestBody)
  			throws VtnServiceException {
  		LOG.trace("Start VTNUnifiedNetworkResource#get()");
  		ClientSession session = null;
  		IpcRequestProcessor requestProcessor = null;
  		int status = ClientSession.RESP_FATAL;
  		try {
  			LOG.debug("Start Ipc framework call");
  			session = getConnPool().getSession(
  					UncUPLLEnums.UPLL_IPC_CHANNEL_NAME,
  					UncUPLLEnums.UPLL_IPC_SERVICE_NAME,
  					UncUPLLEnums.ServiceID.UPLL_READ_SVC_ID.ordinal(),
  					getExceptionHandler());
  			LOG.debug("Session created successfully");
  			requestProcessor = new IpcRequestProcessor(session, getSessionID(),
  					getConfigID(), getExceptionHandler());
  			requestProcessor.createIpcRequestPacket(
  					IpcRequestPacketEnum.KT_VTN_UNIFIED_GET, requestBody,
  					getUriParameters());
  			LOG.debug("Request Packet created successfully");
  			status = requestProcessor.processIpcRequest();
  			LOG.debug("Request packet processed with status" + status);
  			final IpcLogicalResponseFactory responseGenerator = new IpcLogicalResponseFactory();
  			setInfo(responseGenerator.getVTNUnifiedNetworkResponse(
  					requestProcessor.getIpcResponsePacket(), requestBody,
  					VtnServiceJsonConsts.SHOW));
  			LOG.debug("Response object created successfully");
  			LOG.debug("Complete Ipc framework call");
  		} catch (final VtnServiceException e) {
  			getExceptionHandler()
  					.raise(Thread.currentThread().getStackTrace()[1]
  							.getClassName()
  							+ VtnServiceConsts.HYPHEN
  							+ Thread.currentThread().getStackTrace()[1]
  									.getMethodName(),
  							UncJavaAPIErrorCode.IPC_SERVER_ERROR.getErrorCode(),
  							UncJavaAPIErrorCode.IPC_SERVER_ERROR
  									.getErrorMessage(), e);
  			throw e;
  		} finally {
  			if (status == ClientSession.RESP_FATAL) {
  				if (null != requestProcessor.getErrorJson()) {
  					setInfo(requestProcessor.getErrorJson());
  				} else {
  					createErrorInfo(UncCommonEnum.UncResultCode.UNC_SERVER_ERROR
  							.getValue());
  				}
  