Class MetacardValidityFilterPlugin

java.lang.Object
ddf.catalog.plugin.PreFederatedLocalProviderQueryPlugin
ddf.catalog.metacard.validation.MetacardValidityFilterPlugin
All Implemented Interfaces:
ddf.catalog.plugin.PolicyPlugin, ddf.catalog.plugin.PreFederatedQueryPlugin

public class MetacardValidityFilterPlugin extends ddf.catalog.plugin.PreFederatedLocalProviderQueryPlugin implements ddf.catalog.plugin.PolicyPlugin
A PreFederatedQueryPlugin and PolicyPlugin which performs filtering of Metacards. For the PreFederatedQueryPlugin, the Query's filter is modified, which can help improve performance. For the PolicyPlugin, filtering is done post-query on the resulting Metacards from the query.

User roles are checked at both the PreFederatedQueryPlugin and PolicyPlugin post-query points.

  • Constructor Details

    • MetacardValidityFilterPlugin

      public MetacardValidityFilterPlugin(ddf.catalog.filter.FilterBuilder filterBuilder, List<ddf.catalog.source.CatalogProvider> catalogProviders)
  • Method Details

    • processPreCreate

      public ddf.catalog.plugin.PolicyResponse processPreCreate(ddf.catalog.data.Metacard input, Map<String,Serializable> properties) throws ddf.catalog.plugin.StopProcessingException
      Specified by:
      processPreCreate in interface ddf.catalog.plugin.PolicyPlugin
      Throws:
      ddf.catalog.plugin.StopProcessingException
    • processPreUpdate

      public ddf.catalog.plugin.PolicyResponse processPreUpdate(ddf.catalog.data.Metacard input, Map<String,Serializable> properties) throws ddf.catalog.plugin.StopProcessingException
      Specified by:
      processPreUpdate in interface ddf.catalog.plugin.PolicyPlugin
      Throws:
      ddf.catalog.plugin.StopProcessingException
    • processPreDelete

      public ddf.catalog.plugin.PolicyResponse processPreDelete(List<ddf.catalog.data.Metacard> metacards, Map<String,Serializable> properties) throws ddf.catalog.plugin.StopProcessingException
      Specified by:
      processPreDelete in interface ddf.catalog.plugin.PolicyPlugin
      Throws:
      ddf.catalog.plugin.StopProcessingException
    • processPostDelete

      public ddf.catalog.plugin.PolicyResponse processPostDelete(ddf.catalog.data.Metacard input, Map<String,Serializable> properties) throws ddf.catalog.plugin.StopProcessingException
      Specified by:
      processPostDelete in interface ddf.catalog.plugin.PolicyPlugin
      Throws:
      ddf.catalog.plugin.StopProcessingException
    • processPreQuery

      public ddf.catalog.plugin.PolicyResponse processPreQuery(ddf.catalog.operation.Query query, Map<String,Serializable> properties) throws ddf.catalog.plugin.StopProcessingException
      Specified by:
      processPreQuery in interface ddf.catalog.plugin.PolicyPlugin
      Throws:
      ddf.catalog.plugin.StopProcessingException
    • processPostQuery

      public ddf.catalog.plugin.PolicyResponse processPostQuery(ddf.catalog.data.Result input, Map<String,Serializable> properties) throws ddf.catalog.plugin.StopProcessingException
      Specified by:
      processPostQuery in interface ddf.catalog.plugin.PolicyPlugin
      Throws:
      ddf.catalog.plugin.StopProcessingException
    • process

      public ddf.catalog.operation.QueryRequest process(ddf.catalog.source.Source source, ddf.catalog.operation.QueryRequest input) throws ddf.catalog.plugin.StopProcessingException
      Modifies the incoming QueryRequests filter depending upon the configuration for this plugin. If a Subject contains the appropriate configured roles, it will always receive Metacards with errors and/or warnings, otherwise the Subject will receive results based on the filterErrors and filterWarnings flags.
      Specified by:
      process in interface ddf.catalog.plugin.PreFederatedQueryPlugin
      Specified by:
      process in class ddf.catalog.plugin.PreFederatedLocalProviderQueryPlugin
      Parameters:
      source - Source being queried
      input - QueryRequest being sent to the Source
      Returns:
      new QueryRequest if the filter was modified, otherwise the original QueryRequest
      Throws:
      ddf.catalog.plugin.StopProcessingException - if the Subject is not available
    • processPreResource

      public ddf.catalog.plugin.PolicyResponse processPreResource(ddf.catalog.operation.ResourceRequest resourceRequest) throws ddf.catalog.plugin.StopProcessingException
      Specified by:
      processPreResource in interface ddf.catalog.plugin.PolicyPlugin
      Throws:
      ddf.catalog.plugin.StopProcessingException
    • processPostResource

      public ddf.catalog.plugin.PolicyResponse processPostResource(ddf.catalog.operation.ResourceResponse resourceResponse, ddf.catalog.data.Metacard metacard) throws ddf.catalog.plugin.StopProcessingException
      Specified by:
      processPostResource in interface ddf.catalog.plugin.PolicyPlugin
      Throws:
      ddf.catalog.plugin.StopProcessingException
    • setFilterErrors

      public void setFilterErrors(boolean filterErrors)
    • getFilterErrors

      public boolean getFilterErrors()
    • setFilterWarnings

      public void setFilterWarnings(boolean filterWarnings)
    • getFilterWarnings

      public boolean getFilterWarnings()
    • getAttributeMap

      public Map<String,List<String>> getAttributeMap()
    • setPermissions

      public void setPermissions(ddf.security.permission.Permissions permissions)
    • setAttributeMap

      public void setAttributeMap(Map<String,List<String>> attributeMap)
      Even though Blueprint uses the other setter, at least one Setter method has to match the type of the Getter method for property attributeMap or an exception will be thrown.
    • setAttributeMap

      public void setAttributeMap(List<String> attributeMappings)