|
@@ -35,10 +35,6 @@ public class ConnectorFeatures implements Writeable, ToXContentObject {
|
|
|
@Nullable
|
|
@Nullable
|
|
|
private final FeatureEnabled documentLevelSecurityEnabled;
|
|
private final FeatureEnabled documentLevelSecurityEnabled;
|
|
|
@Nullable
|
|
@Nullable
|
|
|
- private final Boolean filteringAdvancedConfigEnabled;
|
|
|
|
|
- @Nullable
|
|
|
|
|
- private final Boolean filteringRulesEnabled;
|
|
|
|
|
- @Nullable
|
|
|
|
|
private final FeatureEnabled incrementalSyncEnabled;
|
|
private final FeatureEnabled incrementalSyncEnabled;
|
|
|
@Nullable
|
|
@Nullable
|
|
|
private final FeatureEnabled nativeConnectorAPIKeysEnabled;
|
|
private final FeatureEnabled nativeConnectorAPIKeysEnabled;
|
|
@@ -49,23 +45,17 @@ public class ConnectorFeatures implements Writeable, ToXContentObject {
|
|
|
* Constructs a new instance of ConnectorFeatures.
|
|
* Constructs a new instance of ConnectorFeatures.
|
|
|
*
|
|
*
|
|
|
* @param documentLevelSecurityEnabled A flag indicating whether document-level security is enabled.
|
|
* @param documentLevelSecurityEnabled A flag indicating whether document-level security is enabled.
|
|
|
- * @param filteringAdvancedConfig A flag indicating whether advanced filtering configuration is enabled.
|
|
|
|
|
- * @param filteringRules A flag indicating whether filtering rules are enabled.
|
|
|
|
|
* @param incrementalSyncEnabled A flag indicating whether incremental sync is enabled.
|
|
* @param incrementalSyncEnabled A flag indicating whether incremental sync is enabled.
|
|
|
* @param nativeConnectorAPIKeysEnabled A flag indicating whether support for api keys is enabled for native connectors.
|
|
* @param nativeConnectorAPIKeysEnabled A flag indicating whether support for api keys is enabled for native connectors.
|
|
|
* @param syncRulesFeatures An {@link SyncRulesFeatures} object indicating if basic and advanced sync rules are enabled.
|
|
* @param syncRulesFeatures An {@link SyncRulesFeatures} object indicating if basic and advanced sync rules are enabled.
|
|
|
*/
|
|
*/
|
|
|
private ConnectorFeatures(
|
|
private ConnectorFeatures(
|
|
|
FeatureEnabled documentLevelSecurityEnabled,
|
|
FeatureEnabled documentLevelSecurityEnabled,
|
|
|
- Boolean filteringAdvancedConfig,
|
|
|
|
|
- Boolean filteringRules,
|
|
|
|
|
FeatureEnabled incrementalSyncEnabled,
|
|
FeatureEnabled incrementalSyncEnabled,
|
|
|
FeatureEnabled nativeConnectorAPIKeysEnabled,
|
|
FeatureEnabled nativeConnectorAPIKeysEnabled,
|
|
|
SyncRulesFeatures syncRulesFeatures
|
|
SyncRulesFeatures syncRulesFeatures
|
|
|
) {
|
|
) {
|
|
|
this.documentLevelSecurityEnabled = documentLevelSecurityEnabled;
|
|
this.documentLevelSecurityEnabled = documentLevelSecurityEnabled;
|
|
|
- this.filteringAdvancedConfigEnabled = filteringAdvancedConfig;
|
|
|
|
|
- this.filteringRulesEnabled = filteringRules;
|
|
|
|
|
this.incrementalSyncEnabled = incrementalSyncEnabled;
|
|
this.incrementalSyncEnabled = incrementalSyncEnabled;
|
|
|
this.nativeConnectorAPIKeysEnabled = nativeConnectorAPIKeysEnabled;
|
|
this.nativeConnectorAPIKeysEnabled = nativeConnectorAPIKeysEnabled;
|
|
|
this.syncRulesFeatures = syncRulesFeatures;
|
|
this.syncRulesFeatures = syncRulesFeatures;
|
|
@@ -73,16 +63,12 @@ public class ConnectorFeatures implements Writeable, ToXContentObject {
|
|
|
|
|
|
|
|
public ConnectorFeatures(StreamInput in) throws IOException {
|
|
public ConnectorFeatures(StreamInput in) throws IOException {
|
|
|
this.documentLevelSecurityEnabled = in.readOptionalWriteable(FeatureEnabled::new);
|
|
this.documentLevelSecurityEnabled = in.readOptionalWriteable(FeatureEnabled::new);
|
|
|
- this.filteringAdvancedConfigEnabled = in.readOptionalBoolean();
|
|
|
|
|
- this.filteringRulesEnabled = in.readOptionalBoolean();
|
|
|
|
|
this.incrementalSyncEnabled = in.readOptionalWriteable(FeatureEnabled::new);
|
|
this.incrementalSyncEnabled = in.readOptionalWriteable(FeatureEnabled::new);
|
|
|
this.nativeConnectorAPIKeysEnabled = in.readOptionalWriteable(FeatureEnabled::new);
|
|
this.nativeConnectorAPIKeysEnabled = in.readOptionalWriteable(FeatureEnabled::new);
|
|
|
this.syncRulesFeatures = in.readOptionalWriteable(SyncRulesFeatures::new);
|
|
this.syncRulesFeatures = in.readOptionalWriteable(SyncRulesFeatures::new);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private static final ParseField DOCUMENT_LEVEL_SECURITY_ENABLED_FIELD = new ParseField("document_level_security");
|
|
private static final ParseField DOCUMENT_LEVEL_SECURITY_ENABLED_FIELD = new ParseField("document_level_security");
|
|
|
- private static final ParseField FILTERING_ADVANCED_CONFIG_ENABLED_FIELD = new ParseField("filtering_advanced_config");
|
|
|
|
|
- private static final ParseField FILTERING_RULES_ENABLED_FIELD = new ParseField("filtering_rules");
|
|
|
|
|
private static final ParseField INCREMENTAL_SYNC_ENABLED_FIELD = new ParseField("incremental_sync");
|
|
private static final ParseField INCREMENTAL_SYNC_ENABLED_FIELD = new ParseField("incremental_sync");
|
|
|
private static final ParseField NATIVE_CONNECTOR_API_KEYS_ENABLED_FIELD = new ParseField("native_connector_api_keys");
|
|
private static final ParseField NATIVE_CONNECTOR_API_KEYS_ENABLED_FIELD = new ParseField("native_connector_api_keys");
|
|
|
private static final ParseField SYNC_RULES_FIELD = new ParseField("sync_rules");
|
|
private static final ParseField SYNC_RULES_FIELD = new ParseField("sync_rules");
|
|
@@ -91,18 +77,14 @@ public class ConnectorFeatures implements Writeable, ToXContentObject {
|
|
|
"connector_features",
|
|
"connector_features",
|
|
|
true,
|
|
true,
|
|
|
args -> new Builder().setDocumentLevelSecurityEnabled((FeatureEnabled) args[0])
|
|
args -> new Builder().setDocumentLevelSecurityEnabled((FeatureEnabled) args[0])
|
|
|
- .setFilteringAdvancedConfig((Boolean) args[1])
|
|
|
|
|
- .setFilteringRules((Boolean) args[2])
|
|
|
|
|
- .setIncrementalSyncEnabled((FeatureEnabled) args[3])
|
|
|
|
|
- .setNativeConnectorAPIKeysEnabled((FeatureEnabled) args[4])
|
|
|
|
|
- .setSyncRulesFeatures((SyncRulesFeatures) args[5])
|
|
|
|
|
|
|
+ .setIncrementalSyncEnabled((FeatureEnabled) args[1])
|
|
|
|
|
+ .setNativeConnectorAPIKeysEnabled((FeatureEnabled) args[2])
|
|
|
|
|
+ .setSyncRulesFeatures((SyncRulesFeatures) args[3])
|
|
|
.build()
|
|
.build()
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
static {
|
|
static {
|
|
|
PARSER.declareObject(optionalConstructorArg(), (p, c) -> FeatureEnabled.fromXContent(p), DOCUMENT_LEVEL_SECURITY_ENABLED_FIELD);
|
|
PARSER.declareObject(optionalConstructorArg(), (p, c) -> FeatureEnabled.fromXContent(p), DOCUMENT_LEVEL_SECURITY_ENABLED_FIELD);
|
|
|
- PARSER.declareBoolean(optionalConstructorArg(), FILTERING_ADVANCED_CONFIG_ENABLED_FIELD);
|
|
|
|
|
- PARSER.declareBoolean(optionalConstructorArg(), FILTERING_RULES_ENABLED_FIELD);
|
|
|
|
|
PARSER.declareObject(optionalConstructorArg(), (p, c) -> FeatureEnabled.fromXContent(p), INCREMENTAL_SYNC_ENABLED_FIELD);
|
|
PARSER.declareObject(optionalConstructorArg(), (p, c) -> FeatureEnabled.fromXContent(p), INCREMENTAL_SYNC_ENABLED_FIELD);
|
|
|
PARSER.declareObject(optionalConstructorArg(), (p, c) -> FeatureEnabled.fromXContent(p), NATIVE_CONNECTOR_API_KEYS_ENABLED_FIELD);
|
|
PARSER.declareObject(optionalConstructorArg(), (p, c) -> FeatureEnabled.fromXContent(p), NATIVE_CONNECTOR_API_KEYS_ENABLED_FIELD);
|
|
|
PARSER.declareObject(optionalConstructorArg(), (p, c) -> SyncRulesFeatures.fromXContent(p), SYNC_RULES_FIELD);
|
|
PARSER.declareObject(optionalConstructorArg(), (p, c) -> SyncRulesFeatures.fromXContent(p), SYNC_RULES_FIELD);
|
|
@@ -127,12 +109,6 @@ public class ConnectorFeatures implements Writeable, ToXContentObject {
|
|
|
if (documentLevelSecurityEnabled != null) {
|
|
if (documentLevelSecurityEnabled != null) {
|
|
|
builder.field(DOCUMENT_LEVEL_SECURITY_ENABLED_FIELD.getPreferredName(), documentLevelSecurityEnabled);
|
|
builder.field(DOCUMENT_LEVEL_SECURITY_ENABLED_FIELD.getPreferredName(), documentLevelSecurityEnabled);
|
|
|
}
|
|
}
|
|
|
- if (filteringAdvancedConfigEnabled != null) {
|
|
|
|
|
- builder.field(FILTERING_ADVANCED_CONFIG_ENABLED_FIELD.getPreferredName(), filteringAdvancedConfigEnabled);
|
|
|
|
|
- }
|
|
|
|
|
- if (filteringRulesEnabled != null) {
|
|
|
|
|
- builder.field(FILTERING_RULES_ENABLED_FIELD.getPreferredName(), filteringRulesEnabled);
|
|
|
|
|
- }
|
|
|
|
|
if (incrementalSyncEnabled != null) {
|
|
if (incrementalSyncEnabled != null) {
|
|
|
builder.field(INCREMENTAL_SYNC_ENABLED_FIELD.getPreferredName(), incrementalSyncEnabled);
|
|
builder.field(INCREMENTAL_SYNC_ENABLED_FIELD.getPreferredName(), incrementalSyncEnabled);
|
|
|
}
|
|
}
|
|
@@ -150,8 +126,6 @@ public class ConnectorFeatures implements Writeable, ToXContentObject {
|
|
|
@Override
|
|
@Override
|
|
|
public void writeTo(StreamOutput out) throws IOException {
|
|
public void writeTo(StreamOutput out) throws IOException {
|
|
|
out.writeOptionalWriteable(documentLevelSecurityEnabled);
|
|
out.writeOptionalWriteable(documentLevelSecurityEnabled);
|
|
|
- out.writeOptionalBoolean(filteringAdvancedConfigEnabled);
|
|
|
|
|
- out.writeOptionalBoolean(filteringRulesEnabled);
|
|
|
|
|
out.writeOptionalWriteable(incrementalSyncEnabled);
|
|
out.writeOptionalWriteable(incrementalSyncEnabled);
|
|
|
out.writeOptionalWriteable(nativeConnectorAPIKeysEnabled);
|
|
out.writeOptionalWriteable(nativeConnectorAPIKeysEnabled);
|
|
|
out.writeOptionalWriteable(syncRulesFeatures);
|
|
out.writeOptionalWriteable(syncRulesFeatures);
|
|
@@ -163,8 +137,6 @@ public class ConnectorFeatures implements Writeable, ToXContentObject {
|
|
|
if (o == null || getClass() != o.getClass()) return false;
|
|
if (o == null || getClass() != o.getClass()) return false;
|
|
|
ConnectorFeatures features = (ConnectorFeatures) o;
|
|
ConnectorFeatures features = (ConnectorFeatures) o;
|
|
|
return Objects.equals(documentLevelSecurityEnabled, features.documentLevelSecurityEnabled)
|
|
return Objects.equals(documentLevelSecurityEnabled, features.documentLevelSecurityEnabled)
|
|
|
- && Objects.equals(filteringAdvancedConfigEnabled, features.filteringAdvancedConfigEnabled)
|
|
|
|
|
- && Objects.equals(filteringRulesEnabled, features.filteringRulesEnabled)
|
|
|
|
|
&& Objects.equals(incrementalSyncEnabled, features.incrementalSyncEnabled)
|
|
&& Objects.equals(incrementalSyncEnabled, features.incrementalSyncEnabled)
|
|
|
&& Objects.equals(nativeConnectorAPIKeysEnabled, features.nativeConnectorAPIKeysEnabled)
|
|
&& Objects.equals(nativeConnectorAPIKeysEnabled, features.nativeConnectorAPIKeysEnabled)
|
|
|
&& Objects.equals(syncRulesFeatures, features.syncRulesFeatures);
|
|
&& Objects.equals(syncRulesFeatures, features.syncRulesFeatures);
|
|
@@ -172,21 +144,12 @@ public class ConnectorFeatures implements Writeable, ToXContentObject {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public int hashCode() {
|
|
public int hashCode() {
|
|
|
- return Objects.hash(
|
|
|
|
|
- documentLevelSecurityEnabled,
|
|
|
|
|
- filteringAdvancedConfigEnabled,
|
|
|
|
|
- filteringRulesEnabled,
|
|
|
|
|
- incrementalSyncEnabled,
|
|
|
|
|
- nativeConnectorAPIKeysEnabled,
|
|
|
|
|
- syncRulesFeatures
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ return Objects.hash(documentLevelSecurityEnabled, incrementalSyncEnabled, nativeConnectorAPIKeysEnabled, syncRulesFeatures);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public static class Builder {
|
|
public static class Builder {
|
|
|
|
|
|
|
|
private FeatureEnabled documentLevelSecurityEnabled;
|
|
private FeatureEnabled documentLevelSecurityEnabled;
|
|
|
- private Boolean filteringAdvancedConfig;
|
|
|
|
|
- private Boolean filteringRules;
|
|
|
|
|
private FeatureEnabled incrementalSyncEnabled;
|
|
private FeatureEnabled incrementalSyncEnabled;
|
|
|
private FeatureEnabled nativeConnectorAPIKeysEnabled;
|
|
private FeatureEnabled nativeConnectorAPIKeysEnabled;
|
|
|
private SyncRulesFeatures syncRulesFeatures;
|
|
private SyncRulesFeatures syncRulesFeatures;
|
|
@@ -196,16 +159,6 @@ public class ConnectorFeatures implements Writeable, ToXContentObject {
|
|
|
return this;
|
|
return this;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public Builder setFilteringAdvancedConfig(Boolean filteringAdvancedConfig) {
|
|
|
|
|
- this.filteringAdvancedConfig = filteringAdvancedConfig;
|
|
|
|
|
- return this;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public Builder setFilteringRules(Boolean filteringRules) {
|
|
|
|
|
- this.filteringRules = filteringRules;
|
|
|
|
|
- return this;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
public Builder setIncrementalSyncEnabled(FeatureEnabled incrementalSyncEnabled) {
|
|
public Builder setIncrementalSyncEnabled(FeatureEnabled incrementalSyncEnabled) {
|
|
|
this.incrementalSyncEnabled = incrementalSyncEnabled;
|
|
this.incrementalSyncEnabled = incrementalSyncEnabled;
|
|
|
return this;
|
|
return this;
|
|
@@ -224,8 +177,6 @@ public class ConnectorFeatures implements Writeable, ToXContentObject {
|
|
|
public ConnectorFeatures build() {
|
|
public ConnectorFeatures build() {
|
|
|
return new ConnectorFeatures(
|
|
return new ConnectorFeatures(
|
|
|
documentLevelSecurityEnabled,
|
|
documentLevelSecurityEnabled,
|
|
|
- filteringAdvancedConfig,
|
|
|
|
|
- filteringRules,
|
|
|
|
|
incrementalSyncEnabled,
|
|
incrementalSyncEnabled,
|
|
|
nativeConnectorAPIKeysEnabled,
|
|
nativeConnectorAPIKeysEnabled,
|
|
|
syncRulesFeatures
|
|
syncRulesFeatures
|