1 package org.andromda.core.common; 2 3 import java.io.IOException; 4 import java.net.URL; 5 6 /*** 7 * An interface for objects responsible for being a repository into which an object model can 8 * be loaded. 9 * 10 * <p> AndroMDA does code generation from an object model. There must exist a repository in which 11 * the model can be loaded. The repository must be able to load the object model 12 * given a URL. Any repository that supports this API can be used by AndroMDA. </p> 13 * 14 * @see org.andromda.core.common.ScriptHelper 15 * 16 * @author <A HREF="http://www.amowers.com">Anthony Mowers</A> 17 */ 18 public interface RepositoryFacade 19 { 20 21 /*** 22 * open and initialize the repository. 23 * 24 */ 25 public void open(); 26 27 28 /*** 29 * close the repository and reclaim all resources 30 * 31 */ 32 public void close(); 33 34 /*** 35 * read the object model into the repository from the given URL. 36 * 37 * <p> An URLs can be used to point to files on the filesystem, 38 * a file in a jar file, a file from a website, data from a database, etc... </p> 39 * 40 * @param modelURL url of model 41 * @throws MetaDataReadException if model syntax is violated 42 * @throws IOException if io error occurs during file read 43 */ 44 public void readModel(URL modelURL) throws RepositoryReadException, IOException; 45 46 /*** 47 * returns the date and time of when the model was last modified 48 * 49 *@return the lastModified time 50 */ 51 public long getLastModified(); 52 53 /*** 54 * returns the top-level model object from the repository 55 * 56 *@return The model value 57 */ 58 public Object getModel(); 59 60 }