Repository: influxdata/influxdb-client-java (java)

Issue:
Add getTime() to com.influxdb.client.write.Point
__Proposal:__
By adding a getter for the timestamp a developer can get more control on handling data points.
E.g. on handling the storing and retry of points in case of an not reachable InfluxDB. 

__Current behavior:__
getter does not exists and value is private / class is final so there is no nice way to access the value

__Desired behavior:__
Calling point.getTime() to get the Timestamp

__Alternatives considered:__
Not declaring the Point class as final would allow to extend the Point class 

__Use case:__
In my case collect values from a number of APIs into Points on Android. Points are can either go live to the InfluxDB and/or be cached into a local DB to be send when the connection to the DB is possible. Using the Timestamp to identify the points would be very helpful.


Pull request description:
feat: add possibility to get time from `Point`
Closes #411

## Proposed Changes

The `Point#time` is public.

## Checklist

<!-- Checkboxes below this note can be erased if not applicable to your Pull Request. -->

- [x] CHANGELOG.md updated
- [x] Rebased/mergeable
- [x] A test has been added if appropriate
- [x] `mvn test` completes successfully
- [x] Commit messages are [conventional](https://www.conventionalcommits.org/en/v1.0.0/)
- [x] Sign [CLA](https://www.influxdata.com/legal/cla/) (if not already signed)


Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c181b911b8..94c8425526 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,8 @@
 ## 6.6.0 [unreleased]
 
+### Features
+1. [#419](https://github.com/influxdata/influxdb-client-java/pull/419): Add possibility to get time from `Point` data structure
+
 ### Documentation
 1. [#406](https://github.com/influxdata/influxdb-client-java/pull/406): Fix compatibility of the `doclint` between JDK 8 and JDK 18
 
@@ -8,12 +11,17 @@ Update dependencies:
 
 #### Build:
   - [#412](https://github.com/influxdata/influxdb-client-java/pull/412), [#416](https://github.com/influxdata/influxdb-client-java/pull/416): `akka` to `2.6.20`
+  - [#420](https://github.com/influxdata/influxdb-client-java/pull/420): `micrometer-registry-influx` to `1.9.4`
+  - [#423](https://github.com/influxdata/influxdb-client-java/pull/423): `scala-library` to `2.12.17`
   
 #### Maven Plugin:
   - [#413](https://github.com/influxdata/influxdb-client-java/pull/413): `versions-maven-plugin` to `2.12.0`
 
+#### Provided:
+  - [#424](https://github.com/influxdata/influxdb-client-java/pull/424): `slf4j-api` to `2.0.1`
+
 #### Test:
-  - [#408](https://github.com/influxdata/influxdb-client-java/pull/408): `logback-classic` to `1.3.0`
+  - [#422](https://github.com/influxdata/influxdb-client-java/pull/422): `logback-classic` to `1.3.1`
   - [#417](https://github.com/influxdata/influxdb-client-java/pull/417): `mockito` to `4.8.0`
 
 ## 6.5.0 [2022-08-29]
diff --git a/client-osgi/pom.xml b/client-osgi/pom.xml
index 3abb0dce32..5450748b3c 100644
--- a/client-osgi/pom.xml
+++ b/client-osgi/pom.xml
@@ -151,7 +151,7 @@
         <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>
-            <version>2.0.0</version>
+            <version>2.0.1</version>
             <scope>provided</scope>
         </dependency>
 
@@ -191,7 +191,7 @@
         <dependency>
             <groupId>ch.qos.logback</groupId>
             <artifactId>logback-classic</artifactId>
-            <version>1.3.0</version>
+            <version>1.3.1</version>
             <scope>test</scope>
             <exclusions>
                 <exclusion>
diff --git a/client-scala/cross/2.12/pom.xml b/client-scala/cross/2.12/pom.xml
index 4c997dd88a..213a793c86 100644
--- a/client-scala/cross/2.12/pom.xml
+++ b/client-scala/cross/2.12/pom.xml
@@ -72,7 +72,7 @@
   </scm>
 
   <properties>
-    <scala.version>2.12.16</scala.version>
+    <scala.version>2.12.17</scala.version>
     <akka.version>2.6.20</akka.version>
   </properties>
 
diff --git a/client-scala/cross/2.13/pom.xml b/client-scala/cross/2.13/pom.xml
index eb6f4aa861..80b3ebfd50 100644
--- a/client-scala/cross/2.13/pom.xml
+++ b/client-scala/cross/2.13/pom.xml
@@ -270,4 +270,4 @@
 
   </dependencies>
 
-</project>
\ No newline at end of file
+</project>
diff --git a/client/src/main/java/com/influxdb/client/write/Point.java b/client/src/main/java/com/influxdb/client/write/Point.java
index 394d288982..cc0d38c4d2 100644
--- a/client/src/main/java/com/influxdb/client/write/Point.java
+++ b/client/src/main/java/com/influxdb/client/write/Point.java
@@ -253,6 +253,14 @@ public final class Point {
         return time((Number) time, precision);
     }
 
+    /**
+     * @return the data point timestamp
+     */
+    @Nullable
+    public Number getTime() {
+        return time;
+    }
+
     /**
      * @return the data point precision
      */
diff --git a/spring/pom.xml b/spring/pom.xml
index 83c0fe6eb6..d1dfe6a809 100644
--- a/spring/pom.xml
+++ b/spring/pom.xml
@@ -72,7 +72,7 @@
   </scm>
 
     <properties>
-        <micrometer.version>1.9.3</micrometer.version>
+        <micrometer.version>1.9.4</micrometer.version>
         <spring-boot.version>2.7.3</spring-boot.version>
         <spring.version>5.3.22</spring.version>
     </properties>


Test patch:
diff --git a/client/src/test/java/com/influxdb/client/write/PointTest.java b/client/src/test/java/com/influxdb/client/write/PointTest.java
index 5b7adcc300..2f5c9f68b8 100644
--- a/client/src/test/java/com/influxdb/client/write/PointTest.java
+++ b/client/src/test/java/com/influxdb/client/write/PointTest.java
@@ -293,6 +293,19 @@ class PointTest {
         Assertions.assertThat(point.toLineProtocol()).isEqualTo("h2o,location=europe level=2i");
     }
 
+    @Test
+    void timeGetTime() {
+
+        Instant time = Instant.parse("2022-06-12T10:26:03.800123456Z");
+
+        Point point = Point.measurement("h2o")
+                .addTag("location", "europe")
+                .addField("level", 2)
+                .time(time, WritePrecision.NS);
+
+        Assertions.assertThat(point.getTime()).isEqualTo(BigInteger.valueOf(1655029563800123456L));
+    }
+
     @Test
     void defaultTags() {