1 /*
2 * The contents of this file are subject to the terms of the Common Development and
3 * Distribution License (the License). You may not use this file except in compliance with the
4 * License.
5 *
6 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
7 * specific language governing permission and limitations under the License.
8 *
9 * When distributing Covered Software, include this CDDL Header Notice in each file and include
10 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
11 * Header, with the fields enclosed by brackets [] replaced by your own identifying
12 * information: "Portions copyright [year] [name of copyright owner]".
13 *
14 * Copyright 2016 ForgeRock AS.
15 */
16
17 package org.forgerock.api.jackson;
18
19 import org.forgerock.api.enums.ReadPolicy;
20 import org.forgerock.api.enums.WritePolicy;
21
22 /**
23 * Extension interface for CREST subclasses of Jackson's {@code JsonSchema} to specify the field read and write
24 * policies.
25 */
26 interface CrestReadWritePoliciesSchema {
27
28 /**
29 * Get the write policy for the property.
30 *
31 * @return The write policy.
32 */
33 WritePolicy getWritePolicy();
34
35 /**
36 * Set the write policy for the property.
37 *
38 * @param policy The write policy.
39 */
40 void setWritePolicy(WritePolicy policy);
41
42 /**
43 * Get the read policy for the property.
44 *
45 * @return The read policy.
46 */
47 ReadPolicy getReadPolicy();
48
49 /**
50 * Set the read policy for the property.
51 *
52 * @param policy The read policy.
53 */
54 void setReadPolicy(ReadPolicy policy);
55
56 /**
57 * Get the error indicator for failed write policy.
58 *
59 * @return Whether errors will be returned.
60 */
61 Boolean getErrorOnWritePolicyFailure();
62
63 /**
64 * Set the error indicator for failed write policy.
65 *
66 * @param errorOnWritePolicyFailure Whether errors will be returned.
67 */
68 void setErrorOnWritePolicyFailure(Boolean errorOnWritePolicyFailure);
69
70 /**
71 * Set the return-on-demand field.
72 *
73 * @return {@code true} when a field is available, but must be explicitly requested, or {@code false} (default) when
74 * always returned.
75 */
76 Boolean getReturnOnDemand();
77
78 /**
79 * Get the return-on-demand field.
80 *
81 * @param returnOnDemand {@code true} when a field is available, but must be explicitly requested, or
82 * {@code false} (default) when always returned.
83 */
84 void setReturnOnDemand(Boolean returnOnDemand);
85 }