001 // This file is part of AceWiki. 002 // Copyright 2008-2012, AceWiki developers. 003 // 004 // AceWiki is free software: you can redistribute it and/or modify it under the terms of the GNU 005 // Lesser General Public License as published by the Free Software Foundation, either version 3 of 006 // the License, or (at your option) any later version. 007 // 008 // AceWiki is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without 009 // even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 010 // Lesser General Public License for more details. 011 // 012 // You should have received a copy of the GNU Lesser General Public License along with AceWiki. If 013 // not, see http://www.gnu.org/licenses/. 014 015 package ch.uzh.ifi.attempto.acewiki.core; 016 017 import java.util.Map; 018 019 /** 020 * This interface describes a storage object that can store ontologies and user bases in a 021 * persistent manner. 022 * 023 * @author Tobias Kuhn 024 */ 025 public interface AceWikiStorage { 026 027 /** 028 * Returns the ontology with the respective name. 029 * 030 * @param name The name of the ontology. 031 * @param parameters Parameters in case the ontology object has to be created. 032 * @return The ontology object. 033 */ 034 public Ontology getOntology(String name, Map<String, String> parameters); 035 036 /** 037 * Saves the given ontology element. 038 * 039 * @param oe The ontology element to be saved. 040 */ 041 public void save(OntologyElement oe); 042 043 /** 044 * Returns the user base for the given ontology. 045 * 046 * @param ontology The ontology. 047 * @return The user base. 048 */ 049 public UserBase getUserBase(Ontology ontology); 050 051 /** 052 * Saves the given user. 053 * 054 * @param user The user to be saved. 055 */ 056 public void save(User user); 057 058 }