nstream.adapter.common.ext.PulsarIngressSettings Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nstream-adapter-common Show documentation
Show all versions of nstream-adapter-common Show documentation
General server-side data flow templates with Swim
// Copyright 2015-2024 Nstream, inc.
//
// Licensed under the Redis Source Available License 2.0 (RSALv2) Agreement;
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://redis.com/legal/rsalv2-agreement/
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package nstream.adapter.common.ext;
import java.util.Properties;
import nstream.adapter.common.AdapterSettings;
import swim.codec.Format;
import swim.codec.Output;
import swim.structure.Form;
import swim.structure.Kind;
import swim.structure.Record;
import swim.structure.Tag;
import swim.structure.Value;
import swim.util.Log;
@Tag("pulsarIngressSettings")
public class PulsarIngressSettings implements AdapterSettings {
private static final PulsarIngressJetTranslator JET_TRANSLATOR = new PulsarIngressJetTranslator();
private final String clientProvisionName;
private final String consumerPropertiesProvisionName;
private final String schemaType;
private final String contentEncodingOverride;
private final String contentTypeOverride;
private final Value valueMolder;
private final Value relaySchema;
public PulsarIngressSettings(String clientProvisionName, String consumerPropertiesProvisionName,
String schemaType, String contentEncodingOverride,
String contentTypeOverride, Value valueMolder,
Value relaySchema) {
this.clientProvisionName = clientProvisionName;
this.consumerPropertiesProvisionName = consumerPropertiesProvisionName;
this.schemaType = schemaType;
this.contentEncodingOverride = contentEncodingOverride;
this.contentTypeOverride = contentTypeOverride;
this.valueMolder = valueMolder;
this.relaySchema = relaySchema;
}
public PulsarIngressSettings() {
this("pulsarClientProvision", "consumerConfProvision", "bytearray", null, null, null, null);
}
public String clientProvisionName() {
return this.clientProvisionName;
}
public String consumerPropertiesProvisionName() {
return this.consumerPropertiesProvisionName;
}
public String schemaType() {
return this.schemaType;
}
public String contentEncodingOverride() {
return this.contentEncodingOverride;
}
public String contentTypeOverride() {
return this.contentTypeOverride;
}
public Value valueMolder() {
return this.valueMolder;
}
public Value relaySchema() {
return this.relaySchema;
}
@Override
public Output debug(Output output) {
output = output.write("PulsarIngressSettings").write('.').write("of").write('(').write(')')
.write('.').write("clientProvisionName").write('(').debug(this.clientProvisionName).write(')')
.write('.').write("consumerPropertiesProvisionName").write('(').debug(this.consumerPropertiesProvisionName).write(')')
.write('.').write("schemaType").write('(').debug(this.schemaType).write(')')
.write('.').write("contentEncodingOverride").write('(').debug(this.contentEncodingOverride).write(')')
.write('.').write("contentTypeOverride").write('(').debug(this.contentTypeOverride).write(')')
.write('.').write("valueMolder").write('(').debug(this.relaySchema).write(')')
.write('.').write("relaySchema").write('(').debug(this.relaySchema).write(')');
return output;
}
@Override
public String toString() {
return Format.debug(this);
}
@Kind
private static Form form;
private static final PulsarIngressSettings DEFAULT = new PulsarIngressSettings();
public static Form form() {
if (PulsarIngressSettings.form == null) {
PulsarIngressSettings.form = Form.forClass(PulsarIngressSettings.class);
}
return PulsarIngressSettings.form;
}
public static PulsarIngressSettings defaultSettings() {
return PulsarIngressSettings.DEFAULT;
}
public static Record moldFromProperties(Log log, Properties p) {
return JET_TRANSLATOR.moldFromProperties(log, p);
}
public static PulsarIngressSettings translateJet(Log log, PulsarIngressSettings base, Properties p) {
return JET_TRANSLATOR.translate(log, base, p);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy