Class MetacardServices

java.lang.Object
org.codice.ddf.catalog.plugin.metacard.util.MetacardServices

public class MetacardServices extends Object
Support and bulk operations for Metacards. Contains state relevant to the provided services.
  • Constructor Details

    • MetacardServices

      public MetacardServices()
      Initializes the services with an empty list of system MetacardTypes.
    • MetacardServices

      public MetacardServices(List<ddf.catalog.data.MetacardType> systemMetacardTypes)
      Initializes the services with the provided list of MetacardTypes.
      Parameters:
      systemMetacardTypes - The list of metacard types to use.
  • Method Details

    • setAttributesIfAbsent

      public List<ddf.catalog.data.Metacard> setAttributesIfAbsent(List<ddf.catalog.data.Metacard> metacards, Map<String,String> attributeMap, AttributeFactory attributeFactory)
      Returns a new list of new Metacards created from the collection and applies each attribute in the only if the attribute is not already set on the Metacard. That is, the attribute must be null or not in the Metacard's map. Appropriate AttributeDescriptors are injected into a new MetacardType for each new Metacard created.
      Parameters:
      metacards - The list of metacards to attempt to add the attributes to. Can be empty.
      attributeMap - The map of attributes to attempt to add. Attributes already set on any given Metacard will not be changed. For multi-valued attributes, the value string should separate different entities with commas.
      attributeFactory - The factory to use to create attributes.