Skip to content

Polyconseil/tefps-clients

This branch is 1 commit ahead of master.

Folders and files

NameName
Last commit message
Last commit date
Jun 4, 2021
Oct 24, 2017
Oct 21, 2020
Oct 21, 2020

Repository files navigation

Tefps Clients

Available clients

  • Java7 TefpsTvClient
  • Java7 TefpsSubscriberClient
  • Java7 TefpsPricingClient

Java7 All clients - Installation

Add maven dependency to your pom.xml

<dependency>
    <groupId>fr.polyconseil.smartcity</groupId>
    <artifactId>tefps-clients</artifactId>
    <version>1.4.0</version>
</dependency>

Java7 TefpsTvClient - Usage

import fr.polyconseil.smartcity.tefpsclient.tv.TefpsTvClient;
import fr.polyconseil.smartcity.tefpsclients.auth.OAuth2HttpClient;
import fr.polyconseil.smartcity.tefpsclient.dto.tv.ParkingRightDTO;

//...
// Instantiate client
TefpsTvClient client = new TefpsTvClient(new OAuth2HttpClient(
        "http://tefps-directory-host:port",
        "clientId",
        "clientSecret"),
        "http://tefps-tv-host:port"
);

// Fetch Parking Right Sample
ParkingRightDTO parkingRight = client.fetchTv("cityId", "tvId");

// Delete Parking Right Sample
ParkingRightDTO parkingRight = client.deleteTv("cityId", "tvId");

Java7 TefpsSubscriberClient - Usage

import fr.polyconseil.smartcity.tefpsclient.subscriber.TefpsSubscriberClient;
import fr.polyconseil.smartcity.tefpsclients.auth.OAuth2HttpClient;
import fr.polyconseil.smartcity.tefpsclient.dto.subscriber.LightSubscriberDTO;

//...
// Instantiate client
TefpsSubscriberClient client = new TefpsSubscriberClient(new OAuth2HttpClient(
        "http://tefps-directory-host:port",
        "clientId",
        "clientSecret"),
        "http://tefps-subscription-host:port"
);

// Fetch Subscriber Sample
LightSubscriberDTO subscriber = client.fetchSubscriber("cityId", "subscriberId");

Java7 TefpsPricingClient - Usage

import fr.polyconseil.smartcity.tefpsclient.pricing.TefpsPricingClient;
import fr.polyconseil.smartcity.tefpsclients.auth.OAuth2HttpClient;
import fr.polyconseil.smartcity.tefpsclient.dto.pricing.FnmsParkingDetailResultV1DTO ;

//...
// Instantiate client
TefpsPricingClient client = new TefpsPricingClient(new OAuth2HttpClient(
        "http://tefps-directory-host:port",
        "clientId",
        "clientSecret"),
        "http://tefps-pricing-host:port"
);

FnmsParkingDetailResultV1DTO result = client.fetchParkingDetail("cityId", "AA-123-AA", "FR", null);