Tabnine Logo
PropertyDescriptor
Code IndexAdd Tabnine to your IDE (free)

How to use
PropertyDescriptor
in
com.hurence.logisland.component

Best Java code snippets using com.hurence.logisland.component.PropertyDescriptor (Showing top 20 results out of 315)

origin: com.hurence.logisland/logisland-api

@Override
public int compareTo(final PropertyDescriptor o) {
  if (o == null) {
    return -1;
  }
  return getName().compareTo(o.getName());
}
origin: com.hurence.logisland/logisland-common-processors-plugin

  private Map<String, String> getFieldsNameMapping(ProcessContext context) {
    /**
     * list alternative regex
     */
    Map<String, String> fieldsNameMappings = new HashMap<>();
    // loop over dynamic properties to add alternative regex
    for (final Map.Entry<PropertyDescriptor, String> entry : context.getProperties().entrySet()) {
      if (!entry.getKey().isDynamic()) {
        continue;
      }

      final String fieldName = entry.getKey().getName();
      final String mapping = entry.getValue();

      fieldsNameMappings.put(fieldName, mapping);
    }
    return fieldsNameMappings;
  }
}
origin: com.hurence.logisland/logisland-common-processors-plugin

logger.debug("property {} value changed from {} to {}", descriptor.getName(), oldValue, newValue);
if (descriptor.equals(DEBUG))
if (descriptor.equals(SMTP_SERVER))
if (descriptor.equals(SMTP_PORT))
if (descriptor.equals(SMTP_SECURITY_USERNAME))
if (descriptor.equals(SMTP_SECURITY_PASSWORD))
if (descriptor.equals(SMTP_SECURITY_SSL))
if (descriptor.equals(MAIL_FROM_ADDRESS))
if (descriptor.equals(MAIL_FROM_NAME))
if (descriptor.equals(MAIL_BOUNCE_ADDRESS))
if (descriptor.equals(MAIL_REPLYTO_ADDRESS))
if (descriptor.equals(MAIL_SUBJECT))
if (descriptor.equals(MAIL_TO))
if (descriptor.equals(ALLOW_OVERWRITE))
if (descriptor.equals(HTML_TEMPLATE))
origin: com.hurence.logisland/logisland-api

public StandardValidationContext(final Map<PropertyDescriptor, String> properties) {
  this.properties = new HashMap<>(properties);
  expressionLanguageSupported = new HashMap<>(properties.size());
  for (final PropertyDescriptor descriptor : properties.keySet()) {
    expressionLanguageSupported.put(descriptor.getName(), descriptor.isExpressionLanguageSupported());
  }
}
origin: com.hurence.logisland/logisland-documentation

generator.writeStringField("name", property.getName());
generator.writeBooleanField("isRequired", property.isRequired());
if (property.getDescription() != null && property.getDescription().trim().length() > 0) {
  generator.writeStringField("description", property.getDescription());
} else {
  generator.writeStringField("description", "No Description Provided.");
generator.writeStringField("defaultValue", property.getDefaultValue());
generator.writeBooleanField("isDynamic", property.isDynamic());
generator.writeBooleanField("isSensitive", property.isSensitive());
generator.writeBooleanField("isExpressionLanguageSupported", property.isExpressionLanguageSupported());
generator.writeEndObject();
origin: com.hurence.logisland/logisland-api

private PropertyDescriptor getPropertyDescriptor(final PropertyDescriptor specDescriptor) {
  PropertyDescriptor descriptor = null;
  //check if property supported
  final List<PropertyDescriptor> supportedDescriptors = getSupportedPropertyDescriptors();
  if (supportedDescriptors != null) {
    for (final PropertyDescriptor desc : supportedDescriptors) { //find actual descriptor
      if (specDescriptor.equals(desc)) {
        return desc;
      }
    }
  }
  descriptor = getSupportedDynamicPropertyDescriptor(specDescriptor.getName());
  if (descriptor != null && !descriptor.isDynamic()) {
    descriptor = new PropertyDescriptor.Builder().fromPropertyDescriptor(descriptor).dynamic(true).build();
  }
  if (descriptor == null) {
    descriptor = new PropertyDescriptor.Builder().fromPropertyDescriptor(specDescriptor).addValidator(Validator.INVALID).dynamic(true).build();
  }
  return descriptor;
}
origin: com.hurence.logisland/logisland-api

String value = context.getPropertyValue(descriptor).asString();
if (value == null) {
  value = descriptor.getDefaultValue();
if (value == null && descriptor.isRequired()) {
  results.add(new ValidationResult.Builder().valid(false).input(null).subject(descriptor.getName()).explanation(descriptor.getName() + " is required").build());
  continue;
} else if (value == null) {
final ValidationResult result = descriptor.validate(value);
if (!result.isValid()) {
  results.add(result);
final ValidationResult result = descriptor.validate(value);
if (!result.isValid()) {
  results.add(result);
origin: com.hurence.logisland/logisland-documentation

xmlStreamWriter.writeStartElement("td");
xmlStreamWriter.writeAttribute("id", "name");
if (property.isRequired()) {
  writeSimpleElement(xmlStreamWriter, "strong", property.getDisplayName());
} else {
  xmlStreamWriter.writeCharacters(property.getDisplayName());
writeSimpleElement(xmlStreamWriter, "td", property.getDefaultValue(), false, "default-value");
xmlStreamWriter.writeStartElement("td");
xmlStreamWriter.writeAttribute("id", "allowable-values");
xmlStreamWriter.writeStartElement("td");
xmlStreamWriter.writeAttribute("id", "description");
if (property.getDescription() != null && property.getDescription().trim().length() > 0) {
  xmlStreamWriter.writeCharacters(property.getDescription());
} else {
  xmlStreamWriter.writeCharacters("No Description Provided.");
if (property.isSensitive()) {
  xmlStreamWriter.writeEmptyElement("br");
  writeSimpleElement(xmlStreamWriter, "strong", "Sensitive Property: true");
if (property.isExpressionLanguageSupported()) {
  xmlStreamWriter.writeEmptyElement("br");
  writeSimpleElement(xmlStreamWriter, "strong", "Supports Expression Language: true");
origin: com.hurence.logisland/logisland-common-processors-plugin

@Override
public void onPropertyModified(PropertyDescriptor descriptor, String oldValue, String newValue) {
  if (descriptor.isDynamic()) {
    if (!StringUtils.equals(oldValue, newValue)) {
      if (oldValue != null) {
        cachedJsonPathMap.remove(oldValue);
      }
    }
  }
}
origin: com.hurence.logisland/logisland-api

@Override
public PropertyValue getPropertyValue(final PropertyDescriptor property) {
  final String configuredValue = properties.get(property);
  return new StandardPropertyValue(configuredValue == null ? property.getDefaultValue() : configuredValue);
}
origin: com.hurence.logisland/logisland-hbase-plugin

@Override
protected Collection<ValidationResult> customValidate(ValidationContext validationContext) {
  final boolean isAvroSerializer = validationContext.getPropertyValue(RECORD_SERIALIZER).asString().toLowerCase().contains("avro");
  final boolean isAvroSchemaSet = validationContext.getPropertyValue(RECORD_SCHEMA).isSet();
  final List<ValidationResult> problems = new ArrayList<>();
  if (isAvroSerializer && !isAvroSchemaSet) {
    problems.add(new ValidationResult.Builder()
        .subject(RECORD_SERIALIZER.getDisplayName())
        .valid(false)
        .explanation("an avro schema must be provided with an avro serializer")
        .build());
  }
  return problems;
}
origin: com.hurence.logisland/logisland-documentation

/**
 * Indicates whether or not the component contains at least one property that supports Expression Language.
 *
 * @param component the component to interogate
 * @return whether or not the component contains at least one sensitive property.
 */
private boolean containsExpressionLanguage(final ConfigurableComponent component) {
  for (PropertyDescriptor descriptor : component.getPropertyDescriptors()) {
    if (descriptor.isExpressionLanguageSupported()) {
      return true;
    }
  }
  return false;
}
origin: com.hurence.logisland/logisland-documentation

if (property.isRequired()) {
  rstWriter.printStrong(property.getDisplayName());
} else {
  rstWriter.print(property.getDisplayName());
if (property.getDescription() != null && property.getDescription().trim().length() > 0) {
  rstWriter.print(property.getDescription());
} else {
  rstWriter.print("No Description Provided.");
rstWriter.print(property.getDefaultValue());
rstWriter.print("\", ");
if (property.isSensitive()) {
  rstWriter.printStrong( "true");
}else {
if (property.isExpressionLanguageSupported()) {
  rstWriter.printStrong( "true");
}else {
origin: com.hurence.logisland/logisland-common-processors-plugin

@Override
protected Collection<ValidationResult> customValidate(final ValidationContext context) {
  final List<ValidationResult> results = new ArrayList<>(super.customValidate(context));
  int jsonPathCount = 0;
  for (final PropertyDescriptor desc : context.getProperties().keySet()) {
    if (desc.isDynamic()) {
      jsonPathCount++;
    }
  }
  if (jsonPathCount != 1) {
    results.add(new ValidationResult.Builder().subject("JsonPaths").valid(false)
        .explanation("Exactly one JsonPath must be set if using d").build());
  }
  return results;
}
origin: com.hurence.logisland/logisland-api

@Override
public PropertyValue getPropertyValue(final String propertyName) {
  final PropertyDescriptor descriptor = component.getPropertyDescriptor(propertyName);
  if (descriptor == null) {
    return null;
  }
  final String setPropertyValue = getProperty(descriptor);
  final String propValue = (setPropertyValue == null) ? descriptor.getDefaultValue() : setPropertyValue;
  return new StandardPropertyValue(propValue);
}
origin: com.hurence.logisland/logisland-redis_4-client-service

    .subject(RedisUtils.CONNECTION_STRING.getDisplayName())
    .valid(false)
    .explanation("Connection String cannot be blank")
if (hostAndPort == null || hostAndPort.length != 2 || StringUtils.isBlank(hostAndPort[0]) || StringUtils.isBlank(hostAndPort[1]) || !isInteger(hostAndPort[1])) {
  results.add(new ValidationResult.Builder()
      .subject(RedisUtils.CONNECTION_STRING.getDisplayName())
      .input(connectionString)
      .valid(false)
  if (hostAndPort == null || hostAndPort.length != 2 || StringUtils.isBlank(hostAndPort[0]) || StringUtils.isBlank(hostAndPort[1]) || !isInteger(hostAndPort[1])) {
    results.add(new ValidationResult.Builder()
        .subject(RedisUtils.CONNECTION_STRING.getDisplayName())
        .input(connection)
        .valid(false)
    .subject(RedisUtils.DATABASE.getDisplayName())
    .valid(false)
    .explanation("Database Index must be 0 when using clustered Redis")
if (StringUtils.isEmpty(sentinelMaster)) {
  results.add(new ValidationResult.Builder()
      .subject(RedisUtils.SENTINEL_MASTER.getDisplayName())
      .valid(false)
      .explanation("Sentinel Master must be provided when Mode is Sentinel")
origin: com.hurence.logisland/logisland-documentation

/**
 * Indicates whether or not the component contains at least one property that supports Expression Language.
 *
 * @param component the component to interogate
 * @return whether or not the component contains at least one sensitive property.
 */
private boolean containsExpressionLanguage(final ConfigurableComponent component) {
  for (PropertyDescriptor descriptor : component.getPropertyDescriptors()) {
    if (descriptor.isExpressionLanguageSupported()) {
      return true;
    }
  }
  return false;
}
origin: com.hurence.logisland/logisland-api

@Override
public void onPropertyModified(PropertyDescriptor descriptor, String oldValue, String newValue) {
  logger.info("property {} value changed from {} to {}", descriptor.getName(), oldValue, newValue);
}
origin: com.hurence.logisland/logisland-common-processors-plugin

private Map<String, String[]> getFieldsNameMapping(ProcessContext context) {
  /**
   * list alternative regex
   */
  Map<String, String[]> fieldsNameMappings = new HashMap<>();
  // loop over dynamic properties to add alternative regex
  for (final Map.Entry<PropertyDescriptor, String> entry : context.getProperties().entrySet()) {
    if (!entry.getKey().isDynamic()) {
      continue;
    }
    final String fieldName = entry.getKey().getName();
    final String[] mapping = entry.getValue().split(",");
    fieldsNameMappings.put(fieldName, mapping);
  }
  return fieldsNameMappings;
}
origin: com.hurence.logisland/logisland-api

@Override
public PropertyValue getPropertyValue(final String propertyName) {
  final PropertyDescriptor descriptor = component.getPropertyDescriptor(propertyName);
  if (descriptor == null) {
    return null;
  }
  final String setPropertyValue = getProperty(descriptor);
  final String propValue = (setPropertyValue == null) ? descriptor.getDefaultValue() : setPropertyValue;
  return PropertyValueFactory.getInstance(descriptor, propValue, controllerServiceLookup);
}
com.hurence.logisland.componentPropertyDescriptor

Javadoc

An immutable object for holding information about a type of processor property.

Most used methods

  • getName
  • isDynamic
  • getDisplayName
  • equals
  • getDefaultValue
  • isExpressionLanguageSupported
  • isRequired
  • <init>
  • getAllowableValues
  • getControllerServiceDefinition
  • getDescription
  • isSensitive
  • getDescription,
  • isSensitive,
  • validate

Popular in Java

  • Start an intent from android
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • addToBackStack (FragmentTransaction)
  • requestLocationUpdates (LocationManager)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now