package geniusweb.profilesserver; import java.io.IOException; import java.util.List; import geniusweb.issuevalue.Domain; import geniusweb.profile.Profile; import geniusweb.profilesserver.events.ChangeEvent; import tudelft.utilities.listener.Listenable; /** * Profiles repository interface defining the access methods to the server. */ public interface ProfilesRepository extends Listenable { /** * * @param domainname a simple name (no extensions or so) as specified in the * domain (so no full path or special characters). * @return domain with the given name or null if no such domain exists. */ Domain getDomain(String domainname); /** * @param profilename simple profile name of the form "domainname/profileX" * (no extendsions). * @return {@link Profile} with the given name and the given domain, or null * if no such domain or profile exists. * */ Profile getProfile(String profilename); /** * @return a list of all domain names */ List getDomains(); /** * @param domainname simple name of the domain. * @return all profiles currently known for given domain */ List getProfiles(String domainname); /** * Permanently (over)write a profile to the repository (not just in memory). * * @param profile the profile to be written. The domain file must exist and * match. * @throws IOException if the profile does not meet the requirements. */ void putProfile(Profile profile) throws IOException; }