class HmsGenericUtil {

    public static boolean isHostReachable( String ipAddress )
    {
        try
        {
            final String pingCommandTemplate = Constants.HMS_HOST_REACHABILITY_VERIFICATION_COMMAND_TEMPLATE;
            String command = String.format( pingCommandTemplate, ipAddress );
            List<String> commands = new ArrayList<String>();
            commands.add( "bash" );
            commands.add( "-c" );
            commands.add( command );
            int status = ProcessUtil.executeCommand( commands );
            logger.debug( "Ip '{}' reachability status: {}", ipAddress, status );
            if ( status == 0 )
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        catch ( Exception e )
        {
            String message = String.format( "Exception while trying to reach ip: '%s'.", ipAddress );
            logger.error( message, e );
            return false;
        }
    }

}