comparison JavaSDK/be/uclouvain/orthanc/Callbacks.java @ 33:10406d66d1c6

cppcheck
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 14 Jun 2024 11:14:02 +0200
parents 1c407ba1d311
children
comparison
equal deleted inserted replaced
32:09f60b487512 33:10406d66d1c6
28 28
29 /** 29 /**
30 * Wrapper around the callbacks provided by the Orthanc SDK. 30 * Wrapper around the callbacks provided by the Orthanc SDK.
31 **/ 31 **/
32 public class Callbacks { 32 public class Callbacks {
33 /**
34 * Callback to react to changes.
35 **/
33 public interface OnChange { 36 public interface OnChange {
37 /**
38 * Signature of a callback function that is triggered when a
39 * change happens to some DICOM resource.
40 * @param changeType The type of change.
41 * @param resourceType The type of resource affected by this change.
42 * @param resourceId The identifier of the affected resource, if any.
43 **/
34 public void call(ChangeType changeType, 44 public void call(ChangeType changeType,
35 ResourceType resourceType, 45 ResourceType resourceType,
36 String resourceId); 46 String resourceId);
37 } 47 }
38 48
49 /**
50 * Callback to serve a resource in the REST API.
51 **/
39 public interface OnRestRequest { 52 public interface OnRestRequest {
53 /**
54 * Signature of a callback function that answers a REST request.
55 * @param output Output containing the answer that is sent to the REST client.
56 * @param method The HTTP method.
57 * @param uri The URI, starting from the root of the Orthanc server.
58 * @param regularExpressionGroups The actual values of the groups matched by the regular expression.
59 * @param headers The HTTP headers of the request.
60 * @param getParameters The parameters of a GET request.
61 * @param body The body of the request (only applicable to POST and PUT methods).
62 **/
40 public void call(RestOutput output, 63 public void call(RestOutput output,
41 HttpMethod method, 64 HttpMethod method,
42 String uri, 65 String uri,
43 String[] regularExpressionGroups, 66 String[] regularExpressionGroups,
44 Map<String, String> headers, 67 Map<String, String> headers,
45 Map<String, String> getParameters, 68 Map<String, String> getParameters,
46 byte[] body); 69 byte[] body);
47 } 70 }
48 71
72 /**
73 * Register a callback to monitor changes.
74 * @param callback The callback to handle the change.
75 **/
49 public static native void register(OnChange callback); 76 public static native void register(OnChange callback);
50 77
78 /**
79 * Register a REST callback. Note that the callback will NOT be
80 * invoked in mutual exclusion.
81 * @param pathRegularExpression Regular expression for the URI. May contain groups.
82 * @param callback The callback to handle the REST call.
83 **/
51 public static native void register(String pathRegularExpression, 84 public static native void register(String pathRegularExpression,
52 OnRestRequest callback); 85 OnRestRequest callback);
53 } 86 }