Class StorageDecorator


  • public class StorageDecorator
    extends Object
    A utility layer above storage implementation. - Adds fetch-single calls on top of fetch-multiple calls and performs sanity checks.
    • Method Detail

      • fetchTopic

        public TopicModelImpl fetchTopic​(String key,
                                         Object value)
        Retrieves a single topic by exact value (case-sensitive).
        Returns:
        The fetched topic, or null if no such topic exists.
        Throws:
        RuntimeException - if more than one topic exists.
      • queryTopicFulltext

        public TopicModelImpl queryTopicFulltext​(String key,
                                                 Object value)
        Retrieves a single topic by fulltext search (case-insensitive).
        Returns:
        The fetched topic, or null if no such topic exists.
        Throws:
        RuntimeException - if more than one topic exists.
      • fetchAssoc

        public AssocModelImpl fetchAssoc​(String key,
                                         Object value)
        Retrieves a single assoc by exact value.
        Returns:
        The fetched assoc, or null if no such assoc exists.
        Throws:
        RuntimeException - if more than one assoc exists.