Class FieldNameCache

java.lang.Object
gov.nasa.pds.registry.common.meta.FieldNameCache

public class FieldNameCache extends Object
A cache of field names in Elasticsearch schema for the registry index.
Author:
karpenko
  • Constructor Details

    • FieldNameCache

      public FieldNameCache(DataDictionaryDao ddDao, SchemaDao schemaDao)
      Private constructor. Use getInstance() instead.
  • Method Details

    • setSchemaFieldNames

      public void setSchemaFieldNames(Set<String> fieldNames)
      Set field names present in "registry" Elasticsearch schema
      Parameters:
      fieldNames - collection of field names
    • setBooleanFieldNames

      public void setBooleanFieldNames(Set<String> fieldNames)
      Set boolean field names present in LDDs
      Parameters:
      fieldNames - collection of field names
    • setDateFieldNames

      public void setDateFieldNames(Set<String> fieldNames)
      Set date field names present in LDDs
      Parameters:
      fieldNames - collection of field names
    • schemaContainsField

      public boolean schemaContainsField(String name)
      Check if a field name is in the "registry" Elasticsearch schema.
      Parameters:
      name - field name
      Returns:
      true if field name is in "registry" schema.
    • isBooleanField

      public boolean isBooleanField(String name)
      Check if a field is a boolean field.
      Parameters:
      name - field name
      Returns:
      true if this is a boolean field
    • isDateField

      public boolean isDateField(String name)
      Check if a field is a date field.
      Parameters:
      name - field name
      Returns:
      true if this is a date field
    • update

      public void update() throws Exception
      Update cache
      Throws:
      Exception - an exception