org.ocltf.model.repository
Interface Repository


public interface Repository

An interface for objects responsible for being a repository into which an object model can be loaded.

OCLTF does code generation from an object model. There must exist a repository in which the model can be loaded. The repository must be able to load the object model given a URL. Any Repository that supports this API can be used by OCLTF.

See Also:
ModelFacade

Method Summary
 void cleanup()
          Perform any cleanup required.
 long getLastModified()
          Returns the date and time of when the model was last modified
 java.lang.Object getModel()
          returns the top-level model object from the repository
 void init()
          Initialize the repository.
 void loadModel(java.io.InputStream modelStream, java.net.URL modelUri)
          read the object model into the repository from the given stream.
 void loadModel(java.net.URL modelUri)
          Loads the object model into the repository from the given URL.
 

Method Detail

init

public void init()
Initialize the repository.


cleanup

public void cleanup()
Perform any cleanup required.


loadModel

public void loadModel(java.net.URL modelUri)
               throws RepositoryException
Loads the object model into the repository from the given URL.

An URLs can be used to point to files on the filesystem, a file in a jar file, a file from a website, data from a database, etc...

Parameters:
modelUri - the URI of model
Throws:
RepositoryException - thrown if anything happesn during read.

loadModel

public void loadModel(java.io.InputStream modelStream,
                      java.net.URL modelUri)
               throws RepositoryException
read the object model into the repository from the given stream.

An URLs can be used to point to files on the filesystem, a file in a jar file, a file from a website, data from a database, etc...

Parameters:
modelStream - Input stream to be used for reading an XMI document (if null is passed, will try to open a connection to the spefified modelUri.
modelUri - URI of the XMI document to be read from. If set to null, Repository will not be able to resolve relative hrefs.
Throws:
RepositoryException - thrown if anything happesn during read.

getLastModified

public long getLastModified()
Returns the date and time of when the model was last modified

Returns:
the lastModified time

getModel

public java.lang.Object getModel()
returns the top-level model object from the repository

Returns:
Object The model object.


Copyright © 2003-2004 Chad Brandon. All Rights Reserved.