package org.pegadi.server.user.preferences;
import java.util.Properties;
public interface PreferenceServer {
/**
* Get a single user preference. If there are no preference saved with
* the domain-key combination for the user this method will return
* <code>null</code>.
*
* @param userID The user ID.
* @param domain The preference domain.
* @param key The name of the preference.
* @return The value of the preference, or <code>null</code>.
*/
public String getPreference(String userID, String domain, String key);
/**
* Get all the preferences for a domain. The method will always return
* a valid <code>Properties</code> object, even if the domain does not
* exists for this user.
*
* @param userID The user ID.
* @param domain The preference domain.
* @return All preferences for this domain. The object will be empty if no
* preferences were found.
*/
public Properties getPreferences(String userID, String domain);
/**
* Save an user preference. The domain-key combination need not exist,
* but if it exists it will be replaced.
*
* @param userID The user ID.
* @param domain The preference domain.
* @param key The name of the preference.
* @param value The value of the preference.
*/
public void savePreference(String userID, String domain, String key, String value);
}