Class PreferencesImpl

java.lang.Object
org.codice.ddf.preferences.impl.PreferencesImpl
All Implemented Interfaces:
org.codice.ddf.preferences.Preferences

public class PreferencesImpl extends Object implements org.codice.ddf.preferences.Preferences
This stores each preference as a JSON string regardless of the underlying type. This allows every preference to be treated the same way.

This implementation pulls in instances of DefaultPreferencesSupplier that are used to populate the preferences if it does not already exist in the catalog. This allows new preferences and its default value to defined by new modules.

This implementation pulls in instances of PostRetrievalPlugin that are applied to the preferences everytime they are queried.

  • Constructor Summary

    Constructors
    Constructor
    Description
    PreferencesImpl(ddf.catalog.CatalogFramework catalogFramework, ddf.catalog.filter.FilterBuilder filterBuilder, org.codice.ddf.platform.util.uuidgenerator.UuidGenerator uuidGenerator, List<org.codice.ddf.preferences.PostRetrievalPlugin> postRetrievalPlugins, List<org.codice.ddf.preferences.DefaultPreferencesSupplier> defaultPreferencesSuppliers, List<ddf.catalog.data.InjectableAttribute> injectableAttributes)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(Map<String,Object> preferences, String userId)
     
    get(String userId)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PreferencesImpl

      public PreferencesImpl(ddf.catalog.CatalogFramework catalogFramework, ddf.catalog.filter.FilterBuilder filterBuilder, org.codice.ddf.platform.util.uuidgenerator.UuidGenerator uuidGenerator, List<org.codice.ddf.preferences.PostRetrievalPlugin> postRetrievalPlugins, List<org.codice.ddf.preferences.DefaultPreferencesSupplier> defaultPreferencesSuppliers, List<ddf.catalog.data.InjectableAttribute> injectableAttributes)
  • Method Details

    • add

      public void add(Map<String,Object> preferences, String userId) throws org.codice.ddf.preferences.PreferencesException
      Specified by:
      add in interface org.codice.ddf.preferences.Preferences
      Throws:
      org.codice.ddf.preferences.PreferencesException
    • get

      public Map<String,Object> get(String userId) throws org.codice.ddf.preferences.PreferencesException
      Specified by:
      get in interface org.codice.ddf.preferences.Preferences
      Throws:
      org.codice.ddf.preferences.PreferencesException