Skip to content

Commit 5d92c40

Browse files
committed
2 parents 6548643 + fc62dc1 commit 5d92c40

File tree

13 files changed

+37
-263
lines changed

13 files changed

+37
-263
lines changed

ocpp-v1_6-test/src/main/java/eu/chargetime/ocpp/test/FakeCentralSystem.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,7 @@ public boolean hasHandledMeterValuesRequest() {
310310

311311
public void sendRemoteStartTransactionRequest(int connectorId, String idTag) throws Exception {
312312
RemoteStartTransactionRequest request = new RemoteStartTransactionRequest();
313-
IdToken idToken = new IdToken();
314-
idToken.setIdToken(idTag);
315-
request.setIdTag(idToken);
313+
request.setIdTag(idTag);
316314
request.setConnectorId(connectorId);
317315
server.send(currentSessionIndex, request).whenComplete((confirmation, throwable) -> receivedConfirmation = confirmation);
318316
}

ocpp-v1_6/src/main/java/eu/chargetime/ocpp/feature/profile/ClientCoreProfile.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,7 @@ public MeterValuesRequest createMeterValuesRequest(Integer connectorId, MeterVal
190190
public StartTransactionRequest createStartTransactionRequest(Integer connectorId, String idTag, Integer meterStart, Calendar timestamp) throws PropertyConstraintException {
191191
StartTransactionRequest request = new StartTransactionRequest();
192192
request.setConnectorId(connectorId);
193-
IdToken idToken = new IdToken();
194-
idToken.setIdToken(idTag);
195-
request.setIdTag(idToken);
193+
request.setIdTag(idTag);
196194
request.setMeterStart(meterStart);
197195
request.setTimestamp(timestamp);
198196
return request;

ocpp-v1_6/src/main/java/eu/chargetime/ocpp/feature/profile/ServerCoreProfile.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,8 @@ public GetConfigurationRequest createGetConfigurationRequest() {
119119
}
120120

121121
public RemoteStartTransactionRequest createRemoteStartTransactionRequest(String idToken) throws PropertyConstraintException {
122-
IdToken idTag = new IdToken();
123-
idTag.setIdToken(idToken);
124-
125122
RemoteStartTransactionRequest request = new RemoteStartTransactionRequest();
126-
request.setIdTag(idTag);
123+
request.setIdTag(idToken);
127124
return request;
128125
}
129126

ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/core/IdTagInfo.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ of this software and associated documentation files (the "Software"), to deal
4444
public class IdTagInfo implements Validatable
4545
{
4646
private Calendar expiryDate;
47-
private IdToken parentIdTag;
47+
private String parentIdTag;
4848
private AuthorizationStatus status;
4949

5050
/**
@@ -79,19 +79,19 @@ public void setExpiryDate(Calendar expiryDate) {
7979
/**
8080
* This contains the parent-identifier.
8181
*
82-
* @return the {@link IdToken} of the parent.
82+
* @return the IdToken of the parent.
8383
*/
84-
public IdToken getParentIdTag() {
84+
public String getParentIdTag() {
8585
return parentIdTag;
8686
}
8787

8888
/**
8989
* Optional. This contains the parent-identifier.
9090
*
91-
* @param parentIdTag an {@link IdToken}.
91+
* @param parentIdTag an IdToken.
9292
*/
9393
@XmlElement
94-
public void setParentIdTag(IdToken parentIdTag) {
94+
public void setParentIdTag(String parentIdTag) {
9595
this.parentIdTag = parentIdTag;
9696
}
9797

ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/core/IdToken.java

Lines changed: 0 additions & 77 deletions
This file was deleted.

ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/core/RemoteStartTransactionRequest.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import eu.chargetime.ocpp.PropertyConstraintException;
44
import eu.chargetime.ocpp.model.Request;
5+
import eu.chargetime.ocpp.utilities.ModelUtil;
56

67
import javax.xml.bind.annotation.XmlElement;
78
import javax.xml.bind.annotation.XmlRootElement;
@@ -39,14 +40,14 @@
3940
public class RemoteStartTransactionRequest implements Request {
4041

4142
private Integer connectorId;
42-
private IdToken idTag;
43+
private String idTag;
4344
private ChargingProfile chargingProfile;
4445

4546
@Override
4647
public boolean validate() {
4748
boolean valid = true;
4849
if (valid &= idTag != null)
49-
valid &= idTag.validate();
50+
valid &= ModelUtil.validate(idTag, 20);
5051

5152
if (chargingProfile != null) {
5253
valid &= chargingProfile.validate();
@@ -83,19 +84,19 @@ public void setConnectorId(Integer connectorId) throws PropertyConstraintExcepti
8384
/**
8485
* The identifier that Charge Point must use to start a transaction.
8586
*
86-
* @return an {@link IdToken}.
87+
* @return an IdToken.
8788
*/
88-
public IdToken getIdTag() {
89+
public String getIdTag() {
8990
return idTag;
9091
}
9192

9293
/**
9394
* Required. The identifier that Charge Point must use to start a transaction.
9495
*
95-
* @param idTag an {@link IdToken}.
96+
* @param idTag an IdToken
9697
*/
9798
@XmlElement
98-
public void setIdTag(IdToken idTag) {
99+
public void setIdTag(String idTag) {
99100
this.idTag = idTag;
100101
}
101102

ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/core/StartTransactionRequest.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import eu.chargetime.ocpp.PropertyConstraintException;
44
import eu.chargetime.ocpp.model.Request;
5+
import eu.chargetime.ocpp.utilities.ModelUtil;
56

67
import javax.xml.bind.annotation.XmlElement;
78
import javax.xml.bind.annotation.XmlRootElement;
@@ -39,7 +40,7 @@
3940
@XmlRootElement
4041
public class StartTransactionRequest implements Request {
4142
private Integer connectorId;
42-
private IdToken idTag;
43+
private String idTag;
4344
private Integer meterStart;
4445
private Integer reservationId;
4546
private Calendar timestamp;
@@ -49,7 +50,7 @@ public boolean validate() {
4950
boolean valid = true;
5051
valid &= connectorId != null && connectorId > 0;
5152
if (valid &= idTag != null)
52-
valid &= idTag.validate();
53+
valid &= ModelUtil.validate(idTag, 20);
5354
valid &= meterStart != null;
5455
valid &= timestamp != null;
5556
return valid;
@@ -81,19 +82,19 @@ public void setConnectorId(Integer connectorId) throws PropertyConstraintExcepti
8182
/**
8283
* This contains the identifier for which a transaction has to be started.
8384
*
84-
* @return the {@link IdToken}.
85+
* @return the IdToken.
8586
*/
86-
public IdToken getIdTag() {
87+
public String getIdTag() {
8788
return idTag;
8889
}
8990

9091
/**
9192
* Required. This contains the identifier for which a transaction has to be started.
9293
*
93-
* @param idTag the {@link IdToken}.
94+
* @param idTag the IdToken.
9495
*/
9596
@XmlElement
96-
public void setIdTag(IdToken idTag) {
97+
public void setIdTag(String idTag) {
9798
this.idTag = idTag;
9899
}
99100

ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/core/StopTransactionRequest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*/
3838
@XmlRootElement
3939
public class StopTransactionRequest implements Request {
40-
private IdToken idTag;
40+
private String idTag;
4141
private Integer meterStop;
4242
private Calendar timestamp;
4343
private Integer transactionId;
@@ -61,9 +61,9 @@ public boolean validate() {
6161
/**
6262
* This contains the identifier which requested to stop the charging.
6363
*
64-
* @return the {@link IdToken}.
64+
* @return the IdToken.
6565
*/
66-
public IdToken getIdTag() {
66+
public String getIdTag() {
6767
return idTag;
6868
}
6969

@@ -72,10 +72,10 @@ public IdToken getIdTag() {
7272
* It is optional because a Charge Point may terminate charging without the presence of an idTag, e.g. in case of a reset.
7373
* A Charge Point SHALL send the idTag if known.
7474
*
75-
* @param idTag the {@link IdToken}.
75+
* @param idTag the IdToken.
7676
*/
7777
@XmlElement
78-
public void setIdTag(IdToken idTag) {
78+
public void setIdTag(String idTag) {
7979
this.idTag = idTag;
8080
}
8181

ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/IdTokenTest.java

Lines changed: 0 additions & 95 deletions
This file was deleted.

0 commit comments

Comments
 (0)