Snippets

OICP 2.1 Authorize Start | 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.

Section:
3.1.1 eRoamingAuthorizeStart

To download the latest OICP Version, please visit our website:
https://www.hubject.com/downloads/
/**
 * Create a new OICP v2.0 AuthorizeStart request.
 *
 * @param EVSEOperatorId the unique identification of the EVSE operator for this request.
 * @return a new AuthorizeStart request builder object.
 */
public AuthorizeStartRequest AuthorizeStart(final EVSEOperator_Id  EVSEOperatorId)
{ ... }


/**
 * Create a new OICP v2.0 AuthorizeStart request.
 *
 * @param EVSEOperatorId the unique identification of the EVSE operator for this request.
 * @param AuthToken the authentication token for this request.
 * @return a new AuthorizeStart request builder object.
 */
public AuthorizeStartRequest AuthorizeStart(final EVSEOperator_Id  EVSEOperatorId,
                                            final Auth_Token       AuthToken)
{ ... }


// AuthorizeStartRequest builder methods

public AuthorizeStartRequest setEVSEId(EVSE_Id EVSEId)
{ ... }


public AuthorizeStartRequest setPartnerProductId(PartnerProduct_Id PartnerProductId)
{ ... }


public AuthorizeStartRequest setSessionId(ChargingSession_Id SessionId)
{ ... }


public AuthorizeStartRequest setPartnerSessionId(ChargingSession_Id PartnerSessionId)
{ ... }


public AuthorizeStartRequest setAuthToken(Auth_Token AuthToken)
{ ... }


public AuthorizeStartRequest setQRCodeIdentification(EVCO_Id  EVCOId,
                                                     PIN      PIN)
{ ... }


public AuthorizeStartRequest setPlugAndChargeIdentification(EVCO_Id EVCOId)
{ ... }


public AuthorizeStartRequest setRemoteIdentification(EVCO_Id EVCOId)
{ ... }
CompletableFuture req = new CPOClient("api.playground.hubject.com").

    AuthorizeStart(EVSEOperator_Id.Parse("DE*GEF"),
                   Auth_Token.     Parse("08152305")).

    Run(result -> {

        if (result.getAuthorizationStatus() == AuthorizationStatus.Authorized)
            System.out.println("Authorized!");

        else {
            System.out.println(result.getStatusCode().getCode());
            System.out.println(result.getStatusCode().getDescription());
            System.out.println(result.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.