Interface IPreferencesDAO

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean existsKey​(java.lang.String strUserId, java.lang.String strKey)
      Cheks if a preference key exists
      boolean existsValueForKey​(java.lang.String strKey, java.lang.String strValue)
      Checks if a value is already used for a preference given key
      java.util.List<java.lang.String> getUserId​(java.lang.String strKey, java.lang.String strValue)
      Get the list of user id associated with the given key and value
      java.util.List<java.lang.String> keys​(java.lang.String strUserId)
      Get all preference keys for a given user
      java.lang.String load​(java.lang.String strUserId, java.lang.String strKey, java.lang.String strDefault)
      Get a preference for a given user
      void remove​(java.lang.String strUserId)
      Clear all preferences for a given user
      void removeKey​(java.lang.String strUserId, java.lang.String strKey)
      Clear all preferences for a given user
      void removeKeyPrefix​(java.lang.String strUserId, java.lang.String strKeyPrefix)
      Clear all preferences for a given user
      void store​(java.lang.String strUserId, java.lang.String strKey, java.lang.String strValue)
      Store a preference for a given user
    • Method Detail

      • load

        java.lang.String load​(java.lang.String strUserId,
                              java.lang.String strKey,
                              java.lang.String strDefault)
        Get a preference for a given user
        Parameters:
        strUserId - The user's ID
        strKey - The preference's key
        strDefault - The default value
        Returns:
        The preference's value
      • getUserId

        java.util.List<java.lang.String> getUserId​(java.lang.String strKey,
                                                   java.lang.String strValue)
        Get the list of user id associated with the given key and value
        Parameters:
        strKey - The preference's key
        strValue - The preference's value
        Returns:
        The list of user id associated with the given key and value. If there is no user id associated with the parameters, then an empty list is returned
      • store

        void store​(java.lang.String strUserId,
                   java.lang.String strKey,
                   java.lang.String strValue)
        Store a preference for a given user
        Parameters:
        strUserId - The user's ID
        strKey - The preference's key
        strValue - The value
      • keys

        java.util.List<java.lang.String> keys​(java.lang.String strUserId)
        Get all preference keys for a given user
        Parameters:
        strUserId - The user's ID
        Returns:
        The keys
      • remove

        void remove​(java.lang.String strUserId)
        Clear all preferences for a given user
        Parameters:
        strUserId - The user's ID
      • removeKey

        void removeKey​(java.lang.String strUserId,
                       java.lang.String strKey)
        Clear all preferences for a given user
        Parameters:
        strUserId - The user's ID
        strKey - The preference's key
      • removeKeyPrefix

        void removeKeyPrefix​(java.lang.String strUserId,
                             java.lang.String strKeyPrefix)
        Clear all preferences for a given user
        Parameters:
        strUserId - The user's ID
        strKeyPrefix - The key prefix
      • existsKey

        boolean existsKey​(java.lang.String strUserId,
                          java.lang.String strKey)
        Cheks if a preference key exists
        Parameters:
        strUserId - The User ID
        strKey - The Pref key
        Returns:
        1 if exists otherwise false
      • existsValueForKey

        boolean existsValueForKey​(java.lang.String strKey,
                                  java.lang.String strValue)
        Checks if a value is already used for a preference given key
        Parameters:
        strKey - The Pref key
        strValue - The Pref value
        Returns:
        1 if exists otherwise false