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 package info.magnolia.rest.delivery.jcr.v2;
35
36 import info.magnolia.jcr.util.NodeTypes.Content;
37 import info.magnolia.jcr.util.NodeTypes.ContentNode;
38 import info.magnolia.rest.reference.ReferenceDefinition;
39 import info.magnolia.rest.registry.ConfiguredEndpointDefinition;
40
41 import java.util.ArrayList;
42 import java.util.Collections;
43 import java.util.List;
44
45
46
47
48 public class ConfiguredJcrDeliveryEndpointDefinition extends ConfiguredEndpointDefinition implements JcrDeliveryEndpointDefinition {
49
50 private String workspace;
51 private String rootPath;
52 private boolean strict = false;
53 private List<String> nodeTypes = Collections.singletonList(Content.NAME);
54 private List<String> childNodeTypes = Collections.singletonList(ContentNode.NAME);
55 private List<String> systemProperties = new ArrayList<>();
56 private int depth = 0;
57 private int referenceDepth = 1;
58 private boolean referenceRepeat = false;
59 private long limit = 10;
60 private boolean includeSystemProperties = false;
61 private boolean bypassWorkspaceAcls = false;
62 private List<ReferenceDefinition> references = new ArrayList<>();
63
64 public ConfiguredJcrDeliveryEndpointDefinition() {
65 setImplementationClass(JcrDeliveryEndpoint.class);
66 }
67
68 @Override
69 public String getWorkspace() {
70 return workspace;
71 }
72
73 public void setWorkspace(String workspace) {
74 this.workspace = workspace;
75 }
76
77 @Override
78 public String getRootPath() {
79 return rootPath;
80 }
81
82 public void setRootPath(String rootPath) {
83 this.rootPath = rootPath;
84 }
85
86 @Override
87 public boolean isStrict() {
88 return strict;
89 }
90
91 public void setStrict(boolean strict) {
92 this.strict = strict;
93 }
94
95 @Override
96 public List<String> getNodeTypes() {
97 return nodeTypes;
98 }
99
100 public void setNodeTypes(List<String> nodeTypes) {
101 this.nodeTypes = nodeTypes;
102 }
103
104 @Override
105 public List<String> getChildNodeTypes() {
106 return childNodeTypes;
107 }
108
109 public void setChildNodeTypes(List<String> childNodeTypes) {
110 this.childNodeTypes = childNodeTypes;
111 }
112
113 @Override
114 public int getDepth() {
115 return depth;
116 }
117
118 public void setDepth(int depth) {
119 this.depth = depth;
120 }
121
122 @Override
123 public int getReferenceDepth() {
124 return referenceDepth;
125 }
126
127 public void setReferenceDepth(int referenceDepth) {
128 if (referenceDepth >= 0) {
129 this.referenceDepth = referenceDepth;
130 }
131 }
132
133 @Override
134 public boolean isReferenceRepeat() {
135 return referenceRepeat;
136 }
137
138 public void setReferenceRepeat(boolean referenceRepeat) {
139 this.referenceRepeat = referenceRepeat;
140 }
141
142 @Override
143 public long getLimit() {
144 return limit;
145 }
146
147 public void setLimit(long limit) {
148 this.limit = limit;
149 }
150
151 @Override
152 public boolean isIncludeSystemProperties() {
153 return includeSystemProperties;
154 }
155
156 public void setIncludeSystemProperties(boolean includeSystemProperties) {
157 this.includeSystemProperties = includeSystemProperties;
158 }
159
160 @Override
161 public boolean isBypassWorkspaceAcls() {
162 return bypassWorkspaceAcls;
163 }
164
165 public void setBypassWorkspaceAcls(boolean bypassWorkspaceAcls) {
166 this.bypassWorkspaceAcls = bypassWorkspaceAcls;
167 }
168
169 @Override
170 public List<ReferenceDefinition> getReferences() {
171 return references;
172 }
173
174 public void setReferences(List<ReferenceDefinition> references) {
175 this.references = references;
176 }
177
178 @Override
179 public List<String> getSystemProperties() {
180 return systemProperties;
181 }
182
183 public void setSystemProperties(List<String> systemProperties) {
184 this.systemProperties = systemProperties;
185 }
186 }