-
Notifications
You must be signed in to change notification settings - Fork 197
Expand file tree
/
Copy pathCommunicatorEvents.java
More file actions
99 lines (86 loc) · 3.47 KB
/
CommunicatorEvents.java
File metadata and controls
99 lines (86 loc) · 3.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
package eu.chargetime.ocpp;
/*
ChargeTime.eu - Java-OCA-OCPP
Copyright (C) 2015-2016 Thomas Volden <tv@chargetime.eu>
MIT License
Copyright (C) 2016-2018 Thomas Volden
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/** Call back handler for communicator events. */
public interface CommunicatorEvents {
/**
* Handle call result.
*
* <p>Hint: Use the id to identify the confirmation type, you can then choose to use the {@link
* Communicator}s unpackPayload method.
*
* @param id unique id used to identify the original request.
* @param action Optional. The action.
* @param payload raw payload.
*/
void onCallResult(String id, String action, Object payload);
/**
* Handle call.
*
* <p>Hint: Use the action name to identify the request, you can then choose to use {@link
* Communicator}s unpackPayload method.
*
* @param id unique id used to reply to server.
* @param action action name used to identify the feature.
* @param payload raw payload.
*/
void onCall(String id, String action, Object payload);
/**
* Handle call error.
*
* <p>Hint: Use the id to identify the original call. You can use {@link Communicator}s
* unpackPayload method.
*
* @param id unique id used to identify the original request.
* @param errorCode short text to categorize the error.
* @param errorDescription a longer text to describe the error.
* @param payload Object payload attached to the error.
*/
void onError(String id, String errorCode, String errorDescription, Object payload);
/**
* Handle call result error.
*
* <p>Hint: Use the id to identify the original call result. You can use {@link Communicator}s
* unpackPayload method.
*
* @param id unique id used to identify the original call result.
* @param errorCode short text to categorize the error.
* @param errorDescription a longer text to describe the error.
* @param payload Object payload attached to the error.
*/
void onCallResultError(String id, String errorCode, String errorDescription, Object payload);
/**
* Handle send.
*
* <p>Hint: Use the action name to identify the feature, you can then choose to use {@link
* Communicator}s unpackPayload method.
*
* @param id unique id.
* @param action action name used to identify the feature.
* @param payload raw payload.
*/
void onSend(String id, String action, Object payload);
/** The connection was disconnected. */
void onDisconnected();
/** A connection was established. */
void onConnected();
}