Add metric level data retention support in core Java API

I will create a separate PR for adding support in the REST API. This PR adds support for specifying data retention when creating a metric. Metric queries have been updated so that the data retention is included in the result sets.