Skip to content

Commit 1372fda

Browse files
committed
Java docs for v1_6 models, done is parts.
1 parent a37f3c2 commit 1372fda

File tree

7 files changed

+236
-18
lines changed

7 files changed

+236
-18
lines changed

ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/AuthorizationStatus.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package eu.chargetime.ocpp.model;
22

3-
/**
3+
/*
44
* ChargeTime.eu - Java-OCA-OCPP
55
* <p>
66
* MIT License
@@ -25,6 +25,12 @@
2525
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2626
* SOFTWARE.
2727
*/
28+
29+
/**
30+
* Accepted values {@link IdTagInfo} for {@link AuthorizeConfirmation}.
31+
*
32+
* @see IdTagInfo
33+
*/
2834
public enum AuthorizationStatus {
2935
Accepted, Blocked, Expired, Invalid, ConcurrentTx
3036
}

ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/AuthorizeConfirmation.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package eu.chargetime.ocpp.model;
22

3-
/**
3+
/*
44
ChargeTime.eu - Java-OCA-OCPP
55
Copyright (C) 2015-2016 Thomas Volden <[email protected]>
66
@@ -26,15 +26,29 @@ of this software and associated documentation files (the "Software"), to deal
2626
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2727
SOFTWARE.
2828
*/
29+
30+
/**
31+
* Sent by the Centarl System to the Charge Point in response to a {@link AuthorizeRequest}.
32+
*/
2933
public class AuthorizeConfirmation implements Confirmation
3034
{
3135
private IdTagInfo idTagInfo;
3236

37+
/**
38+
* This contains information about authorization status, expiry and parent id.
39+
*
40+
* @return an instance of {@link IdTagInfo}.
41+
*/
3342
public IdTagInfo getIdTagInfo()
3443
{
3544
return idTagInfo;
3645
}
3746

47+
/**
48+
* Required. This contains information about authorization status, expiry and parent id.
49+
*
50+
* @param idTagInfo an instance of {@link IdTagInfo}.
51+
*/
3852
public void setIdTagInfo(IdTagInfo idTagInfo) {
3953
this.idTagInfo = idTagInfo;
4054
}

ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/AuthorizeRequest.java

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import eu.chargetime.ocpp.PropertyConstraintException;
44
import eu.chargetime.ocpp.utilities.ModelUtil;
55

6-
/**
6+
/*
77
ChargeTime.eu - Java-OCA-OCPP
88
Copyright (C) 2015-2016 Thomas Volden <[email protected]>
99
@@ -29,22 +29,43 @@ of this software and associated documentation files (the "Software"), to deal
2929
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3030
SOFTWARE.
3131
*/
32+
33+
/**
34+
* Sent by the Charge Point to the Central System.
35+
*/
3236
public class AuthorizeRequest implements Request
3337
{
3438
private String idTag;
3539

3640
public AuthorizeRequest() {}
3741

42+
/**
43+
* Handle required fields.
44+
*
45+
* @param idToken authorize id.
46+
* @throws PropertyConstraintException field isn't filled out correct.
47+
*/
3848
public AuthorizeRequest(String idToken) throws PropertyConstraintException
3949
{
4050
setIdTag(idToken);
4151
}
4252

53+
/**
54+
* This contains the identifier that needs to be authorized.
55+
*
56+
* @return String, max 20 characters. Case insensitive.
57+
*/
4358
public String getIdTag()
4459
{
4560
return idTag;
4661
}
4762

63+
/**
64+
* Required. This contains the identifier that needs to be authorized.
65+
*
66+
* @param idTag String, max 20 characters. Case insensitive.
67+
* @throws PropertyConstraintException field isn't filled out correct.
68+
*/
4869
public void setIdTag(String idTag) throws PropertyConstraintException {
4970
if (!ModelUtil.validate(idTag, 20))
5071
throw new PropertyConstraintException("idTag", idTag, "Exceeded limit");
Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
package eu.chargetime.ocpp.model;
22

3-
/**
3+
/*
44
* ChargeTime.eu - Java-OCA-OCPP
5-
* <p>
5+
*
66
* MIT License
7-
* <p>
7+
*
88
* Copyright (C) 2016 Thomas Volden <[email protected]>
9-
* <p>
9+
*
1010
* Permission is hereby granted, free of charge, to any person obtaining a copy
1111
* of this software and associated documentation files (the "Software"), to deal
1212
* in the Software without restriction, including without limitation the rights
1313
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1414
* copies of the Software, and to permit persons to whom the Software is
1515
* furnished to do so, subject to the following conditions:
16-
* <p>
16+
*
1717
* The above copyright notice and this permission notice shall be included in all
1818
* copies or substantial portions of the Software.
19-
* <p>
19+
*
2020
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2121
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2222
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -25,6 +25,12 @@
2525
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2626
* SOFTWARE.
2727
*/
28+
29+
/**
30+
* Accepted values for {@link ChangeAvailabilityConfirmation}.
31+
*
32+
* @see ChangeAvailabilityConfirmation
33+
*/
2834
public enum AvailabilityStatus {
2935
Accepted, Rejected, Scheduled
3036
}
Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
package eu.chargetime.ocpp.model;
22

3-
/**
3+
/*
44
* ChargeTime.eu - Java-OCA-OCPP
5-
* <p>
5+
*
66
* MIT License
7-
* <p>
7+
*
88
* Copyright (C) 2016 Thomas Volden <[email protected]>
9-
* <p>
9+
*
1010
* Permission is hereby granted, free of charge, to any person obtaining a copy
1111
* of this software and associated documentation files (the "Software"), to deal
1212
* in the Software without restriction, including without limitation the rights
1313
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1414
* copies of the Software, and to permit persons to whom the Software is
1515
* furnished to do so, subject to the following conditions:
16-
* <p>
16+
*
1717
* The above copyright notice and this permission notice shall be included in all
1818
* copies or substantial portions of the Software.
19-
* <p>
19+
*
2020
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2121
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2222
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -25,6 +25,12 @@
2525
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2626
* SOFTWARE.
2727
*/
28+
29+
/**
30+
* Accepted values for {@link ChangeAvailabilityRequest}.
31+
*
32+
* @see ChangeAvailabilityRequest
33+
*/
2834
public enum AvailabilityType {
2935
Inoperative, Operative
3036
}

ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/BootNotificationConfirmation.java

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import java.util.Calendar;
77
import java.util.TimeZone;
88

9-
/**
9+
/*
1010
ChargeTime.eu - Java-OCA-OCPP
1111
Copyright (C) 2015-2016 Thomas Volden <[email protected]>
1212
@@ -32,51 +32,103 @@ of this software and associated documentation files (the "Software"), to deal
3232
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3333
SOFTWARE.
3434
*/
35+
36+
/**
37+
* Sent by the Central System to the Charge Point in response to a {@link BootNotificationRequest}.
38+
*
39+
* @see BootNotificationRequest
40+
*/
3541
public class BootNotificationConfirmation implements Confirmation
3642
{
3743
private Calendar currentTime;
3844
private int interval;
3945
private RegistrationStatus status;
4046

47+
/**
48+
* Formattet Central System's current time.
49+
* Pattern: yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
50+
*
51+
* @return Formattet time.
52+
*/
4153
public String getCurrentTime()
4254
{
4355
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
4456
formatter.setTimeZone(TimeZone.getTimeZone("GMT+00:00"));
4557
return formatter.format(currentTime.getTime());
4658
}
4759

60+
/**
61+
* Central System's current time.
62+
*
63+
* @return an instance of Calendar.
64+
*/
4865
public Calendar objCurrentTime() {
4966
return currentTime;
5067
}
5168

69+
/**
70+
* Required. This contains the Central System’s current time.
71+
*
72+
* @param currentTime Central System’s current time.
73+
*/
5274
public void setCurrentTime(Calendar currentTime)
5375
{
5476
this.currentTime = currentTime;
5577
}
5678

79+
/**
80+
* When RegistrationStatus is Accepted, this contains the heartbeat interval in seconds.
81+
* If the Central System returns something other than Accepted, the value of the interval field
82+
* indicates the minimum wait time before sending a next BootNotification request.
83+
*
84+
* @return Heartbeat/delay interval in seconds.
85+
*/
5786
public int getInterval()
5887
{
5988
return interval;
6089
}
6190

91+
/**
92+
* Required. When RegistrationStatus is Accepted, this contains the heartbeat interval in seconds.
93+
* If the Central System returns something other than Accepted, the value of the interval field
94+
* indicates the minimum wait time before sending a next BootNotification request.
95+
*
96+
* @param interval heartbeat/delay interval in seconds. Min value 0.
97+
* @throws PropertyConstraintException field isn't filled out correct.
98+
*/
6299
public void setInterval(int interval) throws PropertyConstraintException {
63100
if (interval <= 0)
64101
throw new PropertyConstraintException("interval", interval, "Must be a positive value");
65102

66103
this.interval = interval;
67104
}
68105

106+
/**
107+
* This contains whether the Charge Point has been registered within the System Central.
108+
*
109+
* @return Charge Points registration status as {@link RegistrationStatus}.
110+
*/
69111
public RegistrationStatus objStatus()
70112
{
71113
return status;
72114
}
73115

116+
/**
117+
* This contains whether the Charge Point has been registered within the System Central.
118+
*
119+
* @return Charge Points registration status as String.
120+
*/
74121
public String getStatus()
75122
{
76123
return status.toString();
77124
}
78125

79-
public void setStatus(RegistrationStatus status) throws PropertyConstraintException {
126+
/**
127+
* Required. This contains whether the Charge Point has been registered within the System Central.
128+
*
129+
* @param status Charge Points registration status.
130+
*/
131+
public void setStatus(RegistrationStatus status) {
80132
this.status = status;
81133
}
82134

0 commit comments

Comments
 (0)