Snippets

OICP 2.1 Pull EVSE Data | Java

Updated by Julius Poessnecker

File (1) Pull EVSE Data | Java.java Modified

  • Ignore whitespace
  • Hide word diff
 /**
- * Create a new OICP v2.0 PullEVSEData request.
+ * Create a new OICP PullEVSEData request.
  *
  * @param ProviderId the unique identification of the EV service provider for this request.
  * @param SearchCenter the geocoordinates of the center of the search request.
 { ... }
 
 /**
- * Create a new OICP v2.0 PullEVSEData request.
+ * Create a new OICP PullEVSEData request.
  *
  * @param ProviderId the unique identification of the EV service provider for this request.
  * @param SearchCenter the geocoordinates of the center of the search request.
 { ... }
 
 /**
- * Create a new OICP v2.0 PullEVSEData request.
+ * Create a new OICP PullEVSEData request.
  *
  * @param ProviderId the unique identification of the EV service provider for this request.
  * @param LastCall the timestamp of the last call.
 { ... }
 
 /**
- * Create a new OICP v2.0 PullEVSEData request.
+ * Create a new OICP PullEVSEData request.
  *
  * @param ProviderId the unique identification of the EVSE service provider for this request.
  * @return a new PullEVSEDataRequest builder object.
Updated by Julius Poessnecker

File (0) OICP Added

  • Ignore whitespace
  • Hide word diff
+The service description can be found in the OICP 2.1 (EMP).
+
+Section:
+3.4.1 eRoamingPullEVSEData
+
+To download the latest OICP Version, please visit our website:
+https://www.hubject.com/downloads/
Created by Gregor Schermuly

File (1) Pull EVSE Data | Java.java Added

  • Ignore whitespace
  • Hide word diff
+/**
+ * Create a new OICP v2.0 PullEVSEData request.
+ *
+ * @param ProviderId the unique identification of the EV service provider for this request.
+ * @param SearchCenter the geocoordinates of the center of the search request.
+ * @param DistanceKM the size of the search request area.
+ * @param LastCall the timestamp of the last call.
+ * @return a new PullEVSEData request builder object.
+ */
+public PullEVSEDataRequest PullEVSEData(final EVSP_Id        ProviderId,
+                                        final GeoCoordinate  SearchCenter,
+                                        final Double         DistanceKM,
+                                        final Date           LastCall)
+{ ... }
+
+/**
+ * Create a new OICP v2.0 PullEVSEData request.
+ *
+ * @param ProviderId the unique identification of the EV service provider for this request.
+ * @param SearchCenter the geocoordinates of the center of the search request.
+ * @param DistanceKM the size of the search request area.
+ * @return a new PullEVSEData request builder object.
+ */
+public PullEVSEDataRequest PullEVSEData(final EVSP_Id        ProviderId,
+                                        final GeoCoordinate  SearchCenter,
+                                        final Double         DistanceKM)
+{ ... }
+
+/**
+ * Create a new OICP v2.0 PullEVSEData request.
+ *
+ * @param ProviderId the unique identification of the EV service provider for this request.
+ * @param LastCall the timestamp of the last call.
+ * @return a new PullEVSEData request builder object.
+ */
+public PullEVSEDataRequest PullEVSEData(final EVSP_Id         ProviderId,
+                                        final Date            LastCall)
+{ ... }
+
+/**
+ * Create a new OICP v2.0 PullEVSEData request.
+ *
+ * @param ProviderId the unique identification of the EVSE service provider for this request.
+ * @return a new PullEVSEDataRequest builder object.
+ */
+public PullEVSEDataRequest PullEVSEData(final EVSP_Id  ProviderId)
+{ ... }
+
+
+// PullEVSEDataRequest builder methods
+
+/**
+ * Set the geocoordinates of the search request.
+ *
+ * @param GeoCoordinate the geocoordinates of the center of the search request.
+ * @param DistanceKM radius of the search request.
+ * @return the PullEVSEData request builder object.
+ */
+public PullEVSEDataRequest setSearchCenter(final GeoCoordinate  GeoCoordinate,
+                                           final Double         DistanceKM)
+{ ... }
+
+
+/**
+ * Set the geocoordinates of the search request.
+ *
+ * @param Longitude the longitude of the center of the search request.
+ * @param Latitude the latitude of the center of the search request.
+ * @param DistanceKM radius of the search request.
+ * @return the PullEVSEData request builder object.
+ */
+public PullEVSEDataRequest setSearchCenter(final Longitude  Longitude,
+                                           final Latitude   Latitude,
+                                           final Double     DistanceKM)
+{ ... }
+
+
+/**
+ * Set the timestamp of the last call.
+ *
+ * @param LastCall the timestamp of the last call.
+ * @return the PullEVSEData request builder object.
+ */
+public PullEVSEDataRequest setLastCall(final Date  LastCall)
+{ ... }

File (2) Example.java Added

  • Ignore whitespace
  • Hide word diff
+CompletableFuture req = new EMPClient("api.playground.hubject.com").
+
+    PullEVSEData(EVSP_Id.Parse("DE*GDF")).
+        setSearchCenter(Latitude. Parse(49.731102),
+                        Longitude.Parse(10.142533),
+                        100.0).
+
+    Run(EVSEData -> {
+
+        if (EVSEData.getStatusCode().hasResult())
+
+            System.out.println(
+                EVSEData.getOperatorEVSEData().
+                    map   (evsedata -> "'" + evsedata.getOperatorName() +
+                                       "' has " +
+                                          evsedata.getEVSEDataRecords().count() +
+                                        " EVSEs").
+
+                    reduce((a, b)   -> a + System.lineSeparator() + b).
+                    get());
+
+        else
+        {
+            System.out.println(EVSEData.getStatusCode().getCode());
+            System.out.println(EVSEData.getStatusCode().getDescription());
+            System.out.println(EVSEData.getStatusCode().getAdditionalInfo());
+        }
+
+    });
+
+// Wait for the future to complete...
+req.get();
HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.