Snippets

OICP 2.1 Push EVSE Status | Java

Created by Gregor Schermuly last modified Julius Poessnecker
1
2
3
4
5
6
7
The service description can be found in the OICP 2.1 (CPO).

Section:
3.4.1 eRoamingPushEVSEStatus

To download the latest OICP Version, please visit our website:
https://www.hubject.com/downloads/
/**
 * Creates a new PushEVSEStatus request.
 *
 * @param EVSEStatus a mapping of EVSEIds to EVSEStatus values.
 * @param EVSEOperatorId the unique identification of the EVSE operator for this request.
 * @param EVSEOperatorName the unique name of the EVSE operator for this request.
 * @param Action the server side data management operation for this request.
 * @return a new PushEVSEStatus request builder object.
 */
public PushEVSEStatusRequest PushEVSEStatus(final Map<EVSE_Id, EVSEStatus>  EVSEStatus,
                                            final ActionType                Action,
                                            final EVSEOperator_Id           EVSEOperatorId,
                                            final String                    EVSEOperatorName)
{ ... }
Map<EVSE_Id, EVSEStatus> EVSEStatusMap = new HashMap<EVSE_Id, EVSEStatus>();
EVSEStatusMap.put(EVSE_Id.Parse("DE*GEF*E123456789*1"), EVSEStatus.Available);
EVSEStatusMap.put(EVSE_Id.Parse("DE*GEF*E123456789*2"), EVSEStatus.Occupied);

CompletableFuture req = new CPOClient("api.playground.hubject.com").

    PushEVSEStatus(EVSEStatusMap,
                   ActionType.insert,
                   EVSEOperator_Id.Parse("DE*GEF"),
                   "Test CPO 1").

    Run(ack -> {

        if (ack.hasResult())
            System.out.println("success!");

        else {
            System.out.println(ack.getStatusCode().getCode());
            System.out.println(ack.getStatusCode().getDescription());
            System.out.println(ack.getStatusCode().getAdditionalInfo());
        }

    });

// Wait for the future to complete...
req.get();

Comments (0)

HTTPS SSH

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