-
Notifications
You must be signed in to change notification settings - Fork 215
/
PersistenceConstants.java
200 lines (160 loc) · 5.37 KB
/
PersistenceConstants.java
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
/*
* Copyright (c) 2017 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.ditto.thingsearch.service.persistence;
import org.eclipse.ditto.rql.query.expression.FieldExpressionUtil;
/**
* Constants for Search Persistence.
*/
public final class PersistenceConstants {
/**
* A dot.
*/
public static final String DOT = ".";
/**
* A slash.
*/
public static final String SLASH = "/";
/**
* The thing collection name.
*/
public static final String THINGS_COLLECTION_NAME = "search";
/**
* The collection name for the background sync collection storing background sync progress.
*/
public static final String BACKGROUND_SYNC_COLLECTION_NAME = "searchSync";
/**
* Field name for revision.
*/
public static final String FIELD_REVISION = "_revision";
/**
* Field name for _id.
*/
public static final String FIELD_ID = FieldExpressionUtil.FIELD_ID;
/**
* Field name for policy id.
*/
public static final String FIELD_POLICY_ID = "policyId";
/**
* Field name for policy revision.
*/
public static final String FIELD_POLICY_REVISION = "__policyRev";
/**
* Field name for the array of all referenced policies. This field includes the actual thing policy as well as all
* policies that are imported by the thing policy.
*/
public static final String FIELD_REFERENCED_POLICIES = "__referencedPolicies";
/**
* Field name for count.
*/
public static final String FIELD_COUNT = "count";
/**
* Field name for _namespace.
*/
public static final String FIELD_NAMESPACE = "_namespace";
/**
* Field name for _metadata.
*/
public static final String FIELD_METADATA = "_metadata";
/**
* Field name for attributes.
*/
public static final String FIELD_ATTRIBUTES = "attributes";
/**
* Field name for features.
*/
public static final String FIELD_FEATURES = "features";
/**
* Field name for feature ID.
*/
public static final String FIELD_FEATURE_ID = "id";
/**
* Field name for feature properties.
*/
public static final String FIELD_PROPERTIES = "properties";
/**
* Field name for feature definition.
*/
public static final String FIELD_DEFINITION = "definition";
/**
* Part of the path between feature ID and property key.
*/
public static final String PROPERTIES = SLASH + FIELD_PROPERTIES + SLASH;
/**
* Field name for feature desiredProperties.
*/
public static final String FIELD_DESIRED_PROPERTIES = "desiredProperties";
/**
* Part of the path between feature ID and desiredProperty key.
*/
public static final String DESIRED_PROPERTIES = SLASH + FIELD_DESIRED_PROPERTIES + SLASH;
/**
* Field name for features.
*/
public static final String FIELD_FEATURES_PATH = SLASH + FIELD_FEATURES + SLASH;
/**
* Prefix for the path to attributes.
*/
public static final String FIELD_ATTRIBUTES_PATH = SLASH + FIELD_ATTRIBUTES + SLASH;
/**
* Prefix for the path to _metadata.
*/
public static final String FIELD_METADATA_PATH = SLASH + FIELD_METADATA + SLASH;
/**
* Field name for subject IDs with partial READ permission and are not revoked at root.
*/
public static final String FIELD_GLOBAL_READ = "gr";
/**
* Field name for hierarchical attributes for sorting.
*/
public static final String FIELD_THING = "t";
/**
* Field name for the "f" array containing features for wildcard-feature queries.
*/
public static final String FIELD_F_ARRAY = "f";
/**
* Field name for policies.
*/
public static final String FIELD_POLICY = "p";
/**
* Field name for policies of features.
*/
public static final String FIELD_FEATURE_POLICY = FIELD_F_ARRAY + DOT + FIELD_POLICY;
/**
* Special character used as prefix for grant (g) and revoke (r) fields in index document to avoid conflict
* actual fields in a thing. The character is part of the restricted fields (see
* {@link org.eclipse.ditto.base.model.entity.id.RegexPatterns#CONTROL_CHARS}).
*/
private static final String FIELD_PERMISSION_PREFIX = Character.valueOf((char) 183).toString();
/**
* Field name for policy read grants.
*/
public static final String FIELD_GRANTED = FIELD_PERMISSION_PREFIX + "g";
/**
* Field name for policy read revokes.
*/
public static final String FIELD_REVOKED = FIELD_PERMISSION_PREFIX + "r";
/**
* Mark a document for deletion.
*/
public static final String FIELD_DELETE_AT = "deleteAt";
/**
* Field name for the last modified timestamp under FIELD_SORTING.
*/
public static final String FIELD_MODIFIED = "_modified";
/**
* Expression of the full path of the last modified timestamp under FIELD_SORTING.
*/
public static final String FIELD_PATH_MODIFIED = FIELD_THING + DOT + FIELD_MODIFIED;
private PersistenceConstants() {
}
}