class InventoryUtil {

    public static ResponseEntity<HashMap<String, Object[]>> getInventoryOOB( String path, String contentType )
        throws HMSRestException
    {
        logger.debug( String.format( "Trying to get inventory OOB. Url fo r OOB operation is Path: %s, Content Type: %s ",
                                     path, contentType ) );

        ResponseEntity<HashMap<String, Object[]>> oobResponse = null;

        if ( path != null )
        {
            try
            {
                HmsOobAgentRestTemplate<Object> restTemplate = new HmsOobAgentRestTemplate<Object>( null, contentType );
                ParameterizedTypeReference<HashMap<String, Object[]>> typeRef =
                    new ParameterizedTypeReference<HashMap<String, Object[]>>()
                    {
                    };
                oobResponse = restTemplate.exchange( HttpMethod.GET, path, typeRef );
            }
            catch ( HttpStatusCodeException e )
            {
                HttpHeaders headers = new HttpHeaders();
                headers.setContentType( MediaType.APPLICATION_JSON );
                logger.error( "Http Status Code Exception when trying to get hms/nodes: " + e );
            }
            catch ( Exception e )
            {
                logger.error( "Error while trying to get nodes: " + e );
                throw new HMSRestException( HttpStatus.INTERNAL_SERVER_ERROR.value(), "Server Error",
                                            "Exception while connecting to hms." + ( ( path != null ) ? path : "" ) );
            }
        }
        else
        {
            logger.error( String.format( "Unable to get inventory from OOB because some Final OOB Url cannot be constructed. "
                + "Url for OOB operation is Path: %s, Content Type: %s ", path, contentType ) );
            throw new HMSRestException( HttpStatus.INTERNAL_SERVER_ERROR.value(), "Server Error",
                                        "Exception while connecting to hms. Unable to create Url" );
        }
        return oobResponse;
    }

}